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 ¶
func ConsolidateJSON(maxDataPoints int, results []*MetricData)
func IntervalString ¶
IntervalString converts a sign and string into a number of seconds
func MarshalCSV ¶
func MarshalCSV(results []*MetricData) []byte
func MarshalJSON ¶
func MarshalJSON(results []*MetricData) []byte
func MarshalPNG ¶
func MarshalPNG(r *http.Request, results []*MetricData) []byte
func MarshalPickle ¶
func MarshalPickle(results []*MetricData) []byte
func MarshalProtobuf ¶
func MarshalProtobuf(results []*MetricData) ([]byte, error)
func MarshalRaw ¶
func MarshalRaw(results []*MetricData) []byte
func MarshalSVG ¶
func MarshalSVG(r *http.Request, results []*MetricData) []byte
func SortMetrics ¶
func SortMetrics(metrics []*MetricData, mfetch MetricRequest)
func TruthyBool ¶
Types ¶
type ByNameNatural ¶
type ByNameNatural []*MetricData
ByNameNatural sorts metric naturally by name
func (ByNameNatural) Len ¶
func (s ByNameNatural) Len() int
func (ByNameNatural) Less ¶
func (s ByNameNatural) Less(i, j int) bool
func (ByNameNatural) Swap ¶
func (s ByNameNatural) Swap(i, j int)
type MetricData ¶
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 ¶
func (r *MetricData) AggregateValues()
func (*MetricData) AggregatedAbsent ¶
func (r *MetricData) AggregatedAbsent() []bool
func (*MetricData) AggregatedTimeStep ¶
func (r *MetricData) AggregatedTimeStep() int32
func (*MetricData) AggregatedValues ¶
func (r *MetricData) AggregatedValues() []float64
type MetricRequest ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.