Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type T ¶
type T struct {
// contains filtered or unexported fields
}
T represents a metrics database.
func (*T) Query ¶
func (s *T) Query(ctx context.Context, startTime, endTime time.Time, name string, labels map[string]string, fn func(*metrics.MetricSnapshot) error) error
Query calls fn with metrics whose name and labels match the provided arguments. If either argument is empty, no matching on that argument is performed. Leaving both arguments empty will call fn on all recorded metrics.
Only metric values recorded in the [startTime, endTime] time period are considered; if there are multiple metric values recorded in the given time period, only the latest value for a given metric is considered. If startTime is zero, it is treated as negative infinity. If endTime is zero, it is treated as the current time.
Callers should assume that metric values passed to fn are ephemeral and only valid during the call.