mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
initialize metrics with negative value prior to collector start
This commit is contained in:
@@ -17,6 +17,15 @@ type Metrics struct {
|
||||
MemUsage int64
|
||||
}
|
||||
|
||||
func NewMetrics() Metrics {
|
||||
return Metrics{
|
||||
CPUUtil: -1,
|
||||
NetTx: -1,
|
||||
NetRx: -1,
|
||||
MemUsage: -1,
|
||||
}
|
||||
}
|
||||
|
||||
type Collector interface {
|
||||
Stream() chan Metrics
|
||||
Running() bool
|
||||
|
||||
Reference in New Issue
Block a user