1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/debug/stats/stats.go

27 lines
510 B
Go
Raw Normal View History

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