Documentation
¶
Overview ¶
Package hoststat reads process-tree, network and GPU presence for soak telemetry. It does not signal processes.
Index ¶
Constants ¶
const ( SpanYear = 0 SpanMonth = 1 SpanWeek = 2 SpanDay = 3 SpanHour = 4 SpanSec = 6 )
Timespan values match the Plex Dashboard bucket sizes: 6 second, 4 hour, 3 day, 2 ISO week, 1 month, 0 year. Resources only keeps per-second rows on the wire; coarser tiers exist so old samples stay bounded.
Variables ¶
This section is empty.
Functions ¶
func BucketStart ¶
BucketStart is the inclusive start of the timespan bucket that contains t in loc (the server's local zone).
Types ¶
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
Resources holds a bounded ring of host samples for this node. Clustered nodes each sample themselves; a client reads the node it connected to.
func NewResources ¶
NewResources starts empty. Run samples once a second; tests call Add.
type Sample ¶
type Sample struct {
At time.Time
HostCPU float64
ProcessCPU float64
HostMem float64
ProcessMem float64
// contains filtered or unexported fields
}
Sample is one host/process observation at a bucket start. n is the number of observations folded into the averages and is not on the wire.
type Telemetry ¶
type Telemetry struct {
At time.Time `json:"at"`
RSSBytes uint64 `json:"rss_bytes"`
SelfRSS uint64 `json:"self_rss_bytes"`
HeapAlloc uint64 `json:"heap_alloc"`
HeapInuse uint64 `json:"heap_inuse"`
HeapSys uint64 `json:"heap_sys"`
HeapIdle uint64 `json:"heap_idle"`
HeapReleased uint64 `json:"heap_released"`
GOGC int `json:"gogc"`
FDs int `json:"fds"`
SQLiteFDs int `json:"sqlite_fds"`
Goroutines int `json:"goroutines"`
FFmpeg int `json:"ffmpeg"`
Sessions int `json:"sessions"`
Transcodes int `json:"transcodes"`
Children int `json:"children"`
RetryQueue int `json:"retry_queue"`
NetRx uint64 `json:"net_rx_bytes"`
NetTx uint64 `json:"net_tx_bytes"`
GPU string `json:"gpu"`
Valid bool `json:"valid"`
Error string `json:"error,omitempty"`
}
Telemetry is one soak sample. Session counts are supplied by the caller.