metadata

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultPipelineMetadata is a default pipeline metadata.
	DefaultPipelineMetadata PipelineMetadata

	// DefaultPipelineMetadatas is a default list of pipeline metadatas.
	DefaultPipelineMetadatas = PipelineMetadatas{DefaultPipelineMetadata}

	// DefaultMetadata is a default metadata.
	DefaultMetadata = Metadata{Pipelines: DefaultPipelineMetadatas}

	// DefaultStagedMetadata is a default staged metadata.
	DefaultStagedMetadata = StagedMetadata{Metadata: DefaultMetadata}

	// DefaultStagedMetadatas represents default staged metadatas.
	DefaultStagedMetadatas = StagedMetadatas{DefaultStagedMetadata}

	// DropPipelineMetadata is the drop policy pipeline metadata.
	DropPipelineMetadata = PipelineMetadata{DropPolicy: policy.DropMust}

	// DropPipelineMetadatas is the drop policy list of pipeline metadatas.
	DropPipelineMetadatas = []PipelineMetadata{DropPipelineMetadata}

	// DropIfOnlyMatchPipelineMetadata is the drop if only match policy
	// pipeline metadata.
	DropIfOnlyMatchPipelineMetadata = PipelineMetadata{DropPolicy: policy.DropIfOnlyMatch}

	// DropIfOnlyMatchPipelineMetadatas is the drop if only match policy list
	// of pipeline metadatas.
	DropIfOnlyMatchPipelineMetadatas = []PipelineMetadata{DropIfOnlyMatchPipelineMetadata}

	// DropMetadata is the drop policy metadata.
	DropMetadata = Metadata{Pipelines: DropPipelineMetadatas}

	// DropStagedMetadata is the drop policy staged metadata.
	DropStagedMetadata = StagedMetadata{Metadata: DropMetadata}

	// DropStagedMetadatas is the drop policy staged metadatas.
	DropStagedMetadatas = StagedMetadatas{DropStagedMetadata}
)

Functions

This section is empty.

Types

type ApplyOrRemoveDropPoliciesResult

type ApplyOrRemoveDropPoliciesResult uint

ApplyOrRemoveDropPoliciesResult is the result of applying or removing the drop policies for pipelines.

const (
	// NoDropPolicyPresentResult is the result of no drop policies being present.
	NoDropPolicyPresentResult ApplyOrRemoveDropPoliciesResult = iota
	// AppliedEffectiveDropPolicyResult is the result of applying the drop
	// policy and returning just the single drop policy pipeline.
	AppliedEffectiveDropPolicyResult
	// RemovedIneffectiveDropPoliciesResult is the result of no drop policies
	// being effective and returning the pipelines without any drop policies.
	RemovedIneffectiveDropPoliciesResult
)

type ForwardMetadata

type ForwardMetadata struct {
	// Pipeline of operations that may be applied to the metric.
	Pipeline applied.Pipeline
	// Storage policy.
	StoragePolicy policy.StoragePolicy
	// List of aggregation types.
	AggregationID aggregation.ID
	// Number of times this metric has been forwarded.
	NumForwardedTimes int
	// Metric source id that refers to the unique id of the source producing this metric.
	SourceID uint32
	// ResendEnabled is true if the Pipeline supports resending aggregate values after the initial flush.
	ResendEnabled bool
}

ForwardMetadata represents the metadata information associated with forwarded metrics.

func (*ForwardMetadata) FromProto

func (m *ForwardMetadata) FromProto(pb metricpb.ForwardMetadata) error

FromProto converts the protobuf message to a forward metadata in place.

func (ForwardMetadata) ToProto

ToProto converts the forward metadata to a protobuf message in place.

type Metadata

type Metadata struct {
	Pipelines PipelineMetadatas `json:"pipelines,omitempty"`
}

Metadata represents the metadata associated with a metric.

func (Metadata) Equal

func (m Metadata) Equal(other Metadata) bool

Equal returns true if two metadatas are considered equal.

func (*Metadata) FromProto

func (m *Metadata) FromProto(pb metricpb.Metadata) error

FromProto converts the protobuf message to a metadata in place.

func (Metadata) IsDefault

func (m Metadata) IsDefault() bool

IsDefault returns whether this is the default metadata.

func (Metadata) IsDropPolicyApplied

func (m Metadata) IsDropPolicyApplied() bool

IsDropPolicyApplied returns whether this is the default metadata but with the drop policy applied.

func (Metadata) IsDropPolicySet added in v1.2.0

func (m Metadata) IsDropPolicySet() bool

IsDropPolicySet returns whether any drop policies are set (but does not discriminate if they have been applied or not).

func (Metadata) ToProto

func (m Metadata) ToProto(pb *metricpb.Metadata) error

ToProto converts the metadata to a protobuf message in place.

type PipelineMetadata

type PipelineMetadata struct {
	// List of storage policies.
	StoragePolicies policy.StoragePolicies `json:"storagePolicies,omitempty"`
	// Pipeline operations.
	Pipeline applied.Pipeline `json:"-"`
	// Tags.
	Tags []models.Tag `json:"tags,omitempty"`
	// GraphitePrefix is the list of graphite prefixes to apply.
	GraphitePrefix [][]byte `json:"graphitePrefix,omitempty"`
	// List of aggregation types.
	AggregationID aggregation.ID `json:"aggregation,omitempty"`
	// Drop policy.
	DropPolicy policy.DropPolicy `json:"dropPolicy,omitempty"`
	// ResendEnabled is true if the Pipeline supports resending aggregate values after the initial flush.
	ResendEnabled bool `json:"resendEnabled,omitempty"`
}

PipelineMetadata contains pipeline metadata.

func (PipelineMetadata) Clone

Clone clones the pipeline metadata.

func (PipelineMetadata) Equal

func (m PipelineMetadata) Equal(other PipelineMetadata) bool

Equal returns true if two pipeline metadata are considered equal.

func (*PipelineMetadata) FromProto

FromProto converts the protobuf message to a pipeline metadata in place.

func (PipelineMetadata) IsAnyRollupRules added in v1.2.0

func (m PipelineMetadata) IsAnyRollupRules() bool

IsAnyRollupRules returns whether any of the rules have rollups.

func (PipelineMetadata) IsDefault

func (m PipelineMetadata) IsDefault() bool

IsDefault returns whether this is the default standard pipeline metadata.

func (PipelineMetadata) IsDropPolicyApplied

func (m PipelineMetadata) IsDropPolicyApplied() bool

IsDropPolicyApplied returns whether this is the default standard pipeline but with the drop policy applied.

func (PipelineMetadata) IsDropPolicySet added in v1.2.0

func (m PipelineMetadata) IsDropPolicySet() bool

IsDropPolicySet returns whether a drop policy is set.

func (PipelineMetadata) IsMappingRule added in v1.0.1

func (m PipelineMetadata) IsMappingRule() bool

IsMappingRule returns whether this is a mapping rule. nolint:gocritic

func (PipelineMetadata) String added in v1.2.0

func (m PipelineMetadata) String() string

func (PipelineMetadata) ToProto

ToProto converts the pipeline metadata to a protobuf message in place.

type PipelineMetadatas

type PipelineMetadatas []PipelineMetadata

PipelineMetadatas is a list of pipeline metadatas.

func (PipelineMetadatas) ApplyOrRemoveDropPolicies

func (metadatas PipelineMetadatas) ApplyOrRemoveDropPolicies() (
	PipelineMetadatas,
	ApplyOrRemoveDropPoliciesResult,
)

ApplyOrRemoveDropPolicies applies or removes any drop policies, if effective then just the drop pipeline is returned otherwise if not effective it returns the drop policy pipelines that were not effective.

func (PipelineMetadatas) Clone

func (metadatas PipelineMetadatas) Clone() PipelineMetadatas

Clone clones the list of pipeline metadatas.

func (PipelineMetadatas) Equal

func (metadatas PipelineMetadatas) Equal(other PipelineMetadatas) bool

Equal returns true if two pipline metadatas are considered equal.

func (PipelineMetadatas) IsDropPolicySet added in v1.2.0

func (metadatas PipelineMetadatas) IsDropPolicySet() bool

IsDropPolicySet returns whether any drop policies are set (but does not discriminate if they have been applied or not).

func (PipelineMetadatas) Len added in v1.4.0

func (metadatas PipelineMetadatas) Len() int

Len returns the number of pipelines in the metadata.

func (PipelineMetadatas) Less added in v1.4.0

func (metadatas PipelineMetadatas) Less(i, j int) bool

Less returns whether the element with index i should sort before the element with index j.

func (PipelineMetadatas) ShouldDropTimestamp added in v1.2.0

func (metadatas PipelineMetadatas) ShouldDropTimestamp(opts ShouldDropTimestampOptions) bool

ShouldDropTimestamp applies custom M3 tags.

func (PipelineMetadatas) Swap added in v1.4.0

func (metadatas PipelineMetadatas) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type ShouldDropTimestampOptions added in v1.2.0

type ShouldDropTimestampOptions struct {
	UntimedRollups bool
}

ShouldDropTimestampOptions are options for the should drop timestamp method.

type StagedMetadata

type StagedMetadata struct {
	Metadata `json:"metadata,omitempty"`

	// Cutover is when the metadata is applicable.
	CutoverNanos int64 `json:"cutoverNanos,omitempty"`

	// Tombstoned determines whether the associated metric has been tombstoned.
	Tombstoned bool `json:"tombstoned,omitempty"`
}

StagedMetadata represents metadata with a staged cutover time.

func (StagedMetadata) Equal

func (sm StagedMetadata) Equal(other StagedMetadata) bool

Equal returns true if two staged metadatas are considered equal.

func (*StagedMetadata) FromProto

func (sm *StagedMetadata) FromProto(pb metricpb.StagedMetadata) error

FromProto converts the protobuf message to a staged metadata in place.

func (StagedMetadata) IsDefault

func (sm StagedMetadata) IsDefault() bool

IsDefault returns whether this is a default staged metadata.

func (StagedMetadata) IsDropPolicyApplied

func (sm StagedMetadata) IsDropPolicyApplied() bool

IsDropPolicyApplied returns whether this is the default staged metadata but with the drop policy applied.

func (StagedMetadata) IsDropPolicySet added in v1.2.0

func (sm StagedMetadata) IsDropPolicySet() bool

IsDropPolicySet returns whether a drop policy is set.

func (StagedMetadata) String added in v1.2.0

func (sm StagedMetadata) String() string

func (StagedMetadata) ToProto

func (sm StagedMetadata) ToProto(pb *metricpb.StagedMetadata) error

ToProto converts the staged metadata to a protobuf message in place.

type StagedMetadatas

type StagedMetadatas []StagedMetadata

StagedMetadatas contains a list of staged metadatas.

func (StagedMetadatas) Equal

func (sms StagedMetadatas) Equal(other StagedMetadatas) bool

Equal returns true if two staged metadatas slices are considered equal.

func (*StagedMetadatas) FromProto

func (sms *StagedMetadatas) FromProto(pb metricpb.StagedMetadatas) error

FromProto converts the protobuf message to a staged metadatas in place. This is an optimized method that merges some nested steps.

func (StagedMetadatas) IsDefault

func (sms StagedMetadatas) IsDefault() bool

IsDefault determines whether the list of staged metadata is a default list.

func (StagedMetadatas) IsDropPolicyApplied

func (sms StagedMetadatas) IsDropPolicyApplied() bool

IsDropPolicyApplied returns whether the list of staged metadata is the default list but with the drop policy applied.

func (StagedMetadatas) IsDropPolicySet added in v1.2.0

func (sms StagedMetadatas) IsDropPolicySet() bool

IsDropPolicySet returns if the active staged metadata has a drop policy set.

func (StagedMetadatas) ToProto

func (sms StagedMetadatas) ToProto(pb *metricpb.StagedMetadatas) error

ToProto converts the staged metadatas to a protobuf message in place.

type TimedMetadata

type TimedMetadata struct {
	// List of aggregation types.
	AggregationID aggregation.ID

	// Storage policy.
	StoragePolicy policy.StoragePolicy
}

TimedMetadata represents the metadata information associated with timed metrics.

func (*TimedMetadata) FromProto

func (m *TimedMetadata) FromProto(pb metricpb.TimedMetadata) error

FromProto converts the protobuf message to a timed metadata in place.

func (TimedMetadata) ToProto

func (m TimedMetadata) ToProto(pb *metricpb.TimedMetadata) error

ToProto converts the timed metadata to a protobuf message in place.

type VersionedStagedMetadatas

type VersionedStagedMetadatas struct {
	StagedMetadatas StagedMetadatas `json:"stagedMetadatas"`
	Version         int             `json:"version"`
}

VersionedStagedMetadatas is a versioned staged metadatas.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL