Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogOnPanic ¶
func LogOnPanic()
LogOnPanic catches panics and logs them on the fly. It also flushes the log file, ensuring the message appears. Then it propagates the panic so that the program flow remains unchanged.
Types ¶
type CPUInfo ¶
type CPUInfo struct { // UserAvg is the average of the user CPU usage since last time // it was polled. 0 means "not used at all" and 1 means "1 CPU was // totally full for that period". So it might be greater than 1 if // the process is monopolizing several cores. UserAvg float64 }
CPUInfo contains basic CPU info
type CurrentInfo ¶
type CurrentInfo struct {
// contains filtered or unexported fields
}
CurrentInfo is used to query CPU and Mem info, it keeps data from the previous calls to calculate averages. It is not thread safe.
func NewCurrentInfo ¶
func NewCurrentInfo() (*CurrentInfo, error)
NewCurrentInfo creates a new CurrentInfo referring to the current running program.
type Info ¶
type Info struct { // CPU contains basic CPU info CPU CPUInfo // Mem contains basic Mem info Mem MemInfo // Net contains basic Net info Net NetInfo }
Info contains all the watchdog infos, to be published by expvar
type MemInfo ¶
type MemInfo struct { // Alloc is the number of bytes allocated and not yet freed // as described in runtime.MemStats.Alloc Alloc uint64 // AllocPerSec is the average number of bytes allocated, per second, // since last time this function was called. AllocPerSec float64 }
MemInfo contains basic memory info
Click to show internal directories.
Click to hide internal directories.