metrics

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package metrics provides daemon-wide atomic counters for observability. Distinct from supervisor.Metrics which tracks per-process ring-buffer stats; this package tracks daemon-level aggregate counters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DaemonMetrics

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

DaemonMetrics provides thread-safe daemon-wide counters using sync/atomic.

func NewDaemonMetrics

func NewDaemonMetrics() *DaemonMetrics

NewDaemonMetrics creates a new zeroed DaemonMetrics.

func (*DaemonMetrics) DecSessionsActive

func (m *DaemonMetrics) DecSessionsActive()

DecSessionsActive atomically decrements the active session counter.

func (*DaemonMetrics) DecSubprocessesActive

func (m *DaemonMetrics) DecSubprocessesActive()

DecSubprocessesActive atomically decrements the active subprocess counter.

func (*DaemonMetrics) IncErrors

func (m *DaemonMetrics) IncErrors()

IncErrors atomically increments the error counter.

func (*DaemonMetrics) IncSessionsActive

func (m *DaemonMetrics) IncSessionsActive()

IncSessionsActive atomically increments the active session counter.

func (*DaemonMetrics) IncSubprocessesActive

func (m *DaemonMetrics) IncSubprocessesActive()

IncSubprocessesActive atomically increments the active subprocess counter.

func (*DaemonMetrics) IncToolCalls

func (m *DaemonMetrics) IncToolCalls()

IncToolCalls atomically increments the tool call counter.

func (*DaemonMetrics) Snapshot

func (m *DaemonMetrics) Snapshot() Snapshot

Snapshot returns a point-in-time copy of all counters.

type Snapshot

type Snapshot struct {
	ToolCallsTotal     int64 `json:"tool_calls_total"`
	ErrorsTotal        int64 `json:"errors_total"`
	SessionsActive     int64 `json:"sessions_active"`
	SubprocessesActive int64 `json:"subprocesses_active"`
}

Snapshot holds a point-in-time copy of daemon metrics.

Jump to

Keyboard shortcuts

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