Documentation
¶
Overview ¶
package promql
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AtModifierUnsafeFunctions = map[string]struct{}{
"days_in_month": {}, "day_of_month": {}, "day_of_week": {}, "day_of_year": {},
"hour": {}, "minute": {}, "month": {}, "year": {},
"predict_linear": {}, "time": {},
"timestamp": {},
}
Functions ¶
This section is empty.
Types ¶
type Engine ¶ added in v0.2.0
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶ added in v0.2.0
func NewEngine(cfg *config.Config, logService *logservice.LogService) *Engine
func (*Engine) NewInstantQuery ¶ added in v0.2.0
type FPoint ¶ added in v0.2.0
FPoint represents a single float data point for a given timestamp.
func (FPoint) MarshalJSON ¶ added in v0.2.0
MarshalJSON implements json.Marshaler.
JSON marshaling is only needed for the HTTP API. Since FPoint is such a frequently marshaled type, it gets an optimized treatment directly in web/api/v1/api.go. Therefore, this method is unused within Prometheus. It is still provided here as convenience for debugging and for other users of this code. Also note that the different marshaling implementations might lead to slightly different results in terms of formatting and rounding of the timestamp.
type HPoint ¶ added in v0.2.0
type HPoint struct {
T int64
H *histogram.FloatHistogram
}
HPoint represents a single histogram data point for a given timestamp. H must never be nil.
func (HPoint) MarshalJSON ¶ added in v0.2.0
MarshalJSON implements json.Marshaler.
JSON marshaling is only needed for the HTTP API. Since HPoint is such a frequently marshaled type, it gets an optimized treatment directly in web/api/v1/api.go. Therefore, this method is unused within Prometheus. It is still provided here as convenience for debugging and for other users of this code. Also note that the different marshaling implementations might lead to slightly different results in terms of formatting and rounding of the timestamp.
type Matrix ¶ added in v0.2.0
type Matrix []Series
Matrix is a slice of Series that implements sort.Interface and has a String method.
func (Matrix) ContainsSameLabelset ¶ added in v0.2.0
ContainsSameLabelset checks if a matrix has samples with the same labelset. Such a behavior is semantically undefined. https://github.com/prometheus/prometheus/issues/4562
func (Matrix) TotalSamples ¶ added in v0.2.0
TotalSamples returns the total number of samples in the series within a matrix.
type Result ¶ added in v0.2.0
type Result struct {
Err error
Value parser.Value
// Warnings storage.Warnings
Warnings model.Warnings
}
Result holds the resulting value of an execution or an error if any occurred.
func (*Result) Matrix ¶ added in v0.2.0
Matrix returns a Matrix. An error is returned if the result was an error or the result value is not a Matrix.
type Sample ¶ added in v0.2.0
Sample is a single sample belonging to a metric. It represents either a float sample or a histogram sample. If H is nil, it is a float sample. Otherwise, it is a histogram sample.
func (Sample) MarshalJSON ¶ added in v0.2.0
MarshalJSON is mirrored in web/api/v1/api.go with jsoniter because FPoint and HPoint wouldn't be marshaled with jsoniter otherwise.
type Scalar ¶ added in v0.2.0
Scalar is a data point that's explicitly not associated with a metric.
func (Scalar) MarshalJSON ¶ added in v0.2.0
type Series ¶ added in v0.2.0
type Series struct {
Metric labels.Labels `json:"metric"`
Floats []FPoint `json:"values,omitempty"`
Histograms []HPoint `json:"histograms,omitempty"`
}
Series is a stream of data points belonging to a metric.
type String ¶ added in v0.2.0
String represents a string value.
func (String) MarshalJSON ¶ added in v0.2.0
type Vector ¶ added in v0.2.0
type Vector []Sample
Vector is basically only an an alias for []Sample, but the contract is that in a Vector, all Samples have the same timestamp.
func (Vector) ContainsSameLabelset ¶ added in v0.2.0
ContainsSameLabelset checks if a vector has samples with the same labelset Such a behavior is semantically undefined https://github.com/prometheus/prometheus/issues/4562