metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package metrics collects observability metrics from the memory substrate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector gathers metrics from the underlying store.

func NewCollector

func NewCollector(store storage.Store) *Collector

NewCollector creates a new Collector backed by the given store.

func (*Collector) Collect

func (c *Collector) Collect(ctx context.Context) (*Snapshot, error)

Collect queries the store and returns a metrics Snapshot.

type Snapshot

type Snapshot struct {
	CollectedAt          time.Time      `json:"collected_at"`
	TotalRecords         int            `json:"total_records"`
	RecordsByType        map[string]int `json:"records_by_type"`
	AvgSalience          float64        `json:"avg_salience"`
	AvgConfidence        float64        `json:"avg_confidence"`
	SalienceDistribution map[string]int `json:"salience_distribution"`
	ActiveRecords        int            `json:"active_records"`
	PinnedRecords        int            `json:"pinned_records"`
	TotalAuditEntries    int            `json:"total_audit_entries"`

	// RFC 15.10 metrics
	MemoryGrowthRate      float64 `json:"memory_growth_rate"`
	RetrievalUsefulness   float64 `json:"retrieval_usefulness"`
	CompetenceSuccessRate float64 `json:"competence_success_rate"`
	PlanReuseFrequency    float64 `json:"plan_reuse_frequency"`
	RevisionRate          float64 `json:"revision_rate"`
}

Snapshot is a point-in-time view of memory substrate metrics.

Jump to

Keyboard shortcuts

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