Documentation ¶
Index ¶
- Constants
- func NewMock(clock clock.Clock) (Client, *Mock)
- func NewMonitor[T Tags](client Client, tags T, getter func() float64)
- type AnyMetric
- type Client
- type Impl
- type LabeledError
- type Metric
- func (gm *Metric[T]) Construct(values []reflect.Value) error
- func (metric *Metric[T]) DeferCount(start time.Time, tags T)
- func (*Metric[T]) ImplementsGenericUtilMarker()
- func (gm *Metric[T]) MetricImpl() MetricImpl
- func (*Metric[T]) MetricType() reflect.Type
- func (*Metric[T]) UtilReqs() []reflect.Type
- func (metric *Metric[T]) With(tags T) TaggedMetric
- type MetricImpl
- type Mock
- type MockEntry
- type TaggedMetric
- func (metric TaggedMetric) Count(value float64)
- func (metric TaggedMetric) Defer(start time.Time)
- func (metric TaggedMetric) DeferCount(start time.Time)
- func (metric TaggedMetric) Gauge(value float64)
- func (metric TaggedMetric) Histogram(value float64)
- func (metric TaggedMetric) Summary(value float64)
- type Tags
Constants ¶
View Source
const MonitorPeriod = time.Second * 30
Variables ¶
This section is empty.
Functions ¶
func NewMonitor ¶
Types ¶
type AnyMetric ¶
type AnyMetric interface { MetricType() reflect.Type MetricImpl() MetricImpl }
type Impl ¶
type Impl interface {
New(name string, tagNames []string) MetricImpl
}
type LabeledError ¶
type LabeledError interface { error }
func LabelError ¶
func LabelError(err error, value string) LabeledError
func MakeLabeledError ¶
func MakeLabeledError(value string) LabeledError
type Metric ¶
type Metric[T Tags] struct { // contains filtered or unexported fields }
func (*Metric[T]) DeferCount ¶
func (*Metric[T]) ImplementsGenericUtilMarker ¶
func (*Metric[T]) ImplementsGenericUtilMarker()
func (*Metric[T]) MetricImpl ¶
func (gm *Metric[T]) MetricImpl() MetricImpl
func (*Metric[T]) MetricType ¶
func (*Metric[T]) With ¶
func (metric *Metric[T]) With(tags T) TaggedMetric
type MetricImpl ¶
type MetricImpl interface { Count(value float64, tags []string) Histogram(value float64, tags []string) Summary(value float64, tags []string) Gauge(value float64, tags []string) Defer(start time.Time, tags []string) }
func NewDynamic ¶
func NewDynamic(client Client, name string, tagNames []string) MetricImpl
type Mock ¶
type Mock struct { manager.MuxImplBase manager.BaseComponent // contains filtered or unexported fields }
func (*Mock) MuxImplName ¶
type MockEntry ¶
func (*MockEntry) GetIntUnsafe ¶
Returns the scalar value, or 0 if the receiver is nil. Since this function is only used for assertions after running a test, the mutex is not locked.
type TaggedMetric ¶
type TaggedMetric struct {
// contains filtered or unexported fields
}
func (TaggedMetric) Count ¶
func (metric TaggedMetric) Count(value float64)
func (TaggedMetric) Defer ¶
func (metric TaggedMetric) Defer(start time.Time)
func (TaggedMetric) DeferCount ¶
func (metric TaggedMetric) DeferCount(start time.Time)
func (TaggedMetric) Gauge ¶
func (metric TaggedMetric) Gauge(value float64)
func (TaggedMetric) Histogram ¶
func (metric TaggedMetric) Histogram(value float64)
func (TaggedMetric) Summary ¶
func (metric TaggedMetric) Summary(value float64)
Click to show internal directories.
Click to hide internal directories.