Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package telemetry contains tools to collect Database Lab Engine data.

Package telemetry contains tools to collect Database Lab Engine data.

Index

Constants

View Source
const (
	// EngineStartedEvent defines the engine start event.
	EngineStartedEvent = "engine_started"

	// EngineStoppedEvent describes the engine stop event.
	EngineStoppedEvent = "engine_stopped"

	// CloneCreatedEvent describes the clone creation event.
	CloneCreatedEvent = "clone_created"

	// CloneResetEvent describes the clone reset event.
	CloneResetEvent = "clone_reset"

	// CloneDestroyedEvent describes a clone destruction event.
	CloneDestroyedEvent = "clone_destroyed"

	// SnapshotCreatedEvent describes a snapshot creation event.
	SnapshotCreatedEvent = "snapshot_created"

	// AlertEvent describes alert events.
	AlertEvent = "alert"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent represent a telemetry agent to collect engine data.

func New

func New(cfg global.Config, engineProps global.EngineProps) (*Agent, error)

New creates a new agent.

func (*Agent) IsEnabled

func (a *Agent) IsEnabled() bool

IsEnabled checks if telemetry is enabled.

func (*Agent) Reload

func (a *Agent) Reload(cfg global.Config)

Reload reloads configuration of the telemetry agent.

func (*Agent) SendEvent

func (a *Agent) SendEvent(ctx context.Context, eventType string, payload interface{})

SendEvent sends a telemetry event.

type Alert

type Alert struct {
	Level   models.AlertType `json:"level"`
	Message string           `json:"message"`
}

Alert describes alert events.

type CloneCreated

type CloneCreated struct {
	ID          string   `json:"id"`
	CloningTime float64  `json:"cloning_time"`
	DSADiff     *float64 `json:"dsa_diff,omitempty"`
}

CloneCreated describes the clone creation and clone reset events.

type CloneDestroyed

type CloneDestroyed struct {
	ID string `json:"id"`
}

CloneDestroyed describes a clone destruction event.

type EngineStarted

type EngineStarted struct {
	EngineVersion string   `json:"engine_version"`
	DBVersion     string   `json:"db_version"`
	Pools         PoolStat `json:"pools"`
	Restore       Restore  `json:"restore"`
}

EngineStarted describes the engine start event.

type EngineStopped

type EngineStopped struct {
	Uptime float64 `json:"uptime"`
}

EngineStopped describes the engine stop event.

type PoolStat

type PoolStat struct {
	FSType    string `json:"fs_type"`
	Number    int    `json:"number"`
	TotalSize uint64 `json:"total_size"`
	TotalUsed uint64 `json:"total_used"`
}

PoolStat describes the pool stat data.

type Restore

type Restore struct {
	Mode       models.RetrievalMode `json:"mode"`
	Refreshing string               `json:"refreshing"`
	Jobs       []string             `json:"jobs"`
}

Restore describes the restore data.

type SnapshotCreated

type SnapshotCreated struct{}

SnapshotCreated describes a snapshot creation event.

Jump to

Keyboard shortcuts

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