ax(mining): replace prose struct comments with usage examples in metrics.go
AX principle 2: comments show HOW with real values, not WHAT the type signature already states. Metrics and LatencyHistogram had prose descriptions; replaced with concrete call-site examples. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
00d0e5ed96
commit
9f0df5e86e
1 changed files with 4 additions and 3 deletions
|
|
@ -6,8 +6,8 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// Metrics provides simple instrumentation counters for the mining package.
|
||||
// These can be exposed via Prometheus or other metrics systems in the future.
|
||||
// snapshot := mining.GetMetricsSnapshot()
|
||||
// snapshot["miners_started"].(int64)
|
||||
type Metrics struct {
|
||||
// API metrics
|
||||
RequestsTotal atomic.Int64
|
||||
|
|
@ -34,7 +34,8 @@ type Metrics struct {
|
|||
P2PConnectionsTotal atomic.Int64
|
||||
}
|
||||
|
||||
// LatencyHistogram tracks request latencies with basic percentile support.
|
||||
// h := mining.NewLatencyHistogram(1000)
|
||||
// h.Record(42 * time.Millisecond)
|
||||
type LatencyHistogram struct {
|
||||
mu sync.Mutex
|
||||
samples []time.Duration
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue