Documentation
¶
Index ¶
- Constants
- func ErrorOnly() counter.Provider
- func ErrorWrap(err error) errorWrap
- func NewCache() counter.Provider
- func NewClient() counter.Provider
- func NewCtxErrOnly() counter.Provider
- func NewHttp() counter.Provider
- func NewWrite() counter.Provider
- func TestMapping(t *testing.T, builder func() counter.Provider)
- type Count
- type Dir
- type E
- type GMeter
- type Occupancy
- type Sum
- type TopK
- type Values
Constants ¶
View Source
const ( // Not deprecated since still used in other metrics NoSuchKey = "noKey" // Deprecated due to complications HasValue = "hasValue" CacheHit = "cacheHit" CacheCollision = "collision" CacheExpired = "expired" LocalHasValue = "localHasValue" LocalNoSuchKey = "localNoKey" L1NoSuchKey = "L1NoKey" L1HasValue = "L1HasValue" L2NoSuchKey = "L2NoKey" L1Copy = "L1Copy" // Aerospike Errors - still complicated Timeout = "timeout" Down = "down" )
View Source
const ( ErrorKey = "error" // Context errors Canceled = "canceled" DeadlineExceeded = "deadlineExceeded" )
View Source
const ( // Pending is the column for the in-flight gauge maintained by the // metric.EnterThenExit Inc/Dec pattern. The exporter publishes: // - <op>_pending -- the current-in-flight counter (defective; see below) // - <op>_pending_Max -- per-bucket peak from the Occupancy CustomCounter // // Known defects in the underlying mechanism: // // 1. Bucket-mismatch on Exit. EnterThenExit captures the recent-bucket // index at Enter time and decrements that same bucket on Exit. If // the bucket has rotated between Enter and Exit, the wrong bucket // is decremented -- the previous bucket's value goes negative // while the current bucket's value drifts high. // // 2. Mutex serialization on Inc/Dec. The Dir typed value is not a // string, so MultiCounter.incrementValueBy takes c.locker.Lock() // on every Enter and Exit. Under high QPS this is a real // serialization point. // // Defect #1 inflates both _pending (current) and _pending_Max (per-bucket // peak); the inflation is in the conservative direction (over-estimation), // so the metrics are still operationally useful in different regimes: // // - _pending_Max grouped per reporting dimension (e.g. by // availability_zone, environment, op): for high-QPS operations // the per-group peak rises substantially above baseline noise // during fleet-wide saturation events, making this the cleaner // saturation signal for those operations. // // - _pending summed across reporting instances: exhibits dramatic // spikes during saturation for any QPS profile, partially // amplified by defect #1. For low-QPS operations where the // per-group _pending_Max signal is lost in baseline noise, the // fleet sum is the more visible saturation signal. // // _pending_Max is the cleaner peak-concurrency signal for capacity // sizing; pick per-operation based on QPS profile. Pending = "pending" // Shed marks a request that the client did NOT send because the host's // circuit breaker was already in the down state when getHost() was // called. Distinct from Down, which marks the trip event itself // (the request that observed the connection error and called // FlagDown). Shed is the count of subsequent requests that the // breaker rejected before recovery. Shed = "shed" )
View Source
const ( Enter = Dir(true) Exit = Dir(false) )
View Source
const ( L1Write = "L1Write" L2Write = "L2Write" )
View Source
const (
EarlyCtxError = "ctx"
)
Variables ¶
This section is empty.
Functions ¶
func NewCtxErrOnly ¶ added in v0.13.0
Types ¶
type Dir ¶ added in v0.13.0
type Dir bool
Dir (direction) should be true if this is an enter event; otherwise should be false. It is expected that every Dir has an Exit, but that may not always happen.
type GMeter ¶ added in v0.13.1
type GMeter struct {
*gmetric.Service
Unit time.Duration
RecentDuration time.Duration
NumRecent int
}
func DefaultGMeter ¶ added in v0.13.1
type Occupancy ¶ added in v0.13.0
type Occupancy struct {
// Members are exposed due to how gmetrics operates.
Max uint64 `json:",omitempty"`
// contains filtered or unexported fields
}
Occupancy keeps track of in-out metrics (not input-output); in-out counters are numbers that track the number of start and end events; with a focus on tracking the maximum number of starts without an end event.
type Sum ¶ added in v0.13.0
type Sum struct {
Total uint64 `json:",omitempty"`
}
TODO consider https://github.com/beorn7/perks
type Values ¶
type Values []interface{}
Values is a utility to pass multiple events to gmetric.
func (*Values) AppendError ¶ added in v0.9.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.