stats

package
v0.0.0-...-3257545 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Weight

func Weight(s *pb.Span) float64

Weight returns the weight of the span as defined for sampling, i.e. the inverse of the sampling rate.

Types

type Aggregation

type Aggregation struct {
	Env        string
	Resource   string
	Service    string
	Type       string
	Hostname   string
	StatusCode uint32
	Version    string
	Synthetics bool
}

Aggregation contains all the dimension on which we aggregate statistics when adding or removing fields to Aggregation the methods ToTagSet, KeyLen and WriteKey should always be updated accordingly

func NewAggregationFromSpan

func NewAggregationFromSpan(s *pb.Span, env string, agentHostname string) Aggregation

NewAggregationFromSpan creates a new aggregation from the provided span and env

type PayloadKey

type PayloadKey struct {
	Hostname string
	Version  string
	Env      string
}

PayloadKey uniquely identifies a ClientStatsPayload inside a StatsPayload

type RawBucket

type RawBucket struct {
	// contains filtered or unexported fields
}

RawBucket is used to compute span data and aggregate it within a time-framed bucket. This should not be used outside the agent, use ClientStatsBucket for this.

func NewRawBucket

func NewRawBucket(ts, d uint64) *RawBucket

NewRawBucket opens a new calculation bucket for time ts and initializes it properly

func (*RawBucket) Export

func (sb *RawBucket) Export() map[PayloadKey]pb.ClientStatsBucket

Export transforms a RawBucket into a ClientStatsBucket, typically used before communicating data to the API, as RawBucket is the internal type while ClientStatsBucket is the public, shared one.

func (*RawBucket) HandleSpan

func (sb *RawBucket) HandleSpan(s *WeightedSpan, env string, agentHostname string)

HandleSpan adds the span to this bucket stats, aggregated with the finest grain matching given aggregators

type WeightedSpan

type WeightedSpan struct {
	Weight   float64 // Span weight. Similar to the trace root.Weight().
	TopLevel bool    // Is this span a service top-level or not. Similar to span.TopLevel().
	Measured bool    // Is this span marked for metrics computation.

	*pb.Span
}

WeightedSpan extends Span to contain weights required by the Concentrator.

type WeightedTrace

type WeightedTrace []*WeightedSpan

WeightedTrace is a slice of WeightedSpan pointers.

func NewWeightedTrace

func NewWeightedTrace(trace pb.Trace, root *pb.Span) WeightedTrace

NewWeightedTrace returns a weighted trace, with coefficient required by the concentrator.

Jump to

Keyboard shortcuts

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