Documentation ¶
Index ¶
- Constants
- func Concatenate(subExpressions ...placement.Ordering) placement.Ordering
- func Constant(constant float64) placement.Ordering
- func Inverse(subExpression placement.Ordering) placement.Ordering
- func Label(scope, pattern *labels.Label) placement.Ordering
- func Map(mapping *Mapping, subExpression placement.Ordering) placement.Ordering
- func Metric(source Source, metricType metrics.Type) placement.Ordering
- func Multiply(subExpressions ...placement.Ordering) placement.Ordering
- func Negate(subExpression placement.Ordering) placement.Ordering
- func Relation(scope, pattern *labels.Label) placement.Ordering
- func Sum(subExpressions ...placement.Ordering) placement.Ordering
- type Bucket
- type ConcatenateCustom
- type ConstantCustom
- type Endpoint
- type InverseCustom
- type LabelCustom
- type MapCustom
- type Mapping
- type MetricCustom
- type MultiplyCustom
- type NegateCustom
- type RelationCustom
- type Source
- type SumCustom
Constants ¶
const ( // EntitySource means that the metrics comes from an entity. EntitySource = Source("entity") // GroupSource means that the metrics comes from an group. GroupSource = Source("group") )
Variables ¶
This section is empty.
Functions ¶
func Concatenate ¶
Concatenate will take a list of orderings and then make a concatenation that will behave like a lexicographic ordering.
func Constant ¶
Constant will return a tuple score which will always return a tuple of length one with the given constant.
func Label ¶
Label will create an ordering which will order groups based on the number of their labels matching the given pattern.
func Metric ¶
Metric will create an ordering which will order groups based on their value of the given metric type.
func Multiply ¶
Multiply will take the tuples of the sub expressions and return a tuple which will have the length of the smallest tuple returned from the sub expressions where each entry is the multiplication of the corresponding entry in the tuple from the sub expressions.
func Relation ¶
Relation will create an ordering which will order groups based on the number of their relations matching the given pattern.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket represents an interval that maps to a given value.
func NewBucket ¶
NewBucket creates a new bucket from a start and end point and a value that the bucket should have.
type ConcatenateCustom ¶
ConcatenateCustom can create a tuple of floats which is the concatenation of tuples created in the sub-expressions.
type ConstantCustom ¶
type ConstantCustom struct {
Constant float64
}
ConstantCustom creates a tuple of one value which is always the given constant.
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint represents an endpoint in an interval which can be open or close.
func NewEndpoint ¶
NewEndpoint creates a new endpoint from a value and whatever the endpoint should be open or closed.
type InverseCustom ¶
InverseCustom can create a tuple of floats where each tuple entry is the inverse of the same tuple entry created in the sub-expression.
type LabelCustom ¶
LabelCustom can create a tuple of one float which is the number of occurrences of labels that match the pattern in the given scope.
type MapCustom ¶
MapCustom creates a tuple from the sub-expression and maps each entry of the tuple to a different value according to the given mapping.
type Mapping ¶
type Mapping struct {
// contains filtered or unexported fields
}
Mapping represents a mapping of an interval from ]-inf;inf[ onto a finite set of float values.
func NewMapping ¶
NewMapping will create a new mapping from a list of buckets. The buckets will be checked to not overlap and to ensure that they cover the whole range [-inf;inf], if this is not the case an error is returned.
type MetricCustom ¶
MetricCustom can create a tuple of one float which is the value of the metric found in the given source.
type MultiplyCustom ¶
MultiplyCustom can create a tuple of floats which is the multiplication of tuples created in the sub-expressions. The resulting will have the same length as the shortest tuple returned in the sub-expressions and each entry will be the multiplication of the entries of the other tuples at the same index.
type NegateCustom ¶
NegateCustom can create a tuple of floats where each tuple entry is the negation of the same tuple entry created in the sub-expression.
type RelationCustom ¶
RelationCustom can create a tuple of one float which is the number of occurrences of relations that match the pattern in the given scope.
type Source ¶
type Source string
Source represents the source where a metric used in a custom ordering comes from.
type SumCustom ¶
SumCustom can create a tuple of floats which is the summation of tuples created in the sub-expressions. The resulting will have the same length as the shortest tuple returned in the sub-expressions and each entry will be the summation of the entries of the other tuples at the same index.