add timestamp to stats

This commit is contained in:
Asim Aslam
2019-12-04 23:51:07 +00:00
parent 26755f86b1
commit 78647c7027
5 changed files with 63 additions and 49 deletions

View File

@@ -3,17 +3,19 @@ package stats
// Stats provides stats interface
type Stats interface {
// Read a stat snapshot
Read() (*Stat, error)
// Read stat snapshot
Read() ([]*Stat, error)
// Write a stat snapshot
Write(*Stat) error
}
// A runtime stat
type Stat struct {
// Timestamp of recording
Timestamp int64
// Start time as unix timestamp
Started int64
// Uptime in nanoseconds
// Uptime in seconds
Uptime int64
// Memory usage in bytes
Memory uint64