stats

package
v0.0.0-...-cf2fde9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUData

type CPUData struct {
	Vendor     string  `json:"vendor,omitempty"`
	PhysicalID string  `json:"physicalId,omitempty"`
	Family     string  `json:"family,omitempty"`
	Cores      int32   `json:"cores,omitempty"`
	Model      string  `json:"model,omitempty"`
	Speed      float64 `json:"speedMhz,omitempty"`
}

CPUData simple data regarding the CPU used for the machine this application is running on.

type CPUs

type CPUs struct {
	Cnt int       `json:"count,omitempty"`
	CPU []CPUData `json:"cpu,omitempty"`
}

CPUs aggregated CPU data for the machine this application is running on

type Disk

type Disk struct {
	Total        uint64  `json:"totalBytes,omitempty"`
	Free         uint64  `json:"freeBytes,omitempty"`
	Used         uint64  `json:"usedBytes,omitempty"`
	UsedPerc     float64 `json:"usedPercentage,omitempty"`
	MaxPercLimit float64 `json:"maxPercentage,omitempty"`
	Status       string  `json:"status,omitempty"`
}

Disk snapshot of the disk usage for this application

type Host

type Host struct {
	ID     string `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	Uptime string `json:"uptime,omitempty"`
}

Host simple data regarding the machines host name for the machine this application is running on.

type Mem

type Mem struct {
	Total        uint64  `json:"totalBytes,omitempty"`
	Free         uint64  `json:"freeBytes,omitempty"`
	Used         uint64  `json:"usedBytes,omitempty"`
	UsedPerc     float64 `json:"usedPercentage,omitempty"`
	MaxPercLimit float64 `json:"maxPercentage,omitempty"`
	Status       string  `json:"status,omitempty"`
}

Mem memory snapshot of the disk usage for this application

type Options

type Options struct {
	//StartTime the time that this application was started (e.g., time.Now())
	StartTime time.Time `json:"startTime,omitempty"`
}

Options initialization data/configurations for Stats

type Stats

type Stats struct {
	//SysDetails details about the system/machine the application is running on
	SysDetails *SystemDetails `json:"sysDetails,omitempty"`
	//AppDetails details about the application
	AppDetails map[string]interface{} `json:"appDetails,omitempty"`
}

Stats aggregated snapshot of the state of the machine this application is running on

func NewStats

func NewStats(opts Options) Stats

NewStats create a new stat data structure

Pre-Condition: - None Post-Condition: - None Params: - None Returns: - None Errors: - None Dev Notes: - None

func (*Stats) PullStats

func (s *Stats) PullStats() (err error)

PullStats gather primarily system stats. Also calculates application uptime if possible

Pre-Condition: - None Post-Condition: - None Params: - None Returns: - None Errors: - None Dev Notes: - None

type SystemDetails

type SystemDetails struct {
	OS   string `json:"os,omitempty"`
	CPUs *CPUs  `json:"cpu,omitempty"`
	Disk *Disk  `json:"disk,omitempty"`
	Host *Host  `json:"host,omitempty"`
	Mem  *Mem   `json:"mem,omitempty"`
}

SystemDetails details about the machine this application is running on.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL