status

package
v0.0.0-...-d9a8df2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 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

This section is empty.

Types

type MetricsRecorder

type MetricsRecorder struct {
	// contains filtered or unexported fields
}

MetricsRecorder is used to periodically record the information in a number of metric registries.

Two types of registries are maintained: "node-level" registries, provided by node-level systems, and "store-level" registries which are provided by each store hosted by the node. There are slight differences in the way these are recorded, and they are thus kept separate.

func NewMetricsRecorder

func NewMetricsRecorder(clock *hlc.Clock) *MetricsRecorder

NewMetricsRecorder initializes a new MetricsRecorder object that uses the given clock.

func (*MetricsRecorder) AddNodeRegistry

func (mr *MetricsRecorder) AddNodeRegistry(prefixFmt string, registry *metric.Registry)

AddNodeRegistry adds a node-level registry to this recorder. Each node-level registry has a 'prefix format' which is used to add a prefix to the name of all metrics in that registry while recording (see the metric.Registry object for more information on prefix format strings).

func (*MetricsRecorder) AddStore

func (mr *MetricsRecorder) AddStore(store storeMetrics)

AddStore adds the Registry from the provided store as a store-level registry in this recoder. A reference to the store is kept for the purpose of gathering some additional information which is present in store status summaries. Stores should only be added to the registry after they have been started. TODO(mrtracy): Store references should not be necessary after #4465.

func (*MetricsRecorder) GetStatusSummaries

func (mr *MetricsRecorder) 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. TODO(mrtracy): The status summaries deserve a near-term, significant overhaul. Their primary usage is as an indicator of the most recent metrics of a node or store - they are essentially a "vertical" query of several time series for a single node or store, returning only the most recent value of each series. The structure should be modified to reflect that: there is no reason for them to have a strict schema of fields. (Github Issue #4465)

func (*MetricsRecorder) GetTimeSeriesData

func (mr *MetricsRecorder) GetTimeSeriesData() []ts.TimeSeriesData

GetTimeSeriesData serializes registered metrics for consumption by CockroachDB's time series system.

func (*MetricsRecorder) MarshalJSON

func (mr *MetricsRecorder) MarshalJSON() ([]byte, error)

MarshalJSON returns an appropriate JSON representation of the current values of the metrics being tracked by this recorder.

func (*MetricsRecorder) NodeStarted

func (mr *MetricsRecorder) NodeStarted(desc roachpb.NodeDescriptor, startedAt int64)

NodeStarted should be called on the recorder once the associated node has received its Node ID; this indicates that it is appropriate to begin recording statistics for this node.

type NodeStatus

type NodeStatus struct {
	Desc                 cockroach_roachpb.NodeDescriptor                   `protobuf:"bytes,1,opt,name=desc" json:"desc"`
	StoreIDs             []github_com_cockroachdb_cockroach_roachpb.StoreID `` /* 137-byte string literal not displayed */
	RangeCount           int32                                              `protobuf:"varint,3,opt,name=range_count,json=rangeCount" json:"range_count"`
	StartedAt            int64                                              `protobuf:"varint,4,opt,name=started_at,json=startedAt" json:"started_at"`
	UpdatedAt            int64                                              `protobuf:"varint,5,opt,name=updated_at,json=updatedAt" 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=leaderRangeCount" json:"leader_range_count"`
	ReplicatedRangeCount int32                                              `protobuf:"varint,8,opt,name=replicated_range_count,json=replicatedRangeCount" json:"replicated_range_count"`
	AvailableRangeCount  int32                                              `protobuf:"varint,9,opt,name=available_range_count,json=availableRangeCount" json:"available_range_count"`
}

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

func (*NodeStatus) Descriptor

func (*NodeStatus) Descriptor() ([]byte, []int)

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 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.

Jump to

Keyboard shortcuts

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