Documentation
¶
Index ¶
- type BlkStats
- type CPUStats
- type Cluster
- type Data
- func (s *Data) ArbitratorNames() []string
- func (s *Data) DeepCopy() *Data
- func (s *Data) GetNodeData(nodename string) *node.Node
- func (s *Data) GetNodeStatus(nodename string) *node.Status
- func (s *Data) GetObjectStatus(p naming.Path) object.Digest
- func (s *Data) ObjectPaths() naming.Paths
- func (s *Data) WithNamespace(namespaces ...string) *Data
- func (s *Data) WithSelector(selector string) *Data
- type MemStats
- type NetStats
- type NodeStatsBundle
- type ObjectStats
- type Stats
- type Status
- type ThreadStats
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 Data ¶
type Data struct {
Cluster Cluster `json:"cluster"`
Daemon daemonsubsystem.DaemonLocal `json:"daemon"`
}
Data describes the full Cluster state.
func NewData ¶
NewData initializes a new Data instance with an empty cluster and daemon specific to the provided nodename.
func (*Data) ArbitratorNames ¶
func (*Data) DeepCopy ¶
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 ¶
GetNodeData extracts from the cluster dataset all information relative to node data.
func (*Data) GetNodeStatus ¶
GetNodeStatus extracts from the cluster dataset all information relative to node status.
func (*Data) GetObjectStatus ¶
GetObjectStatus extracts from the cluster dataset all information relative to an object.
func (*Data) ObjectPaths ¶
func (*Data) WithNamespace ¶
WithNamespace returns a view of the dataset without the objects not matching the namespaces. The receiver is not modified, see filter.
func (*Data) WithSelector ¶
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