Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
Field string `json:"field"` // The field on which the aggregation operates.
}
Base represents a common structure for functions that operate on a specific field. Field: The name of the field to be aggregated.
type Latency ¶
Latency represents a function that calculates latency as a ratio of two metrics. Divisor: The denominator in the latency calculation. Dividend: The numerator in the latency calculation.
type LatencySumFuncValueInGroup ¶
type LatencySumFuncValueInGroup struct {
Latency // Embeds the Latency struct for fields `Divisor` and `Dividend`.
Group struct {
Field string `json:"field"` // The field used for grouping.
Func string `json:"func"` // The aggregation function to apply within each group (e.g., max, min, sum).
Size uint `json:"size"` // The maximum number of groups to return.
} `json:"group"`
}
LatencySumFuncValueInGroup represents a function that calculates the latency as a sum of values in a grouped aggregation. It combines a `Latency` calculation with a grouping operation and applies a specified aggregation function within each group. The group defines the field to group by, the aggregation function to apply, and the maximum number of groups to include.
func (*LatencySumFuncValueInGroup) GenerateAggregation ¶
func (p *LatencySumFuncValueInGroup) GenerateAggregation(metricName string) (map[string]interface{}, error)
GenerateAggregation implements the `Function` interface and generates an aggregation for the `latency_sum_func_value_in_group` function.
type Rate ¶
type Rate struct {
Base
Scale uint `json:"scale"` // The scaling factor used in the rate calculation.
}
Rate extends the Base structure to include scaling for rate calculations. Scale: A multiplier applied to the rate calculation for normalization.
type RateSumFuncValueInGroup ¶
type RateSumFuncValueInGroup struct {
Rate // Embeds the Rate struct for fields `Field` and `Scale`.
Group struct {
Field string `json:"field"` // The field used for grouping.
Func string `json:"func"` // The aggregation function to apply within each group (e.g., max, min, sum).
Size uint `json:"size"` // The maximum number of groups to return.
} `json:"group"`
}
RateSumFuncValueInGroup represents a function that calculates the rate as a sum of values in a grouped aggregation. It combines a `Rate` calculation with a grouping operation and applies a specified aggregation function within each group. The group defines the field to group by, the aggregation function to apply, and the maximum number of groups to include.
func (*RateSumFuncValueInGroup) GenerateAggregation ¶
func (p *RateSumFuncValueInGroup) GenerateAggregation(metricName string) (map[string]interface{}, error)
GenerateAggregation implements the `Function` interface and generates an aggregation for the `rate_sum_func_value_in_group` function. This function constructs an aggregation pipeline that computes the sum of values for a given field within groups, calculates the derivative, and then applies a bucket script to scale the resulting value by a provided `scale` factor.
type SumFuncValueInGroup ¶
type SumFuncValueInGroup struct {
Rate // Embeds the Rate struct for rate-specific fields like `Field` and `Scale`.
Group struct {
Field string `json:"field"` // The field used for grouping.
Func string `json:"func"` // The aggregation function to apply within each group (e.g., max, min, sum).
Size uint `json:"size"` // The maximum number of groups to return.
} `json:"group"`
}
SumFuncValueInGroup represents a function to calculate a sum of values in a grouped aggregation. It combines a `Rate` calculation with a grouping operation and a specified aggregation function within each group. The group defines the field to group by, the aggregation function to apply, and the maximum number of groups to include.
func (*SumFuncValueInGroup) GenerateAggregation ¶
func (p *SumFuncValueInGroup) GenerateAggregation(metricName string) (map[string]interface{}, error)
GenerateAggregation implements the `Function` interface and generates an aggregation for the `sum_func_value_in_group` function.