Documentation
¶
Overview ¶
Package local contains a simple often non-blocking (on Increment) thread-safe counters that can be used across multiple goroutines, with results collected at the end.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a custom implementation of a counter.
func (*Counter) Close ¶
func (c *Counter) Close()
Close processes any remaining queued increments. This should be called only after all Increments to this counter have been called or sent already.
func (*Counter) Init ¶
func (c *Counter) Init(name, description, unit string, aggr aggregation.Aggregation, tagKeys ...string) error
Init should be called once before the Record method is called on this counter. Subsequent calls to Record() should provide the TagValues to the TagKeys in the same order specified in Init. TagKeys should be a closed set of values, for example FHIR Resource type. Counters should not store any PHI.
func (*Counter) MaybeGetResult ¶
MaybeGetResult returns a copy of the results for this counter.
type Latency ¶
type Latency struct {
// contains filtered or unexported fields
}
Latency is a custom implementation of distribution/histogram metric.
func (*Latency) Close ¶
func (l *Latency) Close()
Close processes any remaining queued increments. This should be called only after all Increments to this latency have been called or sent already.
func (*Latency) Init ¶
Init should be called once before the Record method is called on this counter. Subsequent calls to Record() should provide the TagValues to the TagKeys in the same order specified in Init. TagKeys should be a closed set of values, for example FHIR Resource type. Counters should not store any PHI. The distribution is defined by the Buckets. For example, Buckets: [0, 3, 5] will create a distribution with 4 buckets where the last bucket is anything > 5. Dist: <0, >=0 <3, >=3 <5, >=5.
func (*Latency) MaybeGetResult ¶
MaybeGetResult returns a copy of the results of the latency.