Documentation ¶
Index ¶
- Constants
- func JoinQuery(parts []string) string
- func Median(value []float64) float64
- func ParseColumns(queryStr string) (map[string]ast.Expr, error)
- func SortAttrs(attrs Attrs)
- func SplitQuery(query string) []string
- func TableFuncName(expr ast.Expr) string
- type Attrs
- func (attrs Attrs) AppendString(b []byte, sep string) []byte
- func (attrs Attrs) Bytes(buf []byte, pick map[string]struct{}) []byte
- func (attrs Attrs) Map() map[string]string
- func (attrs Attrs) MarshalJSON() ([]byte, error)
- func (attrs Attrs) Pick(grouping map[string]struct{}) Attrs
- func (attrs Attrs) SortedKeys() []string
- func (attrs Attrs) String() string
- func (attrs *Attrs) UnmarshalJSON(b []byte) error
- type BinaryExpr
- type ColumnInfo
- type Engine
- type Expr
- type FuncCall
- type JSONError
- type KeyValue
- type MetricAlias
- type MetricInfo
- type NamedExpr
- type ParenExpr
- type ParsedQuery
- type QueryPart
- type RefExpr
- type Result
- type Storage
- type Timeseries
- type TimeseriesExpr
- type TimeseriesFilter
Constants ¶
View Source
const ( CHAggNone = "_" CHAggMin = "min" CHAggMax = "max" CHAggSum = "sum" CHAggAvg = "avg" CHAggMedian = "median" CHAggUniq = "uniq" // Histograms only. CHAggCount = "count" CHAggP50 = "p50" CHAggP75 = "p75" CHAggP90 = "p90" CHAggP95 = "p95" CHAggP99 = "p99" )
View Source
const ( GoAggMin = "min" GoAggMax = "max" GoAggSum = "sum" GoAggAvg = "avg" GoAggMedian = "median" )
View Source
const ( TableFuncMin = "min" TableFuncMax = "max" TableFuncSum = "sum" TableFuncAvg = "avg" TableFuncMedian = "median" TableFuncLast = "last" )
View Source
const ( TransformPerMin = "per_min" TransformPerSec = "per_sec" TransformAbs = "abs" TransformCeil = "ceil" TransformFloor = "floor" TransformTrunc = "trunc" TransformCos = "cos" TransformCosh = "cosh" TransformAcos = "acos" TransformAcosh = "acosh" TransformSin = "sin" TransformSinh = "sinh" TransformAsin = "asin" TransformAsinh = "asinh" TransformTan = "tan" TransformTanh = "tanh" TransformAtan = "atan" TransformAtanh = "atanh" TransformExp = "exp" TransformExp2 = "exp2" TransformLog = "log" TransformLog2 = "log2" TransformLog10 = "log10" TransformLn = "ln" )
View Source
const ( RollupIncrease = "increase" RollupDelta = "delta" RollupRate = "rate" RollupIRate = "irate" RollupMinOverTime = "min_over_time" RollupMaxOverTime = "max_over_time" RollupSumOverTime = "sum_over_time" RollupAvgOverTime = "avg_over_time" RollupMedianOverTime = "median_over_time" )
Variables ¶
This section is empty.
Functions ¶
func SplitQuery ¶
func TableFuncName ¶
Types ¶
type Attrs ¶
type Attrs []KeyValue
func AttrsFromKeysValues ¶
func AttrsFromMap ¶
func (Attrs) MarshalJSON ¶
func (Attrs) SortedKeys ¶
func (*Attrs) UnmarshalJSON ¶
type ColumnInfo ¶
type ColumnInfo struct{}
type KeyValue ¶
func (KeyValue) AppendString ¶
type MetricAlias ¶
type MetricAlias struct { Name string `yaml:"name" json:"name"` Alias string `yaml:"alias" json:"alias"` }
func (*MetricAlias) String ¶
func (m *MetricAlias) String() string
func (*MetricAlias) Validate ¶
func (m *MetricAlias) Validate() error
type MetricInfo ¶
type NamedExpr ¶
func (*NamedExpr) NameTemplate ¶
type ParsedQuery ¶
type ParsedQuery struct { Parts []*QueryPart `json:"parts"` Columns []*ColumnInfo `json:"columns"` }
func ParseQuery ¶
func ParseQuery(query string) *ParsedQuery
func ParseQueryError ¶
func ParseQueryError(query string) (*ParsedQuery, error)
func (*ParsedQuery) String ¶
func (q *ParsedQuery) String() string
type Result ¶
type Result struct { Metrics []MetricInfo Timeseries []*Timeseries }
type Storage ¶
type Storage interface {
SelectTimeseries(f *TimeseriesFilter) ([]*Timeseries, error)
}
type Timeseries ¶
type Timeseries struct { MetricName string NameTemplate string Unit string Filters []ast.Filter Grouping []string Attrs Attrs Annotations map[string]any Value []float64 Time []unixtime.Seconds }
func (*Timeseries) Clone ¶
func (ts *Timeseries) Clone() *Timeseries
func (*Timeseries) DeepClone ¶
func (ts *Timeseries) DeepClone() *Timeseries
func (*Timeseries) Name ¶
func (ts *Timeseries) Name() string
func (*Timeseries) TrimNaNLeft ¶ added in v1.7.0
func (ts *Timeseries) TrimNaNLeft()
func (*Timeseries) WhereQuery ¶
func (ts *Timeseries) WhereQuery() string
type TimeseriesExpr ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.