metrics

package
v0.0.0-...-fa91818 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppMetric

type AppMetric struct {
	// contains filtered or unexported fields
}

AppMetric application metric

func NewAppMetric

func NewAppMetric(record string) *AppMetric

NewAppMetric creates a new `AppMetric`

func (*AppMetric) String

func (am *AppMetric) String() string

String returns `AppMetric` string representation

type Container

type Container struct {
	Name   string `json:"name"`
	ID     string `json:"id"`
	Type   string `json:"type"`
	Status string `json:"state"`
	State  string `json:"status"`

	CreatedAt int64  `json:"created_at"`
	StartedAt string `json:"started_at"`

	Labels map[string]string `json:"labels"`

	Image         string `json:"image"`
	SizeContainer int64  `json:"size_container"`
	SizeAdded     int64  `json:"size_added"`

	Ports   []Port   `json:"ports"`
	Volumes []Volume `json:"volumes"`

	Command string `json:"command"`

	CPUUsedPercentage float64 `json:"cpu_used_percentage"`

	MemoryTotal          float64 `json:"memory_total"`
	MemoryCurrent        float64 `json:"memory_current"`
	MemoryUsedPercentage float64 `json:"memory_used_percentage"`

	IPAddress string `json:"ip_address"`

	NetworkName     string  `json:"network_name"`
	NetworkInbound  float64 `json:"network_inbound"`
	NetworkOutbound float64 `json:"network_outbound"`

	PIDs uint64 `json:"pid_count"`
}

Container defines container data

type OS

type OS struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

OS represents the underlying OS information

type Port

type Port struct {
	IP          string `json:"ip_address"`
	PrivatePort uint16 `json:"private_port"`
	PublicPort  uint16 `json:"public_port"`
	Type        string `json:"type"`
}

Port defines a container port

type ServerLoad

type ServerLoad struct {
	Load1  float64 `json:"load1"`
	Load5  float64 `json:"load5"`
	Load15 float64 `json:"load15"`
}

ServerLoad represents server load metric

type ServerMetric

type ServerMetric struct {
	Hostname             string      `json:"hostname"`
	CPUUsedPercentage    float64     `json:"cpu_used_percentage"`
	CPUCoreCount         int         `json:"cpu_core_count"`
	Load                 ServerLoad  `json:"load"`
	MemoryTotal          uint64      `json:"memory_total"`
	MemoryUserPercentage float64     `json:"memory_used_percentage"`
	DiskTotal            uint64      `json:"disk_total"`
	DiskUsedPercentage   float64     `json:"disk_used_percentage"`
	CreatedAt            time.Time   `json:"-"`
	CreatedAtFormatted   string      `json:"created_at"`
	OS                   *OS         `json:"os"`
	BootTime             uint64      `json:"boot_time"`
	RebootRequired       bool        `json:"reboot_required"`
	Services             []Service   `json:"services"`
	Containers           []Container `json:"containers"`
	PHPVersion           string      `json:"php_version"`
}

ServerMetric represents a server metric

func (*ServerMetric) String

func (sm *ServerMetric) String() string

String returns `ServerMetric` in a string format

type Service

type Service struct {
	Name        string `json:"name"`         // The primary unit name as string
	Description string `json:"description"`  // The human readable description string
	LoadState   string `json:"load_state"`   // The load state (i.e. whether the unit file has been loaded successfully)
	ActiveState string `json:"active_state"` // The active state (i.e. whether the unit is currently started or not)
	SubState    string `json:"sub_state"`    // The sub state (a more fine-grained version of the active state that is specific to the

}

Service represents a systemd service

type Volume

type Volume struct {
	Type        string `json:"type"`
	Name        string `json:"name"`
	Source      string `json:"source"`
	Destination string `json:"destination"`
	Driver      string `json:"driver"`
	Mode        string `json:"mode"`
	Size        int64  `json:"size"`
	RW          bool   `json:"rw"`
}

Volume defines a docker volume

Jump to

Keyboard shortcuts

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