Documentation
¶
Overview ¶
Package status defines the data types of cluster-wide and per-node status responses.
Index ¶
- func ProcessNodeEvents(l NodeEventListener, sub *util.Subscription)
- type CallErrorEvent
- type CallSuccessEvent
- type Cluster
- type Node
- type NodeEventFeed
- type NodeEventListener
- type NodeList
- type NodeStatusMonitor
- func (nsm *NodeStatusMonitor) GetStoreMonitor(id proto.StoreID) *StoreStatusMonitor
- func (nsm *NodeStatusMonitor) OnBeginScanRanges(event *storage.BeginScanRangesEvent)
- func (nsm *NodeStatusMonitor) OnCallError(event *CallErrorEvent)
- func (nsm *NodeStatusMonitor) OnCallSuccess(event *CallSuccessEvent)
- func (nsm *NodeStatusMonitor) OnEndScanRanges(event *storage.EndScanRangesEvent)
- func (nsm *NodeStatusMonitor) OnMergeRange(event *storage.MergeRangeEvent)
- func (nsm *NodeStatusMonitor) OnRegisterRange(event *storage.RegisterRangeEvent)
- func (nsm *NodeStatusMonitor) OnRemoveRange(event *storage.RemoveRangeEvent)
- func (nsm *NodeStatusMonitor) OnSplitRange(event *storage.SplitRangeEvent)
- func (nsm *NodeStatusMonitor) OnStartStore(event *storage.StartStoreEvent)
- func (nsm *NodeStatusMonitor) OnUpdateRange(event *storage.UpdateRangeEvent)
- func (nsm *NodeStatusMonitor) SetNodeID(id proto.NodeID)
- func (nsm *NodeStatusMonitor) StartMonitorFeed(feed *util.Feed)
- func (nsm *NodeStatusMonitor) VisitStoreMonitors(visitor func(*StoreStatusMonitor))
- type NodeStatusRecorder
- type NodeSummary
- type RuntimeStatRecorder
- type StoreStatusMonitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessNodeEvents ¶
func ProcessNodeEvents(l NodeEventListener, sub *util.Subscription)
ProcessNodeEvents reads node events from the supplied channel and passes them to the correct methods of the supplied NodeEventListener. This method will run until the Subscription's events channel is closed.
Types ¶
type CallErrorEvent ¶
CallErrorEvent is published when a call to a node returns an error.
type CallSuccessEvent ¶
CallSuccessEvent is published when a call to a node completes without error.
type NodeEventFeed ¶
type NodeEventFeed struct {
// contains filtered or unexported fields
}
NodeEventFeed is a helper structure which publishes node-specific events to a util.Feed. If the target feed is nil, event methods become no-ops.
func NewNodeEventFeed ¶
func NewNodeEventFeed(id proto.NodeID, feed *util.Feed) NodeEventFeed
NewNodeEventFeed creates a new NodeEventFeed which publishes events for a specific node to the supplied feed.
func (NodeEventFeed) CallComplete ¶
func (nef NodeEventFeed) CallComplete(args proto.Request, reply proto.Response)
CallComplete is called by a node whenever it completes a request. This will publish an appropriate event to the feed based on the results of the call.
type NodeEventListener ¶
type NodeEventListener interface { OnCallSuccess(event *CallSuccessEvent) OnCallError(event *CallErrorEvent) }
NodeEventListener is an interface that can be implemented by objects which listen for events published by nodes.
type NodeList ¶
type NodeList struct {
Nodes []NodeSummary `json:"nodes"`
}
NodeList contains a slice of summaries for each Node.
type NodeStatusMonitor ¶
NodeStatusMonitor monitors the status of a server node. Status information is collected from event feeds provided by lower level components.
This structure contains collections of other StatusMonitor types which monitor interesting subsets of data on the node. NodeStatusMonitor is responsible for passing event feed data to these subset structures for accumulation.
func NewNodeStatusMonitor ¶
func NewNodeStatusMonitor() *NodeStatusMonitor
NewNodeStatusMonitor initializes a new NodeStatusMonitor instance.
func (*NodeStatusMonitor) GetStoreMonitor ¶
func (nsm *NodeStatusMonitor) GetStoreMonitor(id proto.StoreID) *StoreStatusMonitor
GetStoreMonitor is a helper method which retrieves the StoreStatusMonitor for the given StoreID, creating it if it does not already exist.
func (*NodeStatusMonitor) OnBeginScanRanges ¶
func (nsm *NodeStatusMonitor) OnBeginScanRanges(event *storage.BeginScanRangesEvent)
OnBeginScanRanges receives BeginScanRangesEvents retrieved from an storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) OnCallError ¶
func (nsm *NodeStatusMonitor) OnCallError(event *CallErrorEvent)
OnCallError receives CallErrorEvents from a node event subscription. This method is part of the implementation of NodeEventListener.
func (*NodeStatusMonitor) OnCallSuccess ¶
func (nsm *NodeStatusMonitor) OnCallSuccess(event *CallSuccessEvent)
OnCallSuccess receives CallSuccessEvents from a node event subscription. This method is part of the implementation of NodeEventListener.
func (*NodeStatusMonitor) OnEndScanRanges ¶
func (nsm *NodeStatusMonitor) OnEndScanRanges(event *storage.EndScanRangesEvent)
OnEndScanRanges receives EndScanRangesEvents retrieved from an storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) OnMergeRange ¶
func (nsm *NodeStatusMonitor) OnMergeRange(event *storage.MergeRangeEvent)
OnMergeRange receives MergeRangeEvents retrieved from an storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) OnRegisterRange ¶
func (nsm *NodeStatusMonitor) OnRegisterRange(event *storage.RegisterRangeEvent)
OnRegisterRange receives RegisterRangeEvents retrieved from a storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) OnRemoveRange ¶
func (nsm *NodeStatusMonitor) OnRemoveRange(event *storage.RemoveRangeEvent)
OnRemoveRange receives RemoveRangeEvents retrieved from an storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) OnSplitRange ¶
func (nsm *NodeStatusMonitor) OnSplitRange(event *storage.SplitRangeEvent)
OnSplitRange receives SplitRangeEvents retrieved from an storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) OnStartStore ¶
func (nsm *NodeStatusMonitor) OnStartStore(event *storage.StartStoreEvent)
OnStartStore receives StartStoreEvents retrieved from an storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) OnUpdateRange ¶
func (nsm *NodeStatusMonitor) OnUpdateRange(event *storage.UpdateRangeEvent)
OnUpdateRange receives UpdateRangeEvents retrieved from an storage event subscription. This method is part of the implementation of store.StoreEventListener.
func (*NodeStatusMonitor) SetNodeID ¶
func (nsm *NodeStatusMonitor) SetNodeID(id proto.NodeID)
SetNodeID sets the NodeID for the node being monitored.
func (*NodeStatusMonitor) StartMonitorFeed ¶
func (nsm *NodeStatusMonitor) StartMonitorFeed(feed *util.Feed)
StartMonitorFeed starts a goroutine which processes events published to the supplied Subscription. The goroutine will continue running until the Subscription's Events feed is closed.
func (*NodeStatusMonitor) VisitStoreMonitors ¶
func (nsm *NodeStatusMonitor) VisitStoreMonitors(visitor func(*StoreStatusMonitor))
VisitStoreMonitors calls the supplied visitor function with every StoreStatusMonitor currently in this monitor's collection. A lock is taken on each StoreStatusMonitor before it is passed to the visitor function.
type NodeStatusRecorder ¶
type NodeStatusRecorder struct { *NodeStatusMonitor // contains filtered or unexported fields }
NodeStatusRecorder is used to periodically persist the status of a node as a set of time series data.
func NewNodeStatusRecorder ¶
func NewNodeStatusRecorder(monitor *NodeStatusMonitor, clock *hlc.Clock) *NodeStatusRecorder
NewNodeStatusRecorder instantiates a recorder for the supplied monitor.
func (*NodeStatusRecorder) GetTimeSeriesData ¶
func (nsr *NodeStatusRecorder) GetTimeSeriesData() []proto.TimeSeriesData
GetTimeSeriesData returns a slice of interesting TimeSeriesData from the encapsulated NodeStatusMonitor.
type NodeSummary ¶
A NodeSummary contains a summary for a particular node.
type RuntimeStatRecorder ¶
type RuntimeStatRecorder struct {
// contains filtered or unexported fields
}
RuntimeStatRecorder is used to periodically persist useful runtime statistics as time series data. "Runtime statistics" include OS-level statistics (such as memory and CPU usage) and Go runtime statistics (e.g. count of Goroutines).
func NewRuntimeStatRecorder ¶
func NewRuntimeStatRecorder(nodeID proto.NodeID, clock *hlc.Clock) *RuntimeStatRecorder
NewRuntimeStatRecorder instantiates a runtime status recorder for the supplied node ID.
func (*RuntimeStatRecorder) GetTimeSeriesData ¶
func (rsr *RuntimeStatRecorder) GetTimeSeriesData() []proto.TimeSeriesData
GetTimeSeriesData returns a slice of TimeSeriesData updates based on current runtime statistics.
Calling this method will query various system packages for runtime statistics and convert the information to time series data. This is currently done in one method because it is convenient; however, in the future querying and recording can be easily separated, similar to the way that NodeStatus is separated into a monitor and a recorder.
type StoreStatusMonitor ¶
StoreStatusMonitor monitors the status of a single store on the server. Status information is collected from event feeds provided by lower level components.