histogram.go 404 B

12345678910111213141516171819202122
  1. package prometheus
  2. import (
  3. "time"
  4. "github.com/prometheus/client_golang/prometheus"
  5. "github.com/ydb-platform/ydb/library/go/core/metrics"
  6. )
  7. var _ metrics.Histogram = (*Histogram)(nil)
  8. type Histogram struct {
  9. hm prometheus.Observer
  10. }
  11. func (h Histogram) RecordValue(value float64) {
  12. h.hm.Observe(value)
  13. }
  14. func (h Histogram) RecordDuration(value time.Duration) {
  15. h.hm.Observe(value.Seconds())
  16. }