Change to Gauge

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
This commit is contained in:
Felix Yuan 2023-07-10 10:42:19 -07:00
parent 5214aae34d
commit 4d68e2df68
2 changed files with 6 additions and 6 deletions

View File

@ -78,12 +78,12 @@ func (PGXidCollector) Update(ctx context.Context, instance *instance, ch chan<-
ch <- prometheus.MustNewConstMetric(
xidCurrent,
prometheus.CounterValue,
prometheus.GaugeValue,
current,
)
ch <- prometheus.MustNewConstMetric(
xidXmin,
prometheus.CounterValue,
prometheus.GaugeValue,
xmin,
)
ch <- prometheus.MustNewConstMetric(

View File

@ -50,8 +50,8 @@ func TestPgXidCollector(t *testing.T) {
}
}()
expected := []MetricResult{
{labels: labelMap{}, value: 22, metricType: dto.MetricType_COUNTER},
{labels: labelMap{}, value: 25, metricType: dto.MetricType_COUNTER},
{labels: labelMap{}, value: 22, metricType: dto.MetricType_GAUGE},
{labels: labelMap{}, value: 25, metricType: dto.MetricType_GAUGE},
{labels: labelMap{}, value: 30, metricType: dto.MetricType_GAUGE},
}
convey.Convey("Metrics comparison", t, func() {
@ -92,8 +92,8 @@ func TestPgNanCollector(t *testing.T) {
}
}()
expected := []MetricResult{
{labels: labelMap{}, value: math.NaN(), metricType: dto.MetricType_COUNTER},
{labels: labelMap{}, value: math.NaN(), metricType: dto.MetricType_COUNTER},
{labels: labelMap{}, value: math.NaN(), metricType: dto.MetricType_GAUGE},
{labels: labelMap{}, value: math.NaN(), metricType: dto.MetricType_GAUGE},
{labels: labelMap{}, value: math.NaN(), metricType: dto.MetricType_GAUGE},
}
convey.Convey("Metrics comparison", t, func() {