Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error used when parsing the fields of the output of collector. ErrInsufficientLines = errors.New("insufficient lines") // Error used when parsing the lines of the output of collector. ErrInsuficientFields = errors.New("insufficient fields") // Error used when given key is not found while parsing KV. ErrKeyNotFound = errors.New("key not found") // Error used when tehre is no disk volume information available ErrNoVolumeFound = errors.New("No disk volume information found") )
Functions ¶
Types ¶
type DiskVolumeInformation ¶
type DiskVolumeInformation struct { Name string `json:"name"` // represents the filesystem in linux/macos or device name in windows SizeMaximum uint64 `json:"sizeMaximum"` // represents the maximum size of the disk in kilobytes SizeCurrent uint64 `json:"sizeCurrent"` // represents the current size of the disk in kilobytes }
func NewDiskVolumeInformation ¶
func NewDiskVolumeInformation(name string, maximum, current uint64) *DiskVolumeInformation
func ParseDiskVolumeInformationOutput ¶
func ParseDiskVolumeInformationOutput(output string, skipLines int, scale float64) ([]*DiskVolumeInformation, error)
type FileDescriptorInformation ¶
func ParseFileDescriptorInformationFromKV ¶
func ParseFileDescriptorInformationFromKV( output string, fileDescriptorMaximumKey string, fileDescriptorCurrentKey string, ) (*FileDescriptorInformation, error)
func ParseSysctlFileDescriptorInformation ¶
func ParseSysctlFileDescriptorInformation(output string) (*FileDescriptorInformation, error)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewDiagnosticHandler ¶
func (*Handler) SystemHandler ¶
func (handler *Handler) SystemHandler(writer http.ResponseWriter, request *http.Request)
type MemoryInformation ¶
type MemoryInformation struct { MemoryMaximum uint64 // size in KB MemoryCurrent uint64 // size in KB }
type OsInfo ¶
type SystemCollector ¶
type SystemCollector interface { // If the collection is successful it will return `SystemInformation` struct, // an empty string, and a nil error. // In case there is an error a string with the raw data will be returned // however the returned string not contain all the data points. // // This function expects that the caller sets the context timeout to prevent // long-lived collectors. Collect(ctx context.Context) (*SystemInformation, string, error) }
type SystemCollectorImpl ¶
type SystemCollectorImpl struct {
// contains filtered or unexported fields
}
func NewSystemCollectorImpl ¶
func NewSystemCollectorImpl( version string, ) *SystemCollectorImpl
func (*SystemCollectorImpl) Collect ¶
func (collector *SystemCollectorImpl) Collect(ctx context.Context) (*SystemInformation, string, error)
type SystemInformation ¶
type SystemInformation struct { MemoryMaximum uint64 `json:"memoryMaximum"` // represents the maximum memory of the system in kilobytes MemoryCurrent uint64 `json:"memoryCurrent"` // represents the system's memory in use in kilobytes FileDescriptorMaximum uint64 `json:"fileDescriptorMaximum"` // represents the maximum number of file descriptors of the system FileDescriptorCurrent uint64 `json:"fileDescriptorCurrent"` // represents the system's file descriptors in use OsSystem string `json:"osSystem"` // represents the operating system name i.e.: linux, windows, darwin HostName string `json:"hostName"` // represents the system host name OsVersion string `json:"osVersion"` // detailed information about the system's release version level OsRelease string `json:"osRelease"` // detailed information about the system's release Architecture string `json:"architecture"` // represents the system's hardware platform i.e: arm64/amd64 TunnellinkVersion string `json:"tunnellinkVersion"` // the runtime version of tunnellink Disk []*DiskVolumeInformation `json:"disk"` }
func NewSystemInformation ¶
func NewSystemInformation( memoryMaximum, memoryCurrent, filesMaximum, filesCurrent uint64, osystem, name, osVersion, osRelease, architecture, tunnellinkVersion string, disk []*DiskVolumeInformation, ) *SystemInformation
Click to show internal directories.
Click to hide internal directories.