timer.go 347 B

123456789101112131415161718192021
  1. package mock
  2. import (
  3. "time"
  4. "github.com/ydb-platform/ydb/library/go/core/metrics"
  5. "go.uber.org/atomic"
  6. )
  7. var _ metrics.Timer = (*Timer)(nil)
  8. // Timer measures gauge duration.
  9. type Timer struct {
  10. Name string
  11. Tags map[string]string
  12. Value *atomic.Duration
  13. }
  14. func (t *Timer) RecordDuration(value time.Duration) {
  15. t.Value.Store(value)
  16. }