clusterdump

package
v3.0.0-rc39 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlkStats

type BlkStats struct {
	Read      uint64 `json:"r"`
	ReadByte  uint64 `json:"rb"`
	Write     uint64 `json:"w"`
	WriteByte uint64 `json:"wb"`
}

BlkStats holds block devices resource usage metrics.

type CPUStats

type CPUStats struct {
	Time uint64 `json:"time"`
}

CPUStats holds CPU resource usage metrics.

type Cluster

type Cluster struct {
	Config cluster.Config           `json:"config"`
	Status Status                   `json:"status"`
	Object map[string]object.Status `json:"object"`

	Node map[string]node.Node `json:"node"`
}

type Data

type Data struct {
	Cluster Cluster `json:"cluster"`

	Daemon daemonsubsystem.DaemonLocal `json:"daemon"`
}

Data describes the full Cluster state.

func NewData

func NewData(fromNode string) *Data

NewData initializes a new Data instance with an empty cluster and daemon specific to the provided nodename.

func (*Data) ArbitratorNames

func (s *Data) ArbitratorNames() []string

func (*Data) DeepCopy

func (s *Data) DeepCopy() *Data

DeepCopy returns a copy of the cluster dataset sharing nothing with it.

This used to be a json.Marshal followed by a json.Unmarshal of the whole dataset, which on an idle daemon was the single most expensive thing it did, and did it on the daemondata goroutine, where it blocked every other cluster data operation for its duration.

A nil Object or Node map is kept nil rather than made empty: neither field has omitempty, so the two do not serialize alike.

func (*Data) GetNodeData

func (s *Data) GetNodeData(nodename string) *node.Node

GetNodeData extracts from the cluster dataset all information relative to node data.

func (*Data) GetNodeStatus

func (s *Data) GetNodeStatus(nodename string) *node.Status

GetNodeStatus extracts from the cluster dataset all information relative to node status.

func (*Data) GetObjectStatus

func (s *Data) GetObjectStatus(p naming.Path) object.Digest

GetObjectStatus extracts from the cluster dataset all information relative to an object.

func (*Data) ObjectPaths

func (s *Data) ObjectPaths() naming.Paths

func (*Data) WithNamespace

func (s *Data) WithNamespace(namespaces ...string) *Data

WithNamespace returns a view of the dataset without the objects not matching the namespaces. The receiver is not modified, see filter.

func (*Data) WithSelector

func (s *Data) WithSelector(selector string) *Data

WithSelector returns a view of the dataset without the objects not matching the selector expression. The receiver is not modified, see filter.

type MemStats

type MemStats struct {
	Total uint64 `json:"total"`
}

MemStats holds CPU resource usage metrics.

type NetStats

type NetStats struct {
	Read      uint64 `json:"r"`
	ReadByte  uint64 `json:"rb"`
	Write     uint64 `json:"w"`
	WriteByte uint64 `json:"wb"`
}

NetStats holds network resource usage metrics.

type NodeStatsBundle

type NodeStatsBundle struct {
	Time       time.Time              `json:"time"`
	Collector  ThreadStats            `json:"collector"`
	Daemon     ThreadStats            `json:"daemon"`
	DNS        ThreadStats            `json:"dns"`
	Scheduler  ThreadStats            `json:"scheduler"`
	Listener   ThreadStats            `json:"listener"`
	Monitor    ThreadStats            `json:"monitor"`
	Heartbeats map[string]ThreadStats `json:"-"`
	Objects    map[string]ObjectStats `json:"objects"`
}

NodeStatsBundle embeds all daemon threads and each object system resource usage metrics.

func (*NodeStatsBundle) UnmarshalJSON

func (t *NodeStatsBundle) UnmarshalJSON(b []byte) error

UnmarshalJSON loads a byte array into a DaemonStatus struct

type ObjectStats

type ObjectStats struct {
	Blk       BlkStats  `json:"blk"`
	Net       NetStats  `json:"net"`
	Mem       MemStats  `json:"mem"`
	CPU       CPUStats  `json:"cpu"`
	Tasks     uint64    `json:"tasks"`
	CreatedAt time.Time `json:"created_at"`
}

ObjectStats holds an object (ie cgroup) system resource usage metrics

type Stats

type Stats map[string]NodeStatsBundle

Stats is a map of node statistics.

type Status

type Status struct {
	IsCompat bool `json:"is_compat"`
	IsFrozen bool `json:"is_frozen"`
}

type ThreadStats

type ThreadStats struct {
	CPU     CPUStats `json:"cpu"`
	Mem     MemStats `json:"mem"`
	Procs   uint64   `json:"procs"`
	Threads uint64   `json:"threads"`
}

ThreadStats holds a daemon thread system resource usage metrics

Jump to

Keyboard shortcuts

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