aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/core/metrics/prometheus/histogram.go
blob: bd5e0dca6665954f21ab69e40ab07f22555e9edc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package prometheus

import (
	"time"

	"github.com/prometheus/client_golang/prometheus"
	"github.com/ydb-platform/ydb/library/go/core/metrics"
)

var _ metrics.Histogram = (*Histogram)(nil)

type Histogram struct {
	hm prometheus.Observer
}

func (h Histogram) RecordValue(value float64) {
	h.hm.Observe(value)
}

func (h Histogram) RecordDuration(value time.Duration) {
	h.hm.Observe(value.Seconds())
}