Documentation
¶
Overview ¶
Package telemetry provides a lightweight, import-cycle-free runtime metrics store. Both internal/relay (writer) and internal/op/ops (reader) use this package without creating a dependency cycle.
Index ¶
- type Snapshot
- type Store
- func (s *Store) ActiveConnectionsDec()
- func (s *Store) ActiveConnectionsInc()
- func (s *Store) RecordRequest(latencyMs int64, success bool)
- func (s *Store) SetActiveSessions(n int64)
- func (s *Store) SetQuotaAlerts(n int64)
- func (s *Store) SetStickyBoundSessions(n int64)
- func (s *Store) Snapshot() Snapshot
- func (s *Store) StartBackground()
- func (s *Store) StopBackground()
- type TrendPoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
TotalRequests int64
TotalFailures int64
AvgLatencyMs float64
ErrorRate float64
P95LatencyMs float64
P99LatencyMs float64
ThroughputRPS float64
ActiveConnections int64
ActiveSessions int64
StickyBoundSessions int64
QuotaAlerts int64
MemoryMB int64
TrendSnapshots []TrendPoint
HasTrendData bool
}
Snapshot holds a point-in-time view of all runtime metrics.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds all runtime metrics in a concurrency-safe way.
func (*Store) ActiveConnectionsDec ¶
func (s *Store) ActiveConnectionsDec()
func (*Store) ActiveConnectionsInc ¶
func (s *Store) ActiveConnectionsInc()
ActiveConnectionsInc increments the active connections counter.
func (*Store) RecordRequest ¶
RecordRequest records a completed relay request.
func (*Store) SetActiveSessions ¶
SetActiveSessions updates the active stream session count (called from relay).
func (*Store) SetQuotaAlerts ¶
SetQuotaAlerts updates the quota alert count (called from alert evaluator).
func (*Store) SetStickyBoundSessions ¶
SetStickyBoundSessions updates the sticky session count (called from balancer).
func (*Store) StartBackground ¶
func (s *Store) StartBackground()
StartBackground begins periodic metric collection (throughput, trend snapshots). Safe to call multiple times.
func (*Store) StopBackground ¶
func (s *Store) StopBackground()
StopBackground stops the background collection goroutines.