probe

package
v0.0.0-...-6f31a55 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PROBE_CPU = 2
View Source
const PROBE_MEMORY = 1

Variables

This section is empty.

Functions

func BuildCPUQuery

func BuildCPUQuery(config Config) string

func BuildMemoryQuery

func BuildMemoryQuery(config Config) string

func BuildUrl

func BuildUrl(config Config, query string) string

func Float2Time

func Float2Time(tf float64) time.Time

func ProbeCPU

func ProbeCPU(cfgFilename string)

func ProbeMemory

func ProbeMemory(cfgFilename string)

Types

type Config

type Config struct {
	Token      string   `yaml:"token"`
	Host       string   `yaml:"host"`
	Pod        string   `yaml:"pod"`
	Containers []string `yaml:"containers"`
}

func GetConfig

func GetConfig(filename string) (Config, error)

type Entry

type Entry struct {
	Container string
	Value     string
	Timestamp time.Time
}

func Res2Entry

func Res2Entry(res PromResult) Entry

type PromData

type PromData struct {
	Results []PromResult `json:"result"`
}

type PromMetric

type PromMetric struct {
	Container string `json:"container"`
}

type PromResp

type PromResp struct {
	Data PromData `json:"data"`
}

type PromResult

type PromResult struct {
	Metric PromMetric  `json:"metric"`
	Value  []PromValue `json:"value"`
}

type PromValue

type PromValue struct {
	Timestamp time.Time
	Value     string
}

func (*PromValue) UnmarshalJSON

func (pv *PromValue) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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