Documentation
¶
Index ¶
- type AgeGauge
- type Counter
- type DistributionSummary
- type Gauge
- type Id
- func (id *Id) MapKey() string
- func (id *Id) Name() string
- func (id *Id) String() string
- func (id *Id) Tags() map[string]string
- func (id *Id) WithDefaultStat(stat string) *Id
- func (id *Id) WithStat(stat string) *Id
- func (id *Id) WithTag(key string, value string) *Id
- func (id *Id) WithTags(tags map[string]string) *Id
- type MaxGauge
- type MonotonicCounter
- type PercentileDistributionSummary
- type PercentileTimer
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgeGauge ¶ added in v1.1.0
type AgeGauge struct {
// contains filtered or unexported fields
}
AgeGauge represents a value that is the time in seconds since the epoch at which an event has successfully occurred, or 0 to use the current time in epoch seconds. After an Age Gauge has been set, it will continue reporting the number of seconds since the last time recorded, for as long as the spectatord process runs. The purpose of this metric type is to enable users to more easily implement the Time Since Last Success alerting pattern.
To set `now()` as the last success, set a value of 0.
func NewAgeGauge ¶ added in v1.1.0
NewAgeGauge generates a new gauge, using the provided meter identifier.
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is used to measure the rate at which some event is occurring. This type is safe for concurrent use.
You can find more about this type by viewing the relevant Java Spectator documentation here:
https://netflix.github.io/spectator/en/latest/intro/counter/
func NewCounter ¶
NewCounter generates a new counter, using the provided meter identifier.
type DistributionSummary ¶
type DistributionSummary struct {
// contains filtered or unexported fields
}
DistributionSummary is used to track the distribution of events. This is safe for concurrent use.
You can find more about this type by viewing the relevant Java Spectator documentation here:
https://netflix.github.io/spectator/en/latest/intro/dist-summary/
func NewDistributionSummary ¶
func NewDistributionSummary(id *Id, writer writer.Writer) *DistributionSummary
NewDistributionSummary generates a new distribution summary, using the provided meter identifier.
func (*DistributionSummary) MeterId ¶
func (d *DistributionSummary) MeterId() *Id
MeterId returns the meter identifier.
func (*DistributionSummary) Record ¶
func (d *DistributionSummary) Record(amount int64)
Record records a value to track within the distribution.
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge represents a value that is sampled at a specific point in time. One example might be the pending messages in a queue. This type is safe for concurrent use.
You can find more about this type by viewing the relevant Java Spectator documentation here:
https://netflix.github.io/spectator/en/latest/intro/gauge/
func NewGaugeWithTTL ¶
NewGaugeWithTTL generates a new gauge, using the provided meter identifier and ttl.
type Id ¶
type Id struct {
// contains filtered or unexported fields
}
Id represents a meter's identifying information and dimensions (tags).
func NewId ¶
NewId generates a new *Id from the metric name, and the tags you want to include on your metric.
func (*Id) MapKey ¶
MapKey computes and saves a key within the struct to be used to uniquely identify this *Id in a map. This does use the information from within the *Id, so it assumes you've not accidentally double-declared this *Id.
func (*Id) Tags ¶
Tags directly exposes the internal tags map. This is not a copy of the map, so any modifications to it will be observed by the *Id.
func (*Id) WithDefaultStat ¶
WithDefaultStat is effectively the WithStat() method, except it only creates the deep copy if the "statistic" tag is not set or is set to empty string. If the "statistic" tag is already present, the *Id is returned without being copied.
func (*Id) WithStat ¶
WithStat is id.WithTag("statistic", stat). See that method's documentation for more info.
type MaxGauge ¶
type MaxGauge struct {
// contains filtered or unexported fields
}
MaxGauge represents a value that is sampled at a specific point in time. One example might be the pending messages in a queue. This type is safe for concurrent use.
You can find more about this type by viewing the relevant Java Spectator documentation here:
https://netflix.github.io/spectator/en/latest/intro/gauge/
func NewMaxGauge ¶
NewMaxGauge generates a new gauge, using the provided meter identifier.
type MonotonicCounter ¶ added in v1.1.0
type MonotonicCounter struct {
// contains filtered or unexported fields
}
MonotonicCounter is used to measure the rate at which some event is occurring. This type is safe for concurrent use.
The value is a monotonically increasing number. A minimum of two samples must be received in order for spectatord to calculate a delta value and report it to the backend.
A variety of networking metrics may be reported monotonically and this metric type provides a convenient means of recording these values, at the expense of a slower time-to-first metric.
func NewMonotonicCounter ¶ added in v1.1.0
func NewMonotonicCounter(id *Id, writer writer.Writer) *MonotonicCounter
NewMonotonicCounter generates a new counter, using the provided meter identifier.
func (*MonotonicCounter) MeterId ¶ added in v1.1.0
func (c *MonotonicCounter) MeterId() *Id
MeterId returns the meter identifier.
func (*MonotonicCounter) Set ¶ added in v1.1.0
func (c *MonotonicCounter) Set(value uint64)
Set sets a value as the current measurement; spectatord calculates the delta.
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(id *Id, writer writer.Writer) *PercentileDistributionSummary
NewPercentileDistributionSummary creates a new *PercentileDistributionSummary using the meter identifier.
func (*PercentileDistributionSummary) MeterId ¶
func (p *PercentileDistributionSummary) MeterId() *Id
func (*PercentileDistributionSummary) Record ¶
func (p *PercentileDistributionSummary) Record(amount int64)
Record records an amount to track within the distribution.
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( id *Id, writer writer.Writer, ) *PercentileTimer
func (*PercentileTimer) MeterId ¶
func (t *PercentileTimer) MeterId() *Id
func (*PercentileTimer) Record ¶
func (t *PercentileTimer) Record(amount time.Duration)
Record records the value for a single event.