Documentation ¶
Index ¶
Constants ¶
const DEFAULT_CFG_SAMPLE_INTERVAL_SECS = 60
const DEFAULT_DIAG_SAMPLE_INTERVAL_SECS = 60
const DEFAULT_STATS_SAMPLE_INTERVAL_SECS = 1
Variables ¶
This section is empty.
Functions ¶
func SameNodeDefs ¶
Types ¶
type MonitorCluster ¶
type MonitorCluster struct {
// contains filtered or unexported fields
}
A MonitorCluster struct holds all the tracking information for the StartMonitorCluster operation.
func StartMonitorCluster ¶
func StartMonitorCluster( seedURLs []string, sampleCh chan MonitorSample, options MonitorClusterOptions, ) (*MonitorCluster, error)
StartMonitorCluster begins monitoring a cbgt cluster (as defined by a REST /api/cfg endpoint), including the handling of node membership changes.
TODO: Allow a monitoring of other MonitorCluster's in a hierarchy to support the scaling out to large number of cbgt nodes.
func (*MonitorCluster) Stop ¶
func (m *MonitorCluster) Stop()
type MonitorClusterOptions ¶
type MonitorNodes ¶
type MonitorNodes struct {
// contains filtered or unexported fields
}
A MonitorNodes struct holds all the tracking information for the StartMonitorNodes operation.
func StartMonitorNodes ¶
func StartMonitorNodes( urlUUIDs []UrlUUID, sampleCh chan MonitorSample, options MonitorNodesOptions, ) (*MonitorNodes, error)
StartMonitorNodes begins REST stats and diag sampling from a fixed set of cbgt nodes. Higher level parts (like StartMonitorCluster) should handle situations of node membership changes by stopping and restarting StartMonitorNodes() as needed.
The cbgt REST URL endpoints that are monitored are [url]/api/stats and [url]/api/diag.
func (*MonitorNodes) Stop ¶
func (m *MonitorNodes) Stop()
type MonitorNodesOptions ¶
type MonitorNodesOptions struct { StatsSampleInterval time.Duration // Ex: 1 * time.Second. StatsSampleDisable bool DiagSampleInterval time.Duration DiagSampleDisable bool // Optional, defaults to http.Get(); this is used, for example, // for unit testing. HttpGet func(url string) (resp *http.Response, err error) }
type MonitorSample ¶
type MonitorSample struct { Kind string // Ex: "/api/cfg", "/api/stats", "/api/diag". Url string // Ex: "http://10.0.0.1:8095". UUID string Start time.Time // When we started to get this sample. Duration time.Duration // How long it took to get this sample. Error error Data []byte }
MonitorSample represents the information collected during monitoring and sampling a node.