metrics

package
v0.0.0-...-a16fe4d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

later, not now

Index

Constants

This section is empty.

Variables

View Source
var Metrics = make(map[string]IMetric)

Functions

func Startup

func Startup(ctx context.Context, wg *sync.WaitGroup)

exported Startup function

Types

type AgentMetric

type AgentMetric struct {
	// constant fields
	KernelVersion   string `mapstructure:"kernel_version"`
	Arch            string `mapstructure:"arch"`
	Platform        string `mapstructure:"platform"`
	PlatformFamily  string `mapstructure:"platform_family"`
	PlatformVersion string `mapstructure:"platform_version"`
	CpuNum          string `mapstructure:"cpu_num"`
	CpuLogicalNum   string `mapstructure:"cpu_logical_num"`
	CpuMhz          string `mapstructure:"cpu_mhz"`
	CpuName         string `mapstructure:"cpu_name"`
	BootTime        string `mapstructure:"boot_at"`
	TotalMemory     string `mapstructure:"total_memory"`
	// Agent related inforamtion
	Pid         string `mapstructure:"pid"`
	Cpu         string `mapstructure:"cpu"`
	Rss         string `mapstructure:"rss"`
	ReadSpeed   string `mapstructure:"read_speed"`
	WriteSpeed  string `mapstructure:"write_speed"`
	TxSpeed     string `mapstructure:"tx_speed"`
	RxSpeed     string `mapstructure:"rx_speed"`
	Nfd         string `mapstructure:"nfd"`
	StartAt     string `mapstructure:"start_at"`
	TxTps       string `mapstructure:"tx_tps"`
	RxTps       string `mapstructure:"rx_tps"`
	Du          string `mapstructure:"du"`
	Ngr         string `mapstructure:"ngr"`
	Nproc       string `mapstructure:"nproc"`
	State       string `mapstructure:"state"`
	StateDetail string `mapstructure:"state_detail"`
	// Host related information
	SysCpu string `mapstructure:"sys_cpu"`
	SysMem string `mapstructure:"sys_mem"`
	Load1  string `mapstructure:"load_1"`
	Load5  string `mapstructure:"load_5"`
	Load15 string `mapstructure:"load_15"`
}

func (*AgentMetric) Flush

func (m *AgentMetric) Flush(now time.Time)

func (*AgentMetric) Init

func (h *AgentMetric) Init() bool

func (*AgentMetric) Name

func (m *AgentMetric) Name() string

type HostMetric

type HostMetric struct{}

func (*HostMetric) Flush

func (h *HostMetric) Flush(time.Time)

func (*HostMetric) Init

func (h *HostMetric) Init() bool

func (*HostMetric) Name

func (h *HostMetric) Name() string

type IMetric

type IMetric interface {
	Name() string
	Flush(time.Time)
	Init() bool // Is init run needed
}

type NetMetric

type NetMetric struct {
}

type PluginMetric

type PluginMetric struct {
	PName      string `mapstructure:"name"`
	PVersion   string `mapstructure:"pversion"`
	Pid        string `mapstructure:"pid"`
	Cpu        string `mapstructure:"cpu"`
	Rss        string `mapstructure:"rss"`
	ReadSpeed  string `mapstructure:"read_speed"`
	WriteSpeed string `mapstructure:"write_speed"`
	Nfd        string `mapstructure:"nfd"`
	StartAt    string `mapstructure:"start_at"`
	TxTps      string `mapstructure:"tx_tps"`
	RxTps      string `mapstructure:"rx_tps"`
	TxSpeed    string `mapstructure:"tx_speed"`
	RxSpeed    string `mapstructure:"rx_speed"`
	Du         string `mapstructure:"du"`
}

func (*PluginMetric) Flush

func (m *PluginMetric) Flush(now time.Time)

func (*PluginMetric) Init

func (h *PluginMetric) Init() bool

func (*PluginMetric) Name

func (m *PluginMetric) Name() string

Jump to

Keyboard shortcuts

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