monitor

package
v3.0.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const CmdLong = `` /* 315-byte string literal not displayed */

CmdLong factorizes the long desc text defined by commands invoking a Monitor.

Variables

This section is empty.

Functions

func InitColor

func InitColor()

func StrObjectStatus

func StrObjectStatus(d object.Status) string

Types

type EventBGetter

type EventBGetter interface {
	GetRaw() (chan []byte, error)
}

type EventGetter

type EventGetter interface {
	Do() (<-chan event.Event, error)
}

type Frame

type Frame struct {
	Selector string
	Nodes    []string
	Sections []string
	Current  clusterdump.Data
	Previous clusterdump.Data
	Stats    clusterdump.Stats
	// Nodename is the nodename from which we have received data (value of
	// .daemon.nodename)
	Nodename string
	// contains filtered or unexported fields
}

Frame exposes daemon status renderer tunables.

func (Frame) NodeVersions

func (f Frame) NodeVersions() *set.Set

func (*Frame) Render

func (f *Frame) Render() string

Render return a string buffer containing a human-friendly representation of Render.

func (Frame) StrDaemonState

func (f Frame) StrDaemonState(n string) string

func (Frame) StrDaemonUptime

func (f Frame) StrDaemonUptime(n string) string

func (Frame) StrHbQueue

func (f Frame) StrHbQueue(n string) string

func (Frame) StrHeartbeat

func (f Frame) StrHeartbeat(n string, hbType string) string

func (Frame) StrNodeArbitratorStatus

func (f Frame) StrNodeArbitratorStatus(name, node string) string

func (Frame) StrNodeHbMode

func (f Frame) StrNodeHbMode(peer string) string

func (Frame) StrNodeLoad

func (f Frame) StrNodeLoad(n string) string

func (Frame) StrNodeMem

func (f Frame) StrNodeMem(n string) string

func (Frame) StrNodeScore

func (f Frame) StrNodeScore(n string) string

func (Frame) StrNodeStates

func (f Frame) StrNodeStates(n string) string

func (Frame) StrNodeSwap

func (f Frame) StrNodeSwap(n string) string

func (Frame) StrNodeUptime

func (f Frame) StrNodeUptime(n string) string

func (Frame) StrNodeVersion

func (f Frame) StrNodeVersion(n string) string

func (Frame) StrObjectInstance

func (f Frame) StrObjectInstance(path string, node string, scope []string) string

func (Frame) StrObjectRunning

func (f Frame) StrObjectRunning(path string) string

type Getter

type Getter interface {
	Get() ([]byte, error)
}

type T

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

T is a monitor renderer instance. It stores the rendering options.

func New

func New() T

New allocates a monitor.

func (*T) Do

func (m *T) Do(getter Getter, out io.Writer) error

Do function renders the cluster status

func (*T) DoWatch

func (m *T) DoWatch(statusGetter Getter, evReader event.ReadCloser, out io.Writer) error

func (*T) SetColor

func (m *T) SetColor(v string)

SetColor sets the color option. Default is "auto", interpreted as colored if the terminal as a tty.

func (*T) SetFormat

func (m *T) SetFormat(v string)

SetFormat sets the rendering format option. Default is "auto", interpreted as human-readable.

func (*T) SetNodes

func (m *T) SetNodes(v []string)

SetNodes sets the nodes option, controlling which node columns to render. Defaults to an empty list, interpreted as all nodes.

func (*T) SetSections

func (m *T) SetSections(v []string)

SetSections sets the sections option, controlling which sections to render (threads, nodes, arbitrators, objects). Defaults to an empty list, interpreted as all sections.

func (*T) SetSectionsFromExpression

func (m *T) SetSectionsFromExpression(s string)

SetSectionsFromExpression sets the sections option, parsing a string representation of a section list, using comma as separator.

func (*T) SetSelector

func (m *T) SetSelector(v string)

SetSelector sets the selector option. Default is "*".

Jump to

Keyboard shortcuts

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