Documentation ¶
Overview ¶
Package hoststat offers host connection quality statistics and predefined sorts.
Index ¶
Constants ¶
View Source
const EwmaSlide int = 10
EwmaSlide is the EWMA window size.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostStat ¶
type HostStat struct { Value float64 `json:"v"` Count int `json:"n"` Time time.Time `json:"t"` // contains filtered or unexported fields }
HostStat is a single HostStat.
type HostStats ¶
type HostStats struct { sync.RWMutex Stats map[string]*HostStat Validity time.Duration BackupInterval time.Duration LastRecount time.Time }
HostStats holds all HostStats.
func MapStatsFile ¶
MapStatsFile loads HostStats from a file, and save back the new results periodically.
func (*HostStats) Cleanup ¶
func (hs *HostStats) Cleanup()
Cleanup cleans expired stats up, and reset the stat periodically.
Click to show internal directories.
Click to hide internal directories.