diff --git a/debug/stats/stats.go b/debug/stats/stats.go new file mode 100644 index 00000000..16e9faf3 --- /dev/null +++ b/debug/stats/stats.go @@ -0,0 +1,24 @@ +// Package stats provides runtime stats +package stats + +// Stats provides stats interface +type Stats interface { + // Read a stat snapshot + Read() (*Stat, error) + // Write a stat snapshot + Write(*Stat) error +} + +// A runtime stat +type Stat struct { + // Start time as unix timestamp + Started int64 + // Uptime in nanoseconds + Uptime int64 + // Memory usage in bytes + Memory uint64 + // Threads aka go routines + Threads uint64 + // Garbage collection in nanoseconds + GC uint64 +}