collector_docker

package
v0.0.0-...-5fda629 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInterval = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

func NewCollectorDocker

func NewCollectorDocker(ctx context.Context, controller docker.Controller, interval int64) (*Collector, error)

func (*Collector) Close

func (r *Collector) Close() error

func (*Collector) CloseChan

func (r *Collector) CloseChan(containerId string) error

func (*Collector) Logs

func (r *Collector) Logs(containerId string) (string, error)

func (*Collector) OutputLogs

func (r *Collector) OutputLogs(containerId string) (<-chan string, error)

func (*Collector) OutputMetrics

func (r *Collector) OutputMetrics(containerId string) (<-chan string, error)

收集指定容器 Id 的监控数据,监控数据结构体在 pkg/supbagent/resources/manager_containers/containers中有定义,此函数也会在那调用

type CollectorMetrics

type CollectorMetrics struct {
	Name             string    `json:"name"`
	ID               string    `json:"id"`
	CPUPercentage    float64   `json:"cpuPercentage"`
	Memory           float64   `json:"memory"`
	MemoryPercentage float64   `json:"memoryPercentage"`
	MemoryLimit      float64   `json:"memoryLimit"`
	NetworkRx        float64   `json:"networkRx"`
	NetworkTx        float64   `json:"networkTx"`
	BlockRead        float64   `json:"blockRead"`
	BlockWrite       float64   `json:"blockWrite"`
	PidsCurrent      uint64    `json:"pidsCurrent"`
	Timestamp        time.Time `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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