Skip to content

Commit

Permalink
Change to Gauge
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
  • Loading branch information
Sticksman committed Jul 10, 2023
1 parent 5214aae commit 4d68e2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions collector/pg_xid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions collector/pg_xid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 4d68e2d

Please sign in to comment.