Documentation ¶
Index ¶
- func InitData()
- type BlkStats
- type CPUStats
- type Cluster
- type Config
- type ConfigListener
- type DaemonCollector
- type DaemonDNS
- type DaemonHb
- type DaemonListener
- type DaemonMonitor
- type DaemonScheduler
- type DaemonSubsystemStatus
- type Data
- 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(namespace string) *Data
- func (s *Data) WithSelector(selector string) *Data
- type DataT
- type Dataer
- type Deamon
- type Frame
- type HbLastMessage
- type HeartbeatPeerStatus
- type HeartbeatStream
- type ListenerThreadClient
- type ListenerThreadSession
- type ListenerThreadSessions
- type ListenerThreadStats
- type ListenerThreadStatusConfig
- type MemStats
- type NetStats
- type NodeStatsBundle
- type Nodes
- type ObjectStats
- type SchedulerThreadEntry
- type Stats
- type Status
- type ThreadAlert
- type ThreadStats
- type Vip
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Config ¶
type Config struct { ID string `json:"id"` Name string `json:"name"` Nodes Nodes `json:"nodes"` DNS []string `json:"dns"` CASecPaths []string `json:"ca_sec_paths"` Listener ConfigListener `json:"listener"` Quorum bool `json:"quorum"` Vip Vip `json:"vip"` // contains filtered or unexported fields }
Config describes the cluster id, name and nodes The cluster name is used as the right most part of cluster dns names.
type ConfigListener ¶
type DaemonCollector ¶
type DaemonCollector struct {
DaemonSubsystemStatus
}
DaemonCollector describes the OpenSVC daemon collector thread, which is responsible for communicating with the collector on behalf of the cluster. Only one node runs a collector thread.
type DaemonDNS ¶
type DaemonDNS struct {
DaemonSubsystemStatus
}
DaemonDNS describes the OpenSVC daemon dns thread, which is responsible for janitoring and serving the cluster DNS zone. This zone is dynamically populated by ip address allocated for the services (frontend and backend).
type DaemonHb ¶
type DaemonHb struct { Streams []HeartbeatStream `json:"streams"` LastMessages []HbLastMessage `json:"last_messages"` }
type DaemonListener ¶
type DaemonListener struct { DaemonSubsystemStatus Config ListenerThreadStatusConfig `json:"config"` Stats ListenerThreadStats `json:"stats"` }
DaemonListener describes the OpenSVC daemon listener thread, which is responsible for serving the API.
type DaemonMonitor ¶
type DaemonMonitor struct {
DaemonSubsystemStatus
}
DaemonMonitor describes the OpenSVC daemon monitor thread state, which is responsible for the node DataSets aggregation and decision-making.
type DaemonScheduler ¶
type DaemonScheduler struct { DaemonSubsystemStatus Delayed []SchedulerThreadEntry `json:"delayed"` }
DaemonScheduler describes the OpenSVC daemon scheduler thread state, which is responsible for executing node and objects scheduled jobs.
type DaemonSubsystemStatus ¶
type DaemonSubsystemStatus struct { ID string `json:"id"` ConfiguredAt time.Time `json:"configured_at"` CreatedAt time.Time `json:"created_at"` State string `json:"state"` Alerts []ThreadAlert `json:"alerts,omitempty"` }
DaemonSubsystemStatus describes a OpenSVC daemon subsystem: when it was last configured, when it was created, its current state and its id.
type Data ¶
Data describes the full Cluster state.
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 purges the dataset from objects not matching the namespace
func (*Data) WithSelector ¶
WithSelector purges the dataset from objects not matching the selector expression
type Deamon ¶
type Deamon struct { Collector DaemonCollector `json:"collector"` DNS DaemonDNS `json:"dns"` Hb DaemonHb `json:"hb"` Listener DaemonListener `json:"listener"` Monitor DaemonMonitor `json:"monitor"` Nodename string `json:"nodename"` Routines int `json:"routines"` Scheduler DaemonScheduler `json:"scheduler"` }
type Frame ¶
type Frame struct { Selector string Nodes []string Sections []string Current Data Previous Data Stats Stats // contains filtered or unexported fields }
Frame exposes daemon status renderer tunables.
type HbLastMessage ¶
type HeartbeatPeerStatus ¶
type HeartbeatPeerStatus struct { IsBeating bool `json:"is_beating"` LastAt time.Time `json:"last_at"` }
HeartbeatPeerStatus describes the status of the communication with a specific peer node.
type HeartbeatStream ¶
type HeartbeatStream struct { DaemonSubsystemStatus // Type is the heartbeat type example: unicast, ... Type string `json:"type"` Peers map[string]HeartbeatPeerStatus `json:"peers"` }
HeartbeatStream describes one OpenSVC daemon heartbeat thread, which is responsible for sending or receiving the node DataSet changes to or from peer nodes.
type ListenerThreadClient ¶
type ListenerThreadClient struct { Accepted uint64 `json:"accepted"` AuthValidated uint64 `json:"auth_validated"` RX uint64 `json:"rx"` TX uint64 `json:"tx"` }
ListenerThreadClient describes the statistics of all session of a single client the api listener.
type ListenerThreadSession ¶
type ListenerThreadSession struct { Addr string `json:"addr"` CreatedAt time.Time `json:"created_at"` Encrypted bool `json:"encrypted"` Progress string `json:"progress"` TID uint64 `json:"tid"` }
ListenerThreadSession describes statistics of a session of the api listener.
type ListenerThreadSessions ¶
type ListenerThreadSessions struct { Accepted uint64 `json:"accepted"` AuthValidated uint64 `json:"auth_validated"` RX uint64 `json:"rx"` TX uint64 `json:"tx"` Alive map[string]ListenerThreadSession `json:"alive"` Clients map[string]ListenerThreadClient `json:"clients"` }
ListenerThreadSessions describes the sessions statistics of the api listener.
type ListenerThreadStats ¶
type ListenerThreadStats struct {
Sessions ListenerThreadSessions `json:"sessions"`
}
ListenerThreadStats describes the statistics of the api listener.
type ListenerThreadStatusConfig ¶
ListenerThreadStatusConfig holds a summary of the listener configuration
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 objet 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 SchedulerThreadEntry ¶
type SchedulerThreadEntry struct { Action string `json:"action"` Csum string `json:"csum"` Path string `json:"path"` ExpireAt time.Time `json:"expire_at"` QueuedAt time.Time `json:"queued_at"` Rid string `json:"rid"` }
SchedulerThreadEntry describes a task queued for execution by the opensvc scheduler thread.
type ThreadAlert ¶
ThreadAlert describes a message with a severity. Embedded in DaemonSubsystemStatus
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
type Vip ¶
type Vip struct { // Default is the default vip configuration value, must be not zero to // enable cluster vip Default string `json:"default"` // Addr is the default vip addr Addr string `json:"name"` // Netmask is the default vip netmask Netmask string `json:"netmask"` // Dev is the default vip device Dev string `json:"dev"` // Devs is a map of node names to custom vip device (when // the device for node name is not equal to default vip device) Devs map[string]string `json:"devs"` }
Vip struct describes cluster vip settings