Documentation ¶
Overview ¶
Package joefriday gets information about a system: platform, kernel, memory information, cpu information, cpu stats, cpu utilization, network information, and network usage.
Ticker versions of non-static information are available to enable monitoring.
The data can be returned as Go structs, Flatbuffer serialized bytes, or JSON serialized bytes. For convenience, there are deserialization functions for all structs that are serialized.
Index ¶
- Constants
- func Column(w int, s string) string
- func Int64Column(w int, v int64) string
- func IsParseError(e error) bool
- func IsReadError(e error) bool
- func IsResetError(e error) bool
- func TrimLeadingSpaces(p []byte) []byte
- func TrimTrailingSpaces(p []byte) []byte
- type Buffer
- type ParseError
- type Proc
- type Procer
- type ReadError
- type ResetError
- type TempFileProc
- type Ticker
- type Tocker
Constants ¶
const SysFSSystem = "/sys/devices/system"
Variables ¶
This section is empty.
Functions ¶
func Int64Column ¶
Int64Column takes an int64 and returns a right justified string of width w.
func IsParseError ¶
IsParseError r eturns a boolean indicating whether the error is a result of encountering a problem while trying to parse the file data.
func IsReadError ¶
IsReadError returns a boolean indicating whether the error is a result of a read problem.
func IsResetError ¶
IsResetError returns a boolean indicating whether the error is a result of a problem resetting the file buffer.
func TrimLeadingSpaces ¶
TrimLeadingpaces removes the leading spaces from a slice and returns it. Only 0x20 and tabs are considered space characters.
func TrimTrailingSpaces ¶
TrimTrailingSpaces removes the trailing spaces from a slice and returns it. Only 0x20, tabs, NL are considered space characters.
Types ¶
type ParseError ¶
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type Proc ¶
A Proc holds everything related to a proc file and some processing vars.
type ResetError ¶
type ResetError struct {
Err error
}
func (*ResetError) Error ¶
func (e *ResetError) Error() string
type TempFileProc ¶
type TempFileProc struct { *Proc // The directory holding the temp file. Dir string // The name of the file. Name string }
TempFileProc is used to do Proc processing off of a temp file. Prefer using the Proc type instead.
func NewTempFileProc ¶
func NewTempFileProc(prefix, name string, data []byte) (proc *TempFileProc, err error)
NewTempFileProc creates a temporary file with data as its contents and returns a TempFileProc that uses the temporary file. The file will be saved in a randomly generated tempdir that starts with prefix. If prefix is empty the os.TempDir will be used as the save directory. Name is the name of the temporary file that will be created. If name is empty, the name will be 12 randomly selected characters without an extension. The data will be used for the file and the file will be created with 0777 perms. If an error occurs, proc will be nil.
func (*TempFileProc) FullPath ¶
func (p *TempFileProc) FullPath() string
Returns the full path of the temp file for this TempFileProc.
func (*TempFileProc) ReadSlice ¶
func (p *TempFileProc) ReadSlice(delim byte) (line []byte, err error)
ReadSlice is a wrapper for bufio.Reader.ReadSlice.
func (*TempFileProc) Remove ¶
func (p *TempFileProc) Remove() error
Remove removes the temp dir and temp file.
func (*TempFileProc) Reset ¶
func (p *TempFileProc) Reset() error
Reset reset's the profiler's resources.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
cpu
|
|
cpufreq
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo.
|
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo. |
cpufreq/flat
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo.
|
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo. |
cpufreq/json
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo.
|
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo. |
cpuinfo
Package cpuinfo handles processing of /proc/cpuinfo.
|
Package cpuinfo handles processing of /proc/cpuinfo. |
cpuinfo/flat
Package cpuinfo (flat) handles Flatbuffer based processing of /proc/cpuinfo.
|
Package cpuinfo (flat) handles Flatbuffer based processing of /proc/cpuinfo. |
cpuinfo/json
Package cpuinfo (json) handles JSON based processing of /proc/cpuinfo.
|
Package cpuinfo (json) handles JSON based processing of /proc/cpuinfo. |
cpustats
Package cpustats handles the processing of information about kernel activity, /proc/stat.
|
Package cpustats handles the processing of information about kernel activity, /proc/stat. |
cpustats/flat
Package cpustats handles Flatbuffer based processing of kernel activity, /proc/stat.
|
Package cpustats handles Flatbuffer based processing of kernel activity, /proc/stat. |
cpustats/json
Package cpustats handles JSON based processing of kernel activity, /proc/stat.
|
Package cpustats handles JSON based processing of kernel activity, /proc/stat. |
cpuutil
Package cpuutil handles processing of CPU (kernel) utilization information.
|
Package cpuutil handles processing of CPU (kernel) utilization information. |
cpuutil/flat
Package cpuutil handles Flatbuffer based processing of CPU (kernel) utilization information.
|
Package cpuutil handles Flatbuffer based processing of CPU (kernel) utilization information. |
cpuutil/json
Package cpuutil handles JSON based processing of CPU (kernel) utilization information.
|
Package cpuutil handles JSON based processing of CPU (kernel) utilization information. |
cpux
Package cpux provides information about a system's cpus, where X is the integer of each CPU on the system, e.g.
|
Package cpux provides information about a system's cpus, where X is the integer of each CPU on the system, e.g. |
cpux/flat
Package cpux provides information about a system's cpus, where X is the integer of each CPU on the system, e.g.
|
Package cpux provides information about a system's cpus, where X is the integer of each CPU on the system, e.g. |
cpux/json
Package cpux provides information about a system's cpus, where X is the integer of each CPU on the system, e.g.
|
Package cpux provides information about a system's cpus, where X is the integer of each CPU on the system, e.g. |
disk
|
|
diskstats
Package diskstats handles processing of IO statistics of each block device: /proc/diskstats.
|
Package diskstats handles processing of IO statistics of each block device: /proc/diskstats. |
diskstats/flat
Package diskstats handles processing of IO statistics of each block device, /proc/diskstats.
|
Package diskstats handles processing of IO statistics of each block device, /proc/diskstats. |
diskstats/json
Package diskstats handles processing of IO statistics of each block device, /proc/diskstats.
|
Package diskstats handles processing of IO statistics of each block device, /proc/diskstats. |
diskusage
Package diskusage calculates IO usage of the block devices.
|
Package diskusage calculates IO usage of the block devices. |
diskusage/flat
Package diskusage calculates IO usage of the block devices.
|
Package diskusage calculates IO usage of the block devices. |
diskusage/json
Package diskusage calculates IO usage the of block devices.
|
Package diskusage calculates IO usage the of block devices. |
structs
Package structs defines the data structures for disk.
|
Package structs defines the data structures for disk. |
mem
|
|
membasic
Package membasic processes a subset of the /proc/meminfo file.
|
Package membasic processes a subset of the /proc/meminfo file. |
membasic/flat
Package membasic processes a subset of the /proc/meminfo file.
|
Package membasic processes a subset of the /proc/meminfo file. |
membasic/json
Package membasic processes a subset of the /proc/meminfo file.
|
Package membasic processes a subset of the /proc/meminfo file. |
meminfo
Package meminfo gets the system's memory information, /proc/meminfo.
|
Package meminfo gets the system's memory information, /proc/meminfo. |
meminfo/flat
Package meminfo processes a subset of the /proc/meminfo file.
|
Package meminfo processes a subset of the /proc/meminfo file. |
meminfo/json
Package meminfo processes the memory information, /proc/meminfo.
|
Package meminfo processes the memory information, /proc/meminfo. |
net
|
|
netdev
Package netdev gets the system's network device information: /proc/net/dev.
|
Package netdev gets the system's network device information: /proc/net/dev. |
netdev/flat
Package netdev gets the system's network device information: /proc/net/dev.
|
Package netdev gets the system's network device information: /proc/net/dev. |
netdev/json
Package netdev gets the system's network device information: /proc/net/dev.
|
Package netdev gets the system's network device information: /proc/net/dev. |
netusage
Package netusage gets the usage of the network devices.
|
Package netusage gets the usage of the network devices. |
netusage/flat
Package netusage gets the usage of the network devices.
|
Package netusage gets the usage of the network devices. |
netusage/json
Package netusage gets the usage of the network devices.
|
Package netusage gets the usage of the network devices. |
structs
Package structs defines the data structures for net.
|
Package structs defines the data structures for net. |
Package node gets information about the system's NUMA nodes.
|
Package node gets information about the system's NUMA nodes. |
flat
Package node gets information about the system's NUMA nodes.
|
Package node gets information about the system's NUMA nodes. |
json
Package node gets information about the system's NUMA nodes.
|
Package node gets information about the system's NUMA nodes. |
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs.
|
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs. |
flat
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs.
|
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs. |
json
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs.
|
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs. |
Package sysinfo returns system information.
|
Package sysinfo returns system information. |
loadavg
Package loadavg provides the system's loadavg information using a syscall.
|
Package loadavg provides the system's loadavg information using a syscall. |
loadavg/flat
Package loadavg provides the system's loadavg information using a syscall.
|
Package loadavg provides the system's loadavg information using a syscall. |
loadavg/json
Package loadavg provides the system's loadavg information using a syscall.
|
Package loadavg provides the system's loadavg information using a syscall. |
mem
Package mem returns memory information using syscalls.
|
Package mem returns memory information using syscalls. |
mem/flat
Package mem returns memory information using syscalls.
|
Package mem returns memory information using syscalls. |
mem/json
Package mem returns memory information using syscalls.
|
Package mem returns memory information using syscalls. |
uptime
Package uptime gets the system's uptime using syscall.
|
Package uptime gets the system's uptime using syscall. |
uptime/flat
Package uptime gets the system's uptime using syscall.
|
Package uptime gets the system's uptime using syscall. |
uptime/json
Package uptime gets the system's uptime using syscall.
|
Package uptime gets the system's uptime using syscall. |
system
|
|
loadavg
Package loadAvg gets loadavg information from the /proc/loadavg file.
|
Package loadAvg gets loadavg information from the /proc/loadavg file. |
loadavg/flat
Package loadAvg gets loadavg information from the /proc/loadavg file.
|
Package loadAvg gets loadavg information from the /proc/loadavg file. |
loadavg/json
Package loadAvg gets loadavg information from the /proc/loadavg file.
|
Package loadAvg gets loadavg information from the /proc/loadavg file. |
os
Package os provides OS Release information, /etc/os-release.
|
Package os provides OS Release information, /etc/os-release. |
os/flat
Package os provides OS Release information, /etc/os-release.
|
Package os provides OS Release information, /etc/os-release. |
os/json
Package os provides OS Release information, /etc/os-release.
|
Package os provides OS Release information, /etc/os-release. |
uptime
Package uptime gets the current uptime from the /proc/uptime file.
|
Package uptime gets the current uptime from the /proc/uptime file. |
uptime/flat
Package uptime gets the current uptime from the /proc/uptime file.
|
Package uptime gets the current uptime from the /proc/uptime file. |
uptime/json
Package uptime gets the current uptime from the /proc/uptime file.
|
Package uptime gets the current uptime from the /proc/uptime file. |
version
Package version gets the kernel and version information from the /proc/version file.
|
Package version gets the kernel and version information from the /proc/version file. |
version/flat
Package version gets the kernel and version information from the /proc/version file.
|
Package version gets the kernel and version information from the /proc/version file. |
version/json
Package version gets the kernel and version information from the /proc/version file.
|
Package version gets the kernel and version information from the /proc/version file. |