widgets

package
v0.0.0-...-236ec6c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxDatapointsBar  = 20
	MaxDatapointsPlot = 120
)

Variables

Functions

func GetTimeRange

func GetTimeRange(gran ccloudmetrics.Granularity, maxDatapoints int) (time.Time, time.Time)

func ProcessResult

func ProcessResult(result []ccloudmetrics.QueryData, maxDatapoints int) []float64

Types

type CCloudMetricWidget

type CCloudMetricWidget interface {
	Update(*ccloudmetrics.MetricsClient, ccloudmetrics.Granularity, string, string, string)
}

type CCloudMetricsBarChart

type CCloudMetricsBarChart struct {
	widgets.BarChart
	// contains filtered or unexported fields
}

func NewCCloudMetricsBarChart

func NewCCloudMetricsBarChart(metric ccloudmetrics.Metric) *CCloudMetricsBarChart

func (*CCloudMetricsBarChart) Update

func (w *CCloudMetricsBarChart) Update(api *ccloudmetrics.MetricsClient, gran ccloudmetrics.Granularity, cluster, topic, requestType string)

type CCloudMetricsPlot

type CCloudMetricsPlot struct {
	widgets.Plot
	// contains filtered or unexported fields
}

func NewCCloudMetricsPlot

func NewCCloudMetricsPlot(metrics ...ccloudmetrics.Metric) *CCloudMetricsPlot

func (*CCloudMetricsPlot) Update

func (w *CCloudMetricsPlot) Update(api *ccloudmetrics.MetricsClient, gran ccloudmetrics.Granularity, cluster, topic, requestType string)

type GraphSet

type GraphSet interface {
	HotKeys() []HotKey
	GraphTitle() string
	Update()
	Graph() interface{}
}

type HotKey

type HotKey struct {
	Key    string
	Name   string
	Action func() HotKeyAction
}

type HotKeyAction

type HotKeyAction string
const (
	HotKeyNothing HotKeyAction = "Nil"
	HotKeyExit    HotKeyAction = "Exit"
	HotKeyUpdate  HotKeyAction = "Update"
)

type LogrusList

type LogrusList struct {
	widgets.List
	// contains filtered or unexported fields
}

func NewLogrusList

func NewLogrusList(lvl ...log.Level) *LogrusList

func (*LogrusList) Fire

func (lr *LogrusList) Fire(entry *log.Entry) error

func (*LogrusList) Levels

func (lr *LogrusList) Levels() []log.Level

type TopGrid

type TopGrid struct {
	ui.Grid
	HotKeys []HotKey
	Title   *widgets.Paragraph

	Logs *LogrusList

	ActiveGraphSet GraphSet
	// contains filtered or unexported fields
}

func NewTopGrid

func NewTopGrid(graph interface{}, hotkeys []HotKey) *TopGrid

func (*TopGrid) HandleEvent

func (g *TopGrid) HandleEvent(e ui.Event) HotKeyAction

func (*TopGrid) ReDraw

func (g *TopGrid) ReDraw()

ReDraw Triggers a ReDrawing/ReRendering of the UI

func (*TopGrid) ToggleLogs

func (g *TopGrid) ToggleLogs() bool

ToggleLogs Hides and Shows the Logs widget at the bottom of the screen

func (*TopGrid) Update

func (g *TopGrid) Update()

Update Triggers any updates to fetch metrics/stats from the Active GraphSet

Jump to

Keyboard shortcuts

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