telemetry

package
v0.0.0-...-706b979 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEndpoint is the telemetry collection endpoint
	DefaultEndpoint = "https://telemetry.basekick.net/api/v1/telemetry"

	// DefaultInterval is the telemetry reporting interval
	DefaultInterval = 24 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	PhysicalCores *int `json:"physical_cores"`
	LogicalCores  *int `json:"logical_cores"`
	FrequencyMHz  *int `json:"frequency_mhz"`
}

CPUInfo contains CPU information

type Collector

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

Collector collects and sends telemetry data

func New

func New(cfg *Config, version string, logger zerolog.Logger) (*Collector, error)

New creates a new telemetry collector

func (*Collector) GetInstanceID

func (c *Collector) GetInstanceID() string

GetInstanceID returns the instance ID

func (*Collector) Start

func (c *Collector) Start()

Start begins periodic telemetry collection

func (*Collector) Stop

func (c *Collector) Stop()

Stop stops the telemetry collector

type Config

type Config struct {
	Enabled  bool          // Enable telemetry (default: true)
	Endpoint string        // Telemetry endpoint URL
	Interval time.Duration // Reporting interval (default: 24h)
	DataDir  string        // Directory for instance ID file
}

Config holds telemetry configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default telemetry configuration

type MemInfo

type MemInfo struct {
	TotalGB *float64 `json:"total_gb"`
}

MemInfo contains memory information

type OSInfo

type OSInfo struct {
	Name         string `json:"name"`
	Version      string `json:"version"`
	Architecture string `json:"architecture"`
	Platform     string `json:"platform"`
}

OSInfo contains operating system information

type TelemetryPayload

type TelemetryPayload struct {
	InstanceID string  `json:"instance_id"`
	Timestamp  string  `json:"timestamp"`
	ArcVersion string  `json:"arc_version"`
	OS         OSInfo  `json:"os"`
	CPU        CPUInfo `json:"cpu"`
	Memory     MemInfo `json:"memory"`
}

TelemetryPayload represents the data sent to the telemetry endpoint Matches Python format from collector.py

Jump to

Keyboard shortcuts

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