heartbeat

package
v0.0.0-...-9625d7e Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AGENT_STATUS_RUNNING ...
	AGENT_STATUS_RUNNING = "RUNNING"
)

Variables

This section is empty.

Functions

func SendHBExec

func SendHBExec(switchChan chan bool)

SendHBExec is the heartbeat timer entry

func SendHBTicker

func SendHBTicker(switchChan chan bool)

Types

type Env

type Env struct {
	Hostname      string `json:"hostname"`
	IP            string `json:"ip"`
	Arch          string `json:"arch"`
	OS            string `json:"os"`
	Distro        string `json:"distro,omitempty"`
	DistroVersion string `json:"distro_version,omitempty"`
}

Env ...

type Extension

type Extension struct {
	Name    string
	Version string
	User    string
	PID     string
	Status  string
	Metric  string
	Meta    string
}

TODO 下一期再说 Extension ...

type HBConfig

type HBConfig struct {
	AssistSwitch bool `json:"assist_switch,omitempty"`
}

HBConfig ...

type HBResp

type HBResp struct {
	Config *HBConfig `json:"config,omitempty"`
}

HBResp ...

type Heartbeat

type Heartbeat struct {
	InstanceID string      `json:"instance_id"`
	Version    string      `json:"version,omitempty"`
	User       string      `json:"user,omitempty"`
	PID        int         `json:"pid,omitempty"`
	Status     string      `json:"status"`
	Metric     *Metric     `json:"metric,omitempty"`
	Extension  []Extension `json:"extension,omitempty"`
	EnvInfo    *Env        `json:"env_info,omitempty"`
}

Heartbeat ...

type HeartbeatState

type HeartbeatState struct {
	LastUpdateTime          time.Time
	LastUpdateSucceededTime time.Time
	IsEnvReported           bool
}

HeartbeatState ...

var (
	// HBS ...
	HBS HeartbeatState
)

type Metric

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

TODO cpu -> cpu_usage, mem -> mem_usage, port -> port_used; make it detailed; 尽量命名准确 Metric ...

Jump to

Keyboard shortcuts

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