MCPcopy Index your code
hub / github.com/coder/coder / asPrometheusValueType

Function asPrometheusValueType

coderd/prometheusmetrics/aggregator.go:533–542  ·  view source on GitHub ↗
(metricType agentproto.Stats_Metric_Type)

Source from the content-addressed store, hash-verified

531}
532
533func asPrometheusValueType(metricType agentproto.Stats_Metric_Type) (prometheus.ValueType, error) {
534 switch metricType {
535 case agentproto.Stats_Metric_GAUGE:
536 return prometheus.GaugeValue, nil
537 case agentproto.Stats_Metric_COUNTER:
538 return prometheus.CounterValue, nil
539 default:
540 return -1, xerrors.Errorf("unsupported value type: %s", metricType)
541 }
542}

Callers 1

asPrometheusMethod · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected