telemetry

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type       string                 `json:"type"`
	Timestamp  time.Time              `json:"timestamp"`
	Properties map[string]interface{} `json:"properties,omitempty"`
}

Event represents a telemetry event.

type Telemetry

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

Telemetry collects and batches telemetry events for async sending.

func New

func New(enabled bool, maxBatch int) *Telemetry

New creates a new Telemetry instance.

func NewDefault

func NewDefault() *Telemetry

NewDefault creates a telemetry instance with default settings.

func (*Telemetry) CommandTelemetryEvent

func (t *Telemetry) CommandTelemetryEvent(command string, savedTokens int, execTimeMs int64)

CommandTelemetryEvent records a command execution telemetry event.

func (*Telemetry) EventCount

func (t *Telemetry) EventCount() int

EventCount returns the number of pending events.

func (*Telemetry) FilterTelemetryEvent

func (t *Telemetry) FilterTelemetryEvent(originalTokens, filteredTokens int, layers map[string]int)

FilterTelemetryEvent records a filter pipeline telemetry event.

func (*Telemetry) Flush

func (t *Telemetry) Flush()

Flush flushes pending events.

func (*Telemetry) IsEnabled

func (t *Telemetry) IsEnabled() bool

IsEnabled returns whether telemetry is enabled.

func (*Telemetry) Record

func (t *Telemetry) Record(eventType string, props map[string]interface{})

Record records a telemetry event.

func (*Telemetry) SetOutput

func (t *Telemetry) SetOutput(path string)

SetOutput sets the output file path for telemetry events.

func (*Telemetry) String

func (t *Telemetry) String() string

String returns a summary of the telemetry state.

Jump to

Keyboard shortcuts

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