mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-09 02:31:33 +00:00
Change to Gauge
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
This commit is contained in:
parent
5214aae34d
commit
4d68e2df68
@ -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(
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user