Documentation ¶
Overview ¶
Package histogram provides types and functionality for capturing metrics, and presenting them as percentiles.
Index ¶
- func PercentileBucketsBucket(v int64) int64
- func PercentileBucketsIndex(v int64) int
- func PercentileBucketsLength() int
- func PercentileBucketsPercentile(counts []int64, pct float64) float64
- func PercentileBucketsPercentiles(counts []int64, pcts []float64) []float64
- func PercentileTimerBuilder() *percTimerBuilder
- type PercentileDistributionSummary
- type PercentileTimer
- func NewPercentileTimer(registry *spectator.Registry, name string, tags map[string]string) *PercentileTimer
- func NewPercentileTimerWithId(registry *spectator.Registry, id *spectator.Id) *PercentileTimer
- func NewPercentileTimerWithIdRange(registry *spectator.Registry, id *spectator.Id, minDuration time.Duration, ...) *PercentileTimer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PercentileBucketsBucket ¶
PercentileBucketsBucket returns the bucketValue for the specific value.
func PercentileBucketsIndex ¶
PercentileBucketsIndex calculates which bucket handles that specific value.
func PercentileBucketsLength ¶
func PercentileBucketsLength() int
PercentileBucketsLength returns the lengths of the package local bucketValues variable, to give an idea of how many buckets exist.
func PercentileBucketsPercentile ¶
PercentileBucketsPercentile takes the counts, and returns the requested percentile value based on the counts.
func PercentileBucketsPercentiles ¶
PercentileBucketsPercentiles takes the counts, and desired percentiles, and generates the proper results.
func PercentileTimerBuilder ¶
func PercentileTimerBuilder() *percTimerBuilder
PercentileTimerBuilder returns a builder of the *PercentileTimer, which has some default values. You do this by calling the Build method on the returned value.
Types ¶
type PercentileDistributionSummary ¶
type PercentileDistributionSummary struct {
// contains filtered or unexported fields
}
PercentileDistributionSummary is a distribution summary used to track the distribution of events, while also presenting the results as percentiles.
func NewPercentileDistributionSummary ¶
func NewPercentileDistributionSummary(registry *spectator.Registry, name string, tags map[string]string) *PercentileDistributionSummary
NewPercentileDistributionSummary creates a new *PercentileDistributionSummary using the registry to create the meter identifier.
func NewPercentileDistributionSummaryWithId ¶
func NewPercentileDistributionSummaryWithId(registry *spectator.Registry, id *spectator.Id) *PercentileDistributionSummary
NewPercentileDistributionSummaryWithId creates a new *PercentileDistributionSummary using the meter identifier.
func (*PercentileDistributionSummary) Count ¶
func (t *PercentileDistributionSummary) Count() int64
Count returns the number of unique events that have been tracked.
func (*PercentileDistributionSummary) Percentile ¶
func (t *PercentileDistributionSummary) Percentile(p float64) float64
Percentile returns the distribution for a specific percentile.
func (*PercentileDistributionSummary) Record ¶
func (t *PercentileDistributionSummary) Record(amount int64)
Record records a new value to track within the distribution.
func (*PercentileDistributionSummary) TotalAmount ¶
func (t *PercentileDistributionSummary) TotalAmount() int64
TotalAmount is the total of all records summed together.
type PercentileTimer ¶
type PercentileTimer struct {
// contains filtered or unexported fields
}
PercentileTimer represents timing events, while capturing the histogram (percentiles) of those values.
func NewPercentileTimer ¶
func NewPercentileTimer(registry *spectator.Registry, name string, tags map[string]string) *PercentileTimer
NewPercentileTimer creates a new *PercentileTimer using the registry to create the meter identifier.
func NewPercentileTimerWithId ¶
func NewPercentileTimerWithId(registry *spectator.Registry, id *spectator.Id) *PercentileTimer
NewPercentileTimerWithId creates a new *PercentileTimer using the meter identifier.
func NewPercentileTimerWithIdRange ¶
func NewPercentileTimerWithIdRange(registry *spectator.Registry, id *spectator.Id, minDuration time.Duration, maxDuration time.Duration) *PercentileTimer
NewPercentileTimerWithIdRange creates a new *PercentileTimer, while specifying the minimum / maximum range.
func (*PercentileTimer) Count ¶
func (t *PercentileTimer) Count() int64
Count returns the count of timed events.
func (*PercentileTimer) Percentile ¶
func (t *PercentileTimer) Percentile(p float64) float64
Percentile returns the latency for a specific percentile.
func (*PercentileTimer) Record ¶
func (t *PercentileTimer) Record(amount time.Duration)
Record records the value for a single event.
func (*PercentileTimer) TotalTime ¶
func (t *PercentileTimer) TotalTime() time.Duration
TotalTime returns the total duration.