Documentation ¶
Index ¶
- func EncodeCompressed(h *Hist) ([]byte, error)
- type Config
- type Hist
- func (h *Hist) Add(o *Hist)
- func (h *Hist) AllVals() []HistVal
- func (h *Hist) Clear()
- func (h *Hist) Clone() *Hist
- func (h *Hist) Config() Config
- func (h *Hist) EndTime() (time.Time, bool)
- func (h *Hist) EstMemSize() int
- func (h *Hist) GetConfig() Config
- func (h *Hist) Init(cfg Config)
- func (h *Hist) Max() int64
- func (h *Hist) Mean() float64
- func (h *Hist) Min() int64
- func (h *Hist) PercentileVal(p float64) HistVal
- func (h *Hist) Record(v int64)
- func (h *Hist) RecordCorrected(v int64, expectedInterval int64)
- func (h *Hist) RecordN(v, count int64)
- func (h *Hist) SetAutoResize(b bool)
- func (h *Hist) SetEndTime(t time.Time)
- func (h *Hist) SetStartTime(t time.Time)
- func (h *Hist) StartTime() (time.Time, bool)
- func (h *Hist) Stdev() float64
- func (h *Hist) Sub(o *Hist)
- func (h *Hist) TotalCount() int64
- func (h *Hist) Val(v int64) HistVal
- type HistVal
- type LogWriter
- func (l *LogWriter) GetBaseTime() (time.Time, bool)
- func (l *LogWriter) SetBaseTime(base time.Time)
- func (l *LogWriter) WriteBaseTime(base time.Time) error
- func (l *LogWriter) WriteComment(text string) error
- func (l *LogWriter) WriteIntervalHist(h *Hist) error
- func (l *LogWriter) WriteLegend() error
- func (l *LogWriter) WriteStartTime(start time.Time) error
- type Recorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCompressed ¶
Types ¶
type Config ¶
type Config struct { // LowestDiscernible is the lowest value that // can be discerned from 0. Must be positive. // This number may be rounded down to the // nearest power of 2. LowestDiscernible int64 // HighestTrackable is the largest value that can // be tracked by the histogram. This must be at // least twice the value of LowestDiscernible. HighestTrackable int64 // SigFigs are the number of significant figures // that will be maintained by the histogram. Must // be ∈ [0,5]. SigFigs int32 // AutoResize will adjust HighestTrackable and // resize the histogram if necessary. Note that // resizing the histogram requires allocation // and will take longer than a typical operation. AutoResize bool // contains filtered or unexported fields }
Config contains the options that can be used to configure a Hist.
type Hist ¶
type Hist struct {
// contains filtered or unexported fields
}
func DecodeCompressed ¶
func New ¶
New creates a new Hist that auto-resizes and has a LowestDiscernible value of 1. Valid values for sigfigs are between 0 and 5.
func WithConfig ¶
WithConfig creates a new Hist with the provided Config.
func (*Hist) Clear ¶
func (h *Hist) Clear()
Clear deletes all recorded values as well as the start and end times.
func (*Hist) Clone ¶
Clone returns a deep copy of the histogram. This is useful when combining or taking differences of histograms.
func (*Hist) EstMemSize ¶
EstMemSize estimates the number of bytes being consumed by the histogram. It ignores any memory usage caused by the start time and end time. The resulting size should not be assumed to be exact. The return value is in bytes.
func (*Hist) PercentileVal ¶
func (*Hist) RecordCorrected ¶
func (*Hist) SetAutoResize ¶
func (*Hist) SetEndTime ¶
func (*Hist) SetStartTime ¶
func (*Hist) TotalCount ¶
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
func NewLogWriter ¶
func (*LogWriter) SetBaseTime ¶
func (*LogWriter) WriteComment ¶
func (*LogWriter) WriteIntervalHist ¶
func (*LogWriter) WriteLegend ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}