Documentation
¶
Index ¶
- Variables
- func AlphabeticallyByPart(metrics []*MetricData, part int) sort.Interface
- func ByPart(metrics []*MetricData, part int) byPartBase
- func ConsolidateJSON(maxDataPoints int, results []*MetricData)
- func IntervalString(s string, defaultSign int) (int32, error)
- func MarshalCSV(results []*MetricData) []byte
- func MarshalJSON(results []*MetricData) []byte
- func MarshalPNG(r *http.Request, results []*MetricData) []byte
- func MarshalPickle(results []*MetricData) []byte
- func MarshalProtobuf(results []*MetricData) ([]byte, error)
- func MarshalRaw(results []*MetricData) []byte
- func MarshalSVG(r *http.Request, results []*MetricData) []byte
- func ParseExpr(e string) (*expr, string, error)
- func SortMetrics(metrics []*MetricData, mfetch MetricRequest)
- func TruthyBool(s string) bool
- type ByName
- type ByNameNatural
- type MetricData
- type MetricRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingExpr is a parse error returned when an expression is missing. ErrMissingExpr = errors.New("missing expression") // ErrMissingComma is a parse error returned when an expression is missing a comma. ErrMissingComma = errors.New("missing comma") // ErrMissingQuote is a parse error returned when an expression is missing a quote. ErrMissingQuote = errors.New("missing quote") // ErrUnexpectedCharacter is a parse error returned when an expression contains an unexpected character. ErrUnexpectedCharacter = errors.New("unexpected character") )
View Source
var ( // ErrBadType is an eval error returned when a argument has wrong type. ErrBadType = errors.New("bad type") // ErrMissingArgument is an eval error returned when a argument is missing. ErrMissingArgument = errors.New("missing argument") // ErrMissingTimeseries is an eval error returned when a time series argument is missing. ErrMissingTimeseries = errors.New("missing time series argument") // ErrSeriesDoesNotExist is an eval error returned when a requested time series argument does not exist. ErrSeriesDoesNotExist = errors.New("no timeseries with that name") )
View Source
var ( // ErrWildcardNotAllowed is an eval error returned when a wildcard/glob argument is found where a single series is required. ErrWildcardNotAllowed = errors.New("found wildcard where series expected") // ErrTooManyArguments is an eval error returned when too many arguments are provided. ErrTooManyArguments = errors.New("too many arguments") )
Functions ¶
func AlphabeticallyByPart ¶
func AlphabeticallyByPart(metrics []*MetricData, part int) sort.Interface
AlphabeticallyByPart returns a byPartAlphabetical that will sort 'metrics' alphabetically by 'part'.
func ByPart ¶
func ByPart(metrics []*MetricData, part int) byPartBase
ByPart returns a byPartBase suitable for sorting 'metrics' by 'part'.
func ConsolidateJSON ¶ added in v0.6.0
func ConsolidateJSON(maxDataPoints int, results []*MetricData)
func IntervalString ¶ added in v0.6.0
IntervalString converts a sign and string into a number of seconds
func MarshalCSV ¶ added in v0.6.0
func MarshalCSV(results []*MetricData) []byte
func MarshalJSON ¶ added in v0.6.0
func MarshalJSON(results []*MetricData) []byte
func MarshalPNG ¶ added in v0.6.0
func MarshalPNG(r *http.Request, results []*MetricData) []byte
func MarshalPickle ¶ added in v0.6.0
func MarshalPickle(results []*MetricData) []byte
func MarshalProtobuf ¶ added in v0.6.0
func MarshalProtobuf(results []*MetricData) ([]byte, error)
func MarshalRaw ¶ added in v0.6.0
func MarshalRaw(results []*MetricData) []byte
func MarshalSVG ¶ added in v0.6.0
func MarshalSVG(r *http.Request, results []*MetricData) []byte
func SortMetrics ¶
func SortMetrics(metrics []*MetricData, mfetch MetricRequest)
func TruthyBool ¶ added in v0.6.0
Types ¶
type ByNameNatural ¶ added in v0.6.0
type ByNameNatural []*MetricData
ByNameNatural sorts metric naturally by name
func (ByNameNatural) Len ¶ added in v0.6.0
func (s ByNameNatural) Len() int
func (ByNameNatural) Less ¶ added in v0.6.0
func (s ByNameNatural) Less(i, j int) bool
func (ByNameNatural) Swap ¶ added in v0.6.0
func (s ByNameNatural) Swap(i, j int)
type MetricData ¶ added in v0.6.0
type MetricData struct {
pb.FetchResponse
// contains filtered or unexported fields
}
func EvalExpr ¶
func EvalExpr(e *expr, from, until int32, values map[MetricRequest][]*MetricData) ([]*MetricData, error)
func (*MetricData) AggregateValues ¶ added in v0.6.0
func (r *MetricData) AggregateValues()
func (*MetricData) AggregatedAbsent ¶ added in v0.6.0
func (r *MetricData) AggregatedAbsent() []bool
func (*MetricData) AggregatedTimeStep ¶ added in v0.6.0
func (r *MetricData) AggregatedTimeStep() int32
func (*MetricData) AggregatedValues ¶ added in v0.6.0
func (r *MetricData) AggregatedValues() []float64
type MetricRequest ¶ added in v0.6.0
Click to show internal directories.
Click to hide internal directories.