Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is a thread-safe view of the C++ logarithmic-histogram engine (1 µs to 60 s, ~3 significant figures in log10 binning). All methods are safe for concurrent use.
func NewEngine ¶
func NewEngine() *Engine
NewEngine creates a new statistics engine. The caller should call Close when the engine is no longer needed to release C++ memory (finalizers are not reliable for C++ destructors).
func (*Engine) Close ¶
func (e *Engine) Close()
Close releases native resources. Safe to call more than once.
func (*Engine) GetPercentile ¶
GetPercentile returns the estimated latency in nanoseconds for the given percentile p in [0, 100] using a histogram CDF. Returns 0 if there are no samples.
func (*Engine) RecordLatency ¶
RecordLatency records one latency sample in nanoseconds. Values are clamped to the configured histogram range for bucketing: below 1 µs to the first bucket, at or above 60 s to the last bucket. Negative values are treated like zero (first bucket).