Documentation
¶
Overview ¶
Package rpcstat counts the admin API's calls over the last few minutes: how many, how many failed, and how long the unary ones took. It is a fixed array of one-minute slots with a latency histogram each, so it never allocates after New and its memory does not grow with the traffic. The HTTP middleware records every /api call; OpsService GetPanelResources reads it.
Index ¶
Constants ¶
const Minutes = 5
Minutes is the window: the last Minutes whole minutes, the current one included.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
WindowS int
Requests, ServerErrors, ClientErrors uint64
// P95ms is the 95th percentile of the unary calls' time, read from the histogram (linear inside its bucket); 0 without
// calls.
P95ms float64
}
Snapshot is the window's counts.
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window holds the counts. The zero value is not usable; a nil *Window records nothing and reads as empty.