analytics

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSON_FORMAT = "json"
	HTML_FORMAT = "html"

	// PERM_DIR_STANDARD stands for (rwxr-xr-x): read and execute for everyone, write only for the owner
	PERM_DIR_STANDARD os.FileMode = 0o755
	// PERM_FILE_STANDARD stands for (rw-r--r--): read for everyone, write only for the owner
	PERM_FILE_STANDARD os.FileMode = 0o644
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsExporter

type AnalyticsExporter interface {
	Export(analytics []*TestAnalytics) error
	Format() string
}

func NewAnalyticsExporters

func NewAnalyticsExporters(formats []string, baseDir string) ([]AnalyticsExporter, error)

type MetricCalculator

type MetricCalculator interface {
	Calculate(data *tracesData, traceAnalytics *TraceAnalytics) error
	String() string
}

type SpanAnalytics

type SpanAnalytics struct {
	ServiceName                   string
	OperationName                 string
	MaxDuration                   int64
	MinDuration                   int64
	P50Duration                   int64
	P90Duration                   int64
	P99Duration                   int64
	AveragePosition               float64 // Average position of the span in the trace (0-based index)
	DurationStandardDeviation     float64
	AverageDuration               float64
	ErrorRate                     float64
	AveragePercentageOfTotalTrace float64 // Average percentage of the span duration over the total trace duration
}

type SpanMetricCalculator

type SpanMetricCalculator struct{}

Metrics based on span durations

func (SpanMetricCalculator) Calculate

func (c SpanMetricCalculator) Calculate(data *tracesData, traceAnalytics *TraceAnalytics) error

func (SpanMetricCalculator) String

func (c SpanMetricCalculator) String() string

type TestAnalytics

type TestAnalytics struct {
	TestName       string
	TraceAnalytics *TraceAnalytics
	Traces         []*trace.Trace
}

func Build

func Build(suites []*test.TestSuite) []*TestAnalytics

type TraceAnalytics

type TraceAnalytics struct {
	MinDuration               int64 // Minimum duration of the generated traces (in milliseconds)
	MaxDuration               int64
	P50Duration               int64 // 50th percentile duration of the generated traces (in milliseconds)
	P90Duration               int64
	P99Duration               int64
	DurationStandardDeviation float64
	AverageDuration           float64
	AverageSpanCount          float64
	AverageSpanErrorCount     float64
	ErrorRate                 float64 // Percentage of traces with at least one span with an error status
	SpanAnalytics             map[string]*SpanAnalytics
}

Durations are represented in milliseconds

type TraceCountsMetricCalculator

type TraceCountsMetricCalculator struct{}

Metrics based on span/trace counts

func (TraceCountsMetricCalculator) Calculate

func (c TraceCountsMetricCalculator) Calculate(data *tracesData, traceAnalytics *TraceAnalytics) error

func (TraceCountsMetricCalculator) String

type TraceDurationMetricCalculator

type TraceDurationMetricCalculator struct{}

Metrics based on trace durations

func (TraceDurationMetricCalculator) Calculate

func (c TraceDurationMetricCalculator) Calculate(data *tracesData, traceAnalytics *TraceAnalytics) error

func (TraceDurationMetricCalculator) String

Jump to

Keyboard shortcuts

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