Documentation ¶
Index ¶
- Variables
- type Bounds
- func (b Bounds) Blocks(t time.Time) int
- func (b Bounds) Contains(t time.Time) bool
- func (b Bounds) End() time.Time
- func (b Bounds) Equals(other Bounds) bool
- func (b Bounds) Nearest(t time.Time) Bounds
- func (b Bounds) Next(n int) Bounds
- func (b Bounds) Previous(n int) Bounds
- func (b Bounds) Steps() int
- func (b Bounds) String() string
- func (b Bounds) TimeForIndex(idx int) (time.Time, error)
- type MatchType
- type Matcher
- type Matchers
- type Metric
- type Metrics
- type RequestParams
- type Tag
- type Tags
- func (t Tags) Add(tags Tags) Tags
- func (t Tags) AddTag(tag Tag) Tags
- func (t Tags) Clone() Tags
- func (t Tags) Get(key []byte) ([]byte, bool)
- func (t Tags) ID() string
- func (t Tags) IDLen() int
- func (t Tags) IDMarshalTo(b []byte) []byte
- func (t Tags) IDWithExcludes(excludeKeys ...[]byte) uint64
- func (t Tags) IDWithKeys(includeKeys ...[]byte) uint64
- func (t Tags) Len() int
- func (t Tags) Less(i, j int) bool
- func (t Tags) Swap(i, j int)
- func (t Tags) TagsWithKeys(includeKeys [][]byte) Tags
- func (t Tags) TagsWithoutKeys(excludeKeys [][]byte) Tags
- func (t Tags) WithoutName() Tags
Constants ¶
This section is empty.
Variables ¶
var ( // MetricName is an internal name used to denote the name of the metric. // TODO: Get these from the storage MetricName = []byte("__name__") )
Functions ¶
This section is empty.
Types ¶
type Bounds ¶ added in v0.4.4
Bounds are the time bounds, start time is inclusive but end is exclusive
func (Bounds) Previous ¶ added in v0.4.4
Previous returns the nth previous bound from the current bound
type Matcher ¶
type Matcher struct { Type MatchType `json:"type"` Name []byte `json:"name"` Value []byte `json:"value"` // contains filtered or unexported fields }
Matcher models the matching of a label. NB: when serialized to JSON these will be base64'd
func NewMatcher ¶
NewMatcher returns a matcher object.
type RequestParams ¶
type RequestParams struct { Start time.Time End time.Time // Now captures the current time and fixes it throughout the request, we may let people override it in the future Now time.Time Timeout time.Duration Step time.Duration Query string Debug bool IncludeEnd bool }
RequestParams represents the params from the request
func (RequestParams) ExclusiveEnd ¶ added in v0.4.1
func (r RequestParams) ExclusiveEnd() time.Time
ExclusiveEnd returns the end exclusive
type Tag ¶ added in v0.4.2
type Tag struct {
Name, Value []byte
}
Tag is a key/value metric tag pair
type Tags ¶
type Tags []Tag
Tags is a list of key/value metric tag pairs
func Normalize ¶ added in v0.4.2
Normalize normalizes the tags by sorting them in place. In future, it might also ensure other things like uniqueness
func (Tags) IDLen ¶ added in v0.4.6
IDLen returns the length of the ID that would be generated from the tags.
func (Tags) IDMarshalTo ¶ added in v0.4.6
IDMarshalTo writes out the ID representation of the tags into the provided buffer.
func (Tags) IDWithExcludes ¶
IDWithExcludes returns a string representation of the tags excluding some tag keys
func (Tags) IDWithKeys ¶
IDWithKeys returns a string representation of the tags only including the given keys
func (Tags) TagsWithKeys ¶ added in v0.4.2
TagsWithKeys returns only the tags which have the given keys
func (Tags) TagsWithoutKeys ¶ added in v0.4.2
TagsWithoutKeys returns only the tags which do not have the given keys
func (Tags) WithoutName ¶
WithoutName copies the tags excluding the name tag