Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { ActionName string `json:"action_name"` ActionType string `json:"action_type"` // default: "custom" else "internal" (like profiling, restart) Callback func(payload map[string]interface{}) string `json:"-"` }
Action like AxmAction
type Config ¶
type Config struct { PublicKey string PrivateKey string Name string ServerName string Hostname string Node *string Proxy string ProcessUniqueID string }
Config from user code
type Metric ¶
type Metric struct { Name string `json:"name"` Value float64 `json:"value"` Category string `json:"type"` Historic bool `json:"historic"` Unit string `json:"unit"` Aggregation string `json:"agg_type"` Function func() float64 `json:"-"` }
Metric like AxmMonitor
func CreateFuncMetric ¶
CreateFuncMetric with default values and exposed function
func CreateMetric ¶
CreateMetric with default values
type Options ¶
type Options struct { DefaultActions bool `json:"default_actions"` CustomProbes bool `json:"custom_probes"` Profiling bool `json:"profiling"` HeapDump bool `json:"heapdump"` Apm Apm `json:"apm"` }
Options like AxmOptions
type Process ¶
type Process struct { Name string `json:"name"` Server string `json:"server"` Rev string `json:"rev"` PmID int `json:"pm_id"` }
Process data
type ProfilingRequest ¶
type ProfilingRequest struct {
Timeout int64 `json:"timeout"`
}
ProfilingRequest from KM
type ProfilingResponse ¶
type ProfilingResponse struct { Data string `json:"data"` At int64 `json:"at"` Initiated string `json:"initiated"` Duration int `json:"duration"` Type string `json:"type"` Encoding string `json:"encoding"` }
ProfilingResponse to KM (data as string)
func NewProfilingResponse ¶
func NewProfilingResponse(data []byte, element string) ProfilingResponse
NewProfilingResponse with default values
type Server ¶
type Server struct { Loadavg []float64 `json:"loadavg"` TotalMem uint64 `json:"total_mem,omitempty"` FreeMem int64 `json:"free_mem,omitempty"` CPU CPU `json:"cpu"` Hostname string `json:"hostname"` Uptime int64 `json:"uptime"` Type string `json:"type"` Platform string `json:"platform"` Arch string `json:"arch"` User string `json:"user"` Interaction bool `json:"interaction"` Pm2Version string `json:"pm2_version"` NodeVersion string `json:"node_version"` RemoteIP string `json:"remote_ip"` RemotePort int `json:"remote_port"` }
Server of status packet
type Status ¶
type Status struct { Process []StatusProcess `json:"process"` Server Server `json:"server"` }
Status packet
type StatusProcess ¶
type StatusProcess struct { Pid int32 `json:"pid"` Name string `json:"name"` Server string `json:"server"` Interpreter string `json:"interpreter,omitempty"` RestartTime int `json:"restart_time,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` ExecMode string `json:"exec_mode,omitempty"` Watching bool `json:"watching,omitempty"` PmUptime int64 `json:"pm_uptime,omitempty"` Status string `json:"status,omitempty"` PmID int `json:"pm_id"` CPU float64 `json:"cpu"` Rev string `json:"rev"` Memory uint64 `json:"memory"` UniqueID string `json:"unique_id"` NodeEnv string `json:"node_env,omitempty"` AxmActions []*Action `json:"axm_actions,omitempty"` AxmMonitor map[string]*Metric `json:"axm_monitor,omitempty"` AxmOptions Options `json:"axm_options,omitempty"` }
StatusProcess data
Click to show internal directories.
Click to hide internal directories.