status

package
v0.0.0-...-ae2807b Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package status is a generated protocol buffer package.

It is generated from these files:

cockroach/server/status/status.proto

It has these top-level messages:

NodeStatus

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthStatus = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStatus   = fmt.Errorf("proto: integer overflow")
)

Functions

func ProcessNodeEvent

func ProcessNodeEvent(l NodeEventListener, event interface{})

ProcessNodeEvent dispatches an event on the NodeEventListener.

Types

type CallErrorEvent

type CallErrorEvent struct {
	NodeID   roachpb.NodeID
	Method   roachpb.Method
	Duration time.Duration
}

CallErrorEvent is published when a call to a node returns an error.

func (CallErrorEvent) String

func (e CallErrorEvent) String() string

String implements fmt.Stringer.

type CallSuccessEvent

type CallSuccessEvent struct {
	NodeID   roachpb.NodeID
	Method   roachpb.Method
	Duration time.Duration
}

CallSuccessEvent is published when a call to a node completes without error.

func (CallSuccessEvent) String

func (e CallSuccessEvent) String() string

String implements fmt.Stringer.

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 roachpb.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(ba roachpb.BatchRequest, d time.Duration, pErr *roachpb.Error)

CallComplete is called by a node whenever it completes a request. This will publish appropriate events to the feed: - For a successful request, a corresponding event for each request in the batch, - on error without index information, a failure of the Batch, and - on an indexed error a failure of the individual request.

func (NodeEventFeed) StartNode

func (nef NodeEventFeed) StartNode(desc roachpb.NodeDescriptor, startedAt int64)

StartNode is called by a node when it has started.

type NodeEventListener

type NodeEventListener interface {
	OnStartNode(event *StartNodeEvent)
	OnCallSuccess(event *CallSuccessEvent)
	OnCallError(event *CallErrorEvent)
	// TODO(tschottdorf): break this out into a TraceEventListener.
	OnTrace(event *tracer.Trace)
}

NodeEventListener is an interface that can be implemented by objects which listen for events published by nodes.

type NodeStatus

type NodeStatus struct {
	Desc                 cockroach_roachpb.NodeDescriptor                   `protobuf:"bytes,1,opt,name=desc" json:"desc"`
	StoreIDs             []github_com_cockroachdb_cockroach_roachpb.StoreID `protobuf:"varint,2,rep,name=store_ids,casttype=github.com/cockroachdb/cockroach/roachpb.StoreID" json:"store_ids,omitempty"`
	RangeCount           int32                                              `protobuf:"varint,3,opt,name=range_count" json:"range_count"`
	StartedAt            int64                                              `protobuf:"varint,4,opt,name=started_at" json:"started_at"`
	UpdatedAt            int64                                              `protobuf:"varint,5,opt,name=updated_at" json:"updated_at"`
	Stats                cockroach_storage_engine.MVCCStats                 `protobuf:"bytes,6,opt,name=stats" json:"stats"`
	LeaderRangeCount     int32                                              `protobuf:"varint,7,opt,name=leader_range_count" json:"leader_range_count"`
	ReplicatedRangeCount int32                                              `protobuf:"varint,8,opt,name=replicated_range_count" json:"replicated_range_count"`
	AvailableRangeCount  int32                                              `protobuf:"varint,9,opt,name=available_range_count" json:"available_range_count"`
}

NodeStatus contains the stats needed to calculate the current status of a node.

func (*NodeStatus) Marshal

func (m *NodeStatus) Marshal() (data []byte, err error)

func (*NodeStatus) MarshalTo

func (m *NodeStatus) MarshalTo(data []byte) (int, error)

func (*NodeStatus) ProtoMessage

func (*NodeStatus) ProtoMessage()

func (*NodeStatus) Reset

func (m *NodeStatus) Reset()

func (*NodeStatus) Size

func (m *NodeStatus) Size() (n int)

func (*NodeStatus) String

func (m *NodeStatus) String() string

func (*NodeStatus) Unmarshal

func (m *NodeStatus) Unmarshal(data []byte) error

type NodeStatusMonitor

type NodeStatusMonitor struct {
	sync.RWMutex // Mutex to guard the following fields
	// contains filtered or unexported fields
}

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(metaRegistry *metric.Registry) *NodeStatusMonitor

NewNodeStatusMonitor initializes a new NodeStatusMonitor instance.

func (*NodeStatusMonitor) GetStoreMonitor

func (nsm *NodeStatusMonitor) GetStoreMonitor(id roachpb.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 a storage event subscription. This method is part of the implementation of store.StoreEventListener. TODO(mrtracy): We have clearly moved away from the model of having multiple range-data listeners. This event should be removed from the feeds, as well as this monitor.

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 a 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 a 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 a storage event subscription. This method is part of the implementation of store.StoreEventListener.

func (*NodeStatusMonitor) OnReplicationStatus

func (nsm *NodeStatusMonitor) OnReplicationStatus(event *storage.ReplicationStatusEvent)

OnReplicationStatus receives ReplicationStatusEvents retrieved from a 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 a storage event subscription. This method is part of the implementation of store.StoreEventListener.

func (*NodeStatusMonitor) OnStartNode

func (nsm *NodeStatusMonitor) OnStartNode(event *StartNodeEvent)

OnStartNode receives StartNodeEvents from a node event subscription. This method is part of the implementation of NodeEventListener.

func (*NodeStatusMonitor) OnStartStore

func (nsm *NodeStatusMonitor) OnStartStore(event *storage.StartStoreEvent)

OnStartStore receives StartStoreEvents retrieved from a storage event subscription. This method is part of the implementation of store.StoreEventListener.

func (*NodeStatusMonitor) OnStoreStatus

func (nsm *NodeStatusMonitor) OnStoreStatus(event *storage.StoreStatusEvent)

OnStoreStatus receives StoreStatusEvents retrieved from a storage event subscription. This method is part of the implementation of store.StoreEventListener.

func (*NodeStatusMonitor) OnTrace

func (nsm *NodeStatusMonitor) OnTrace(trace *tracer.Trace)

OnTrace receives Trace objects from a node event subscription. This method is part of the implementation of NodeEventListener.

func (*NodeStatusMonitor) OnUpdateRange

func (nsm *NodeStatusMonitor) OnUpdateRange(event *storage.UpdateRangeEvent)

OnUpdateRange receives UpdateRangeEvents retrieved from a storage event subscription. This method is part of the implementation of store.StoreEventListener.

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.

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) GetStatusSummaries

func (nsr *NodeStatusRecorder) GetStatusSummaries() (*NodeStatus, []storage.StoreStatus)

GetStatusSummaries returns a status summary messages for the node, along with a status summary for every individual store within the node.

func (*NodeStatusRecorder) GetTimeSeriesData

func (nsr *NodeStatusRecorder) GetTimeSeriesData() []ts.TimeSeriesData

GetTimeSeriesData returns a slice of interesting TimeSeriesData from the encapsulated NodeStatusMonitor.

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 roachpb.NodeID, clock *hlc.Clock) *RuntimeStatRecorder

NewRuntimeStatRecorder instantiates a runtime status recorder for the supplied node ID.

func (*RuntimeStatRecorder) GetTimeSeriesData

func (rsr *RuntimeStatRecorder) GetTimeSeriesData() []ts.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.

TODO(tschottdorf): turn various things here into gauges and register them with the metrics registry.

type StartNodeEvent

type StartNodeEvent struct {
	Desc      roachpb.NodeDescriptor
	StartedAt int64
}

StartNodeEvent is published when a node is started.

func (StartNodeEvent) String

func (e StartNodeEvent) String() string

String implements fmt.Stringer.

type StoreStatusMonitor

type StoreStatusMonitor struct {
	sync.Mutex // Mutex to guard the following fields

	ID roachpb.StoreID
	// contains filtered or unexported fields
}

StoreStatusMonitor monitors the status of a single store on the server. Status information is collected from event feeds provided by lower level components.

func NewStoreStatusMonitor

func NewStoreStatusMonitor(id roachpb.StoreID, metaRegistry *metric.Registry) *StoreStatusMonitor

NewStoreStatusMonitor constructs a StoreStatusMonitor with the given ID.

Jump to

Keyboard shortcuts

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