mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-12 08:23:58 +02:00
27 lines
510 B
Go
27 lines
510 B
Go
// Package stats provides runtime stats
|
|
package stats
|
|
|
|
// Stats provides stats interface
|
|
type Stats interface {
|
|
// 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 seconds
|
|
Uptime int64
|
|
// Memory usage in bytes
|
|
Memory uint64
|
|
// Threads aka go routines
|
|
Threads uint64
|
|
// Garbage collection in nanoseconds
|
|
GC uint64
|
|
}
|