Documentation ¶
Index ¶
- type BinaryTransform
- type BinaryTransformFn
- type Datapoint
- type FeatureFlags
- type Op
- type Type
- func (t Type) BinaryTransform() (BinaryTransform, error)
- func (t *Type) FromProto(pb transformationpb.TransformationType) error
- func (t Type) IsBinaryTransform() bool
- func (t Type) IsUnaryMultiOutputTransform() bool
- func (t Type) IsUnaryTransform() bool
- func (t Type) IsValid() bool
- func (t Type) MarshalText() (text []byte, err error)
- func (t Type) MustBinaryTransform() BinaryTransform
- func (t Type) MustUnaryMultiOutputTransform() UnaryMultiOutputTransform
- func (t Type) MustUnaryTransform() UnaryTransform
- func (t Type) NewOp() (Op, error)
- func (i Type) String() string
- func (t Type) ToProto(pb *transformationpb.TransformationType) error
- func (t Type) UnaryMultiOutputTransform() (UnaryMultiOutputTransform, error)
- func (t Type) UnaryTransform() (UnaryTransform, error)
- func (t *Type) UnmarshalText(text []byte) error
- func (t *Type) UnmarshalYAML(unmarshal func(interface{}) error) error
- type UnaryMultiOutputTransform
- type UnaryMultiOutputTransformFn
- type UnaryTransform
- type UnaryTransformFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryTransform ¶
type BinaryTransform interface {
Evaluate(prev, curr Datapoint, flags FeatureFlags) Datapoint
}
BinaryTransform is a binary transformation that takes the previous and the current datapoint as input and produces a single datapoint as the transformation result. It can keep state if it requires.
type BinaryTransformFn ¶ added in v0.15.0
type BinaryTransformFn func(prev, curr Datapoint, flags FeatureFlags) Datapoint
BinaryTransformFn implements BinaryTransform as a function.
func (BinaryTransformFn) Evaluate ¶ added in v0.15.0
func (fn BinaryTransformFn) Evaluate(prev, curr Datapoint, flags FeatureFlags) Datapoint
Evaluate implements BinaryTransform as a function.
type Datapoint ¶
Datapoint is a metric data point containing a timestamp in Unix nanoseconds since epoch and a value.
type FeatureFlags ¶ added in v1.2.0
type FeatureFlags struct { }
FeatureFlags holds options passed into transformations from the aggregator configuration file. nolint:gofumpt
type Op ¶ added in v0.15.0
type Op struct {
// contains filtered or unexported fields
}
Op represents a transform operation.
func (Op) BinaryTransform ¶ added in v0.15.0
func (o Op) BinaryTransform() (BinaryTransform, bool)
BinaryTransform returns the active binary transform if op is binary transform.
func (Op) UnaryMultiOutputTransform ¶ added in v1.0.0
func (o Op) UnaryMultiOutputTransform() (UnaryMultiOutputTransform, bool)
UnaryMultiOutputTransform returns the active unary multi transform if op is unary multi transform.
func (Op) UnaryTransform ¶ added in v0.15.0
func (o Op) UnaryTransform() (UnaryTransform, bool)
UnaryTransform returns the active unary transform if op is unary transform.
type Type ¶
type Type int32
Type defines a transformation function.
Supported transformation types.
func (Type) BinaryTransform ¶
func (t Type) BinaryTransform() (BinaryTransform, error)
BinaryTransform returns the binary transformation function associated with the transformation type if applicable, or an error otherwise.
func (*Type) FromProto ¶
func (t *Type) FromProto(pb transformationpb.TransformationType) error
FromProto converts the protobuf message to a transformation type in place.
func (Type) IsBinaryTransform ¶
IsBinaryTransform returns whether this is a binary transformation.
func (Type) IsUnaryMultiOutputTransform ¶ added in v1.0.0
func (Type) IsUnaryTransform ¶
IsUnaryTransform returns whether this is a unary transformation.
func (Type) MarshalText ¶ added in v0.12.0
MarshalText serializes this type to its textual representation.
func (Type) MustBinaryTransform ¶
func (t Type) MustBinaryTransform() BinaryTransform
MustBinaryTransform returns the binary transformation function associated with the transformation type if applicable, or an error otherwise.
func (Type) MustUnaryMultiOutputTransform ¶ added in v1.0.0
func (t Type) MustUnaryMultiOutputTransform() UnaryMultiOutputTransform
MustUnaryMultiOutputTransform returns the unary transformation function associated with the transformation type if applicable, or panics otherwise.
func (Type) MustUnaryTransform ¶
func (t Type) MustUnaryTransform() UnaryTransform
MustUnaryTransform returns the unary transformation function associated with the transformation type if applicable, or panics otherwise.
func (Type) NewOp ¶ added in v0.15.0
NewOp returns a constructed operation that is allocated once and can be reused.
func (Type) ToProto ¶
func (t Type) ToProto(pb *transformationpb.TransformationType) error
ToProto converts the transformation type to a protobuf message in place.
func (Type) UnaryMultiOutputTransform ¶ added in v1.0.0
func (t Type) UnaryMultiOutputTransform() (UnaryMultiOutputTransform, error)
UnaryMultiOutputTransform returns the unary transformation function associated with the transformation type if applicable, or an error otherwise.
func (Type) UnaryTransform ¶
func (t Type) UnaryTransform() (UnaryTransform, error)
UnaryTransform returns the unary transformation function associated with the transformation type if applicable, or an error otherwise.
func (*Type) UnmarshalText ¶ added in v0.12.0
UnmarshalText extracts this type from the textual representation
func (*Type) UnmarshalYAML ¶
UnmarshalYAML unmarshals text-encoded data into an transformation type.
type UnaryMultiOutputTransform ¶ added in v1.0.0
type UnaryMultiOutputTransform interface { // Evaluate applies the transform on the provided datapoint. Evaluate(dp Datapoint, resolution time.Duration) (Datapoint, Datapoint) }
UnaryMultiOutputTransform is like UnaryTransform, but can output an additional datapoint. The additional datapoint is not passed to subsequent transforms.
type UnaryMultiOutputTransformFn ¶ added in v1.0.0
type UnaryMultiOutputTransformFn func(dp Datapoint, resolution time.Duration) (Datapoint, Datapoint)
UnaryMultiOutputTransformFn implements UnaryMultiOutputTransform as a function.
type UnaryTransform ¶
UnaryTransform is a unary transformation that takes a single datapoint as input and transforms it into a datapoint as output. It can keep state if it requires.
type UnaryTransformFn ¶ added in v0.15.0
UnaryTransformFn implements UnaryTransform as a function.
func (UnaryTransformFn) Evaluate ¶ added in v0.15.0
func (fn UnaryTransformFn) Evaluate(dp Datapoint) Datapoint
Evaluate implements UnaryTransform as a function.