mserver

package
v0.0.0-...-7b3ddb2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLabel

func AddLabel(key, value string)

func SetIp

func SetIp(ip string, replace bool)

func Start

func Start(ctx context.Context, diskPaths []string)

Types

type BaseStats

type BaseStats struct {
	Total       int64   `json:"total_in_bytes,omitempty"`
	Free        int64   `json:"free_in_bytes,omitempty"`
	Used        int64   `json:"used_in_bytes,omitempty"`
	UsedPercent float64 `json:"used_percent,omitempty"`
}

type CpuStats

type CpuStats struct {
	Total         int64   `json:"total_in_bytes,omitempty"`
	UserPercent   float64 `json:"user_percent,omitempty"`
	SysPercent    float64 `json:"sys_percent,omitempty"`
	IoWaitPercent float64 `json:"io_wait_percent,omitempty"`
	IdlePercent   float64 `json:"idle_percent,omitempty"`
}

func NewCpuStats

func NewCpuStats(rss *sysstat.RuntimeStatSampler) *CpuStats

type FsStats

type FsStats struct {
	BaseStats
	Paths []string `json:"paths,omitempty"`
}

func NewFsStats

func NewFsStats(rss *sysstat.RuntimeStatSampler) *FsStats

type GCStats

type GCStats struct {
	CgoCalls       int64   `json:"calls,omitempty"`
	Goroutines     int64   `json:"routines,omitempty"`
	GcCount        int64   `json:"count,omitempty"`
	GCCountPercent float64 `json:"count_percent,omitempty"`
	GcPauseNS      int64   `json:"pause_nanoseconds,omitempty"`
	GcPausePercent float64 `json:"pause_percent,omitempty"`
}

func NewGCStats

func NewGCStats(rss *sysstat.RuntimeStatSampler) *GCStats

type MemStats

type MemStats struct {
	BaseStats
}

func NewMemStats

func NewMemStats(rss *sysstat.RuntimeStatSampler) *MemStats

type NetStats

type NetStats struct {
	InPerSec  int64 `json:"in_pre_second,omitempty"`
	OutPerSec int64 `json:"out_pre_second,omitempty"`
	Connect   int64 `json:"connect,omitempty"`
}

func NewNetStats

func NewNetStats(rss *sysstat.RuntimeStatSampler) *NetStats

type ServerStats

type ServerStats struct {
	Status     int64               `json:"status"`
	Ip         string              `json:"ip"`
	Labels     []metrics.LabelPair `json:"labels"`
	Mem        *MemStats           `json:"mem,omitempty"`
	Swap       *SwapStats          `json:"swap,omitempty"`
	Fs         *FsStats            `json:"fs,omitempty"`
	Cpu        *CpuStats           `json:"cpu,omitempty"`
	Net        *NetStats           `json:"net,omitempty"`
	GC         *GCStats            `json:"gc,omitempty"`
	Err        string              `json:"err,omitempty"`
	ActiveConn int                 `json:"active_conn,omitempty"`
}

func NewErrServerStatus

func NewErrServerStatus(ip string, err error) *ServerStats

func NewServerStats

func NewServerStats() *ServerStats

type SwapStats

type SwapStats struct {
	BaseStats
}

func NewSwapStats

func NewSwapStats(rss *sysstat.RuntimeStatSampler) *SwapStats

Jump to

Keyboard shortcuts

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