Documentation ¶
Index ¶
- Variables
- func ConsolidateJSON(maxDataPoints int64, results []*MetricData)
- func MarshalCSV(results []*MetricData) []byte
- func MarshalJSON(results []*MetricData, timestampMultiplier int64, noNullPoints bool) []byte
- func MarshalPickle(results []*MetricData) []byte
- func MarshalProtobufV2(results []*MetricData) ([]byte, error)
- func MarshalProtobufV3(results []*MetricData) ([]byte, error)
- func MarshalRaw(results []*MetricData) []byte
- type FunctionDescription
- type FunctionParam
- type FunctionType
- type GraphOptions
- type MetricData
- func (r *MetricData) AggregateValues()
- func (r *MetricData) AggregatedTimeStep() int64
- func (r *MetricData) AggregatedValues() []float64
- func (r *MetricData) Copy(includeValues bool) *MetricData
- func (r *MetricData) CopyLink() *MetricData
- func (r *MetricData) GetAggregateFunction() func([]float64) float64
- func (r *MetricData) SetValuesPerPoint(v int)
- type MetricHeap
- type MetricHeapElement
- type Option
- type Suggestion
- type SuggestionTypes
- type Windowed
Constants ¶
This section is empty.
Variables ¶
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") )
var FunctionTypeToStr = map[FunctionType]string{ AggFunc: "aggFunc", Boolean: "boolean", Date: "date", Float: "float", IntOrInterval: "intOrInterval", Integer: "integer", Interval: "interval", Node: "node", NodeOrTag: "nodeOrTag", SeriesList: "seriesList", SeriesLists: "seriesLists", String: "string", Tag: "tag", Any: "any", AggOrSeriesFunc: "aggOrSeriesFunc", IntOrInf: "intOrInf", }
FunctionTypeToStr provides a mapping between internal type constants and graphite-friendly string that have a name of a type
Functions ¶
func ConsolidateJSON ¶
func ConsolidateJSON(maxDataPoints int64, results []*MetricData)
ConsolidateJSON consolidates values to maxDataPoints size
func MarshalCSV ¶
func MarshalCSV(results []*MetricData) []byte
MarshalCSV marshals metric data to CSV
func MarshalJSON ¶
func MarshalJSON(results []*MetricData, timestampMultiplier int64, noNullPoints bool) []byte
MarshalJSON marshals metric data to JSON
func MarshalPickle ¶
func MarshalPickle(results []*MetricData) []byte
MarshalPickle marshals metric data to pickle format
func MarshalProtobufV2 ¶ added in v1.0.0
func MarshalProtobufV2(results []*MetricData) ([]byte, error)
MarshalProtobufV3 marshals metric data to protobuf
func MarshalProtobufV3 ¶ added in v1.0.0
func MarshalProtobufV3(results []*MetricData) ([]byte, error)
MarshalProtobufV3 marshals metric data to protobuf
func MarshalRaw ¶
func MarshalRaw(results []*MetricData) []byte
MarshalRaw marshals metric data to graphite's internal format, called 'raw'
Types ¶
type FunctionDescription ¶
type FunctionDescription struct { Description string `json:"description"` Function string `json:"function"` Group string `json:"group"` Module string `json:"module"` Name string `json:"name"` Params []FunctionParam `json:"params,omitempty"` Proxied bool `json:"proxied"` }
FunctionDescription contains full function description.
type FunctionParam ¶
type FunctionParam struct { Name string `json:"name"` Multiple bool `json:"multiple,omitempty"` Required bool `json:"required,omitempty"` Type FunctionType `json:"type,omitempty"` Options []Suggestion `json:"options,omitempty"` Suggestions []*Suggestion `json:"suggestions,omitempty"` Default *Suggestion `json:"default,omitempty"` }
FunctionParam contains list of all available parameters of function
type FunctionType ¶
type FunctionType int
FunctionType is a special type to handle parameter type in function description
const ( // AggFunc is a constant for AggregationFunction type AggFunc FunctionType = iota // Boolean is a constant for Boolean type Boolean // Date is a constant for Date type Date // Float is a constant for Float type Float // IntOrInterval is a constant for Interval-Or-Integer type IntOrInterval // Integer is a constant for Integer type Integer // Interval is a constant for Interval type Interval // Node is a constant for Node type Node // NodeOrTag is a constant for Node-Or-Tag type NodeOrTag // SeriesList is a constant for SeriesList type SeriesList // SeriesLists is a constant for SeriesLists type SeriesLists // String is a constant for String type String // Tag is a constant for Tag type Tag // Any is a constant for `Any` type Any // AggOrSeriesFunc is a constant for AggregationFunction or SeriesList AggOrSeriesFunc // IntOrInf is a constant for Integer that can be infinity IntOrInf )
func (FunctionType) MarshalJSON ¶
func (t FunctionType) MarshalJSON() ([]byte, error)
MarshalJSON marshals metric data to JSON
func (*FunctionType) UnmarshalJSON ¶ added in v0.11.0
func (t *FunctionType) UnmarshalJSON(d []byte) error
type GraphOptions ¶
type GraphOptions struct { }
type MetricData ¶
type MetricData struct { pb.FetchResponse GraphOptions ValuesPerPoint int Tags map[string]string AggregateFunction func([]float64) float64 `json:"-"` // contains filtered or unexported fields }
MetricData contains necessary data to represent parsed metric (ready to be send out or drawn)
func CopyMetricDataSlice ¶ added in v1.0.0
func CopyMetricDataSlice(args []*MetricData) (newData []*MetricData)
CopyMetricDataSlice returns the slice of metrics that should be changed later. It allows to avoid a changing of source data, e.g. by AlignMetrics
func MakeMetricData ¶ added in v0.11.0
func MakeMetricData(name string, values []float64, step, start int64) *MetricData
MakeMetricData creates new metrics data with given metric timeseries
func (*MetricData) AggregateValues ¶
func (r *MetricData) AggregateValues()
AggregateValues aggregates values
func (*MetricData) AggregatedTimeStep ¶
func (r *MetricData) AggregatedTimeStep() int64
AggregatedTimeStep aggregates time step
func (*MetricData) AggregatedValues ¶
func (r *MetricData) AggregatedValues() []float64
AggregatedValues aggregates values (with cache)
func (*MetricData) Copy ¶ added in v1.0.0
func (r *MetricData) Copy(includeValues bool) *MetricData
Copy returns the copy of r. If includeValues set to true, it copies values as well.
func (*MetricData) CopyLink ¶ added in v1.0.0
func (r *MetricData) CopyLink() *MetricData
Copy returns the copy of r. Values not copied and link from parent.
func (*MetricData) GetAggregateFunction ¶ added in v1.0.0
func (r *MetricData) GetAggregateFunction() func([]float64) float64
GetAggregateFunction returns MetricData.AggregateFunction and set it, if it's not yet
func (*MetricData) SetValuesPerPoint ¶
func (r *MetricData) SetValuesPerPoint(v int)
SetValuesPerPoint sets value per point coefficient.
type MetricHeap ¶
type MetricHeap []MetricHeapElement
func (MetricHeap) Len ¶
func (m MetricHeap) Len() int
func (MetricHeap) Less ¶
func (m MetricHeap) Less(i, j int) bool
func (MetricHeap) Swap ¶
func (m MetricHeap) Swap(i, j int)
type MetricHeapElement ¶
type Option ¶ added in v1.0.0
type Option struct { Type SuggestionTypes Value interface{} }
type Suggestion ¶ added in v0.11.0
type Suggestion struct { Type SuggestionTypes Value interface{} }
func NewSuggestion ¶ added in v0.11.0
func NewSuggestion(arg interface{}) *Suggestion
func NewSuggestions ¶ added in v0.11.0
func NewSuggestions(vaArgs ...interface{}) []*Suggestion
func StringsToSuggestionList ¶ added in v1.0.0
func StringsToSuggestionList(in []string) []Suggestion
func (Suggestion) MarshalJSON ¶ added in v0.11.0
func (t Suggestion) MarshalJSON() ([]byte, error)
MarshalJSON marshals metric data to JSON
func (*Suggestion) UnmarshalJSON ¶ added in v0.11.0
func (t *Suggestion) UnmarshalJSON(d []byte) error
type SuggestionTypes ¶ added in v0.11.0
type SuggestionTypes int
const ( SInt SuggestionTypes = iota SInt32 SInt64 SUint SUint32 SUint64 SFloat64 SString SBool SNone )