mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-17 12:35:26 +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(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
xidCurrent,
|
xidCurrent,
|
||||||
prometheus.CounterValue,
|
prometheus.GaugeValue,
|
||||||
current,
|
current,
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
xidXmin,
|
xidXmin,
|
||||||
prometheus.CounterValue,
|
prometheus.GaugeValue,
|
||||||
xmin,
|
xmin,
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
|
@ -50,8 +50,8 @@ func TestPgXidCollector(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
expected := []MetricResult{
|
expected := []MetricResult{
|
||||||
{labels: labelMap{}, value: 22, metricType: dto.MetricType_COUNTER},
|
{labels: labelMap{}, value: 22, metricType: dto.MetricType_GAUGE},
|
||||||
{labels: labelMap{}, value: 25, metricType: dto.MetricType_COUNTER},
|
{labels: labelMap{}, value: 25, metricType: dto.MetricType_GAUGE},
|
||||||
{labels: labelMap{}, value: 30, metricType: dto.MetricType_GAUGE},
|
{labels: labelMap{}, value: 30, metricType: dto.MetricType_GAUGE},
|
||||||
}
|
}
|
||||||
convey.Convey("Metrics comparison", t, func() {
|
convey.Convey("Metrics comparison", t, func() {
|
||||||
@ -92,8 +92,8 @@ func TestPgNanCollector(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
expected := []MetricResult{
|
expected := []MetricResult{
|
||||||
{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_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() {
|
convey.Convey("Metrics comparison", t, func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user