metrics

package
v0.2.0-beta5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2022 The envd Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Watch(ctx context.Context, cid string) chan Metrics
	Stop() error
}

func GetCollector

func GetCollector(name string, handle interface{}) (Collector, error)

func NewDockerCollector

func NewDockerCollector(client docker.Client) Collector

type Metrics

type Metrics struct {
	NCpus        uint8
	CPUUtil      int
	NetTx        int64
	NetRx        int64
	MemLimit     int64
	MemPercent   int
	MemUsage     int64
	IOBytesRead  int64
	IOBytesWrite int64
	Pids         int
}

func NewMetrics

func NewMetrics() Metrics

type WidgetCol

type WidgetCol struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

func NewCPUCol

func NewCPUCol(metChan <-chan Metrics) *WidgetCol

func NewMEMCol

func NewMEMCol(metChan <-chan Metrics) *WidgetCol

func NewNameCol

func NewNameCol(name string) *WidgetCol

type WidgetRow

type WidgetRow struct {
	ui.Block
	Cols   []*WidgetCol
	X      int
	Y      int
	Width  int
	Height int
}

func NewWidgetRow

func NewWidgetRow(nRow int) *WidgetRow

func (*WidgetRow) Add

func (row *WidgetRow) Add(col *WidgetCol)

func (*WidgetRow) Draw

func (row *WidgetRow) Draw(buf *ui.Buffer)

Jump to

Keyboard shortcuts

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