Documentation
¶
Overview ¶
Package metrics provides performance tracking for Nebula
Index ¶
- Variables
- type Collector
- func (c *Collector) GetAll() map[string]interface{}
- func (c *Collector) Record(name string, value interface{})
- func (c *Collector) RecordCounter(name string, value float64, labels ...string)
- func (c *Collector) RecordGauge(name string, value float64, labels ...string)
- func (c *Collector) RecordHistogram(name string, value float64, labels ...string)
- func (c *Collector) StartTime() time.Time
- type LatencyTracker
- type ThroughputTracker
- type Timer
Constants ¶
This section is empty.
Variables ¶
var ( // RecordsProcessed tracks total records processed RecordsProcessed = promauto.NewCounterVec( prometheus.CounterOpts{ Name: "nebula_records_processed_total", Help: "Total number of records processed", }, []string{"source", "destination", "status"}, ) // ProcessingLatency tracks processing latency in nanoseconds ProcessingLatency = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "nebula_processing_latency_nanoseconds", Help: "Processing latency in nanoseconds", Buckets: []float64{ 100, 1000, 10000, 100000, 1e6, 1e7, 1e8, 1e9, }, }, []string{"operation", "source", "destination"}, ) // MemoryAllocated tracks memory allocations MemoryAllocated = promauto.NewGaugeVec( prometheus.GaugeOpts{ Name: "nebula_memory_allocated_bytes", Help: "Memory allocated in bytes", }, []string{"component"}, ) // ActiveConnections tracks active connections ActiveConnections = promauto.NewGaugeVec( prometheus.GaugeOpts{ Name: "nebula_active_connections", Help: "Number of active connections", }, []string{"type", "destination"}, ) // QueueDepth tracks queue depths QueueDepth = promauto.NewGaugeVec( prometheus.GaugeOpts{ Name: "nebula_queue_depth", Help: "Current queue depth", }, []string{"queue_name"}, ) // GCPauseDuration tracks GC pause durations GCPauseDuration = promauto.NewHistogram( prometheus.HistogramOpts{ Name: "nebula_gc_pause_duration_nanoseconds", Help: "GC pause duration in nanoseconds", Buckets: []float64{ 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, }, }, ) // Throughput tracks records per second Throughput = promauto.NewGaugeVec( prometheus.GaugeOpts{ Name: "nebula_throughput_records_per_second", Help: "Current throughput in records per second", }, []string{"source", "destination"}, ) // AllocationRate tracks memory allocation rate AllocationRate = promauto.NewGauge( prometheus.GaugeOpts{ Name: "nebula_memory_allocation_rate_bytes_per_second", Help: "Memory allocation rate in bytes per second", }, ) )
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector is a metrics collector interface
func NewCollector ¶
NewCollector creates a new metrics collector for a component
func (*Collector) RecordCounter ¶
RecordCounter records a counter metric
func (*Collector) RecordGauge ¶
RecordGauge records a gauge metric
func (*Collector) RecordHistogram ¶
RecordHistogram records a histogram metric
type LatencyTracker ¶
type LatencyTracker struct {
// contains filtered or unexported fields
}
LatencyTracker provides percentile tracking
func NewLatencyTracker ¶
func NewLatencyTracker(maxSize int) *LatencyTracker
NewLatencyTracker creates a new latency tracker
func (*LatencyTracker) GetPercentile ¶
func (l *LatencyTracker) GetPercentile(p float64) time.Duration
GetPercentile returns the percentile value (0-100)
func (*LatencyTracker) Record ¶
func (l *LatencyTracker) Record(d time.Duration)
Record records a latency value
type ThroughputTracker ¶
type ThroughputTracker struct {
// contains filtered or unexported fields
}
ThroughputTracker tracks throughput over time
func NewThroughputTracker ¶
func NewThroughputTracker(source, destination string) *ThroughputTracker
NewThroughputTracker creates a new throughput tracker
func (*ThroughputTracker) GetAndReset ¶
func (t *ThroughputTracker) GetAndReset() float64
GetAndReset returns the current throughput and resets the counter
func (*ThroughputTracker) Increment ¶
func (t *ThroughputTracker) Increment(n int64)
Increment increments the counter