2019-12-04 14:53:20 +03:00
|
|
|
// Package stats provides runtime stats
|
|
|
|
package stats
|
|
|
|
|
|
|
|
// Stats provides stats interface
|
|
|
|
type Stats interface {
|
2019-12-05 02:51:07 +03:00
|
|
|
// Read stat snapshot
|
|
|
|
Read() ([]*Stat, error)
|
2019-12-04 14:53:20 +03:00
|
|
|
// Write a stat snapshot
|
|
|
|
Write(*Stat) error
|
|
|
|
}
|
|
|
|
|
|
|
|
// A runtime stat
|
|
|
|
type Stat struct {
|
2019-12-05 02:51:07 +03:00
|
|
|
// Timestamp of recording
|
|
|
|
Timestamp int64
|
2019-12-04 14:53:20 +03:00
|
|
|
// Start time as unix timestamp
|
|
|
|
Started int64
|
2019-12-05 02:51:07 +03:00
|
|
|
// Uptime in seconds
|
2019-12-04 14:53:20 +03:00
|
|
|
Uptime int64
|
|
|
|
// Memory usage in bytes
|
|
|
|
Memory uint64
|
|
|
|
// Threads aka go routines
|
|
|
|
Threads uint64
|
|
|
|
// Garbage collection in nanoseconds
|
|
|
|
GC uint64
|
|
|
|
}
|