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.
Click to show internal directories.
Click to hide internal directories.