status

package
v0.0.0-...-872dfdc Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0 Imports: 23 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:

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

func (*MetricsRecorder) GetStatusSummary

func (mr *MetricsRecorder) GetStatusSummary() *NodeStatus

GetStatusSummary returns a status summary messages for the node. The summary includes the recent values of metrics for both the node and all of its component stores.

func (*MetricsRecorder) GetTimeSeriesData

func (mr *MetricsRecorder) GetTimeSeriesData() []tspb.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"`
	BuildInfo     cockroach_build.Info             `protobuf:"bytes,2,opt,name=build_info,json=buildInfo" json:"build_info"`
	StartedAt     int64                            `protobuf:"varint,3,opt,name=started_at,json=startedAt" json:"started_at"`
	UpdatedAt     int64                            `protobuf:"varint,4,opt,name=updated_at,json=updatedAt" json:"updated_at"`
	Metrics       map[string]float64               `` /* 136-byte string literal not displayed */
	StoreStatuses []StoreStatus                    `protobuf:"bytes,6,rep,name=store_statuses,json=storeStatuses" json:"store_statuses"`
}

NodeStatus records the most recent values of metrics for 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 RuntimeStatSampler

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

RuntimeStatSampler is used to periodically sample the runtime environment for useful statistics, performing some rudimentary calculations and storing the resulting information in a format that can be easily consumed by status logging systems.

func MakeRuntimeStatSampler

func MakeRuntimeStatSampler(clock *hlc.Clock) RuntimeStatSampler

MakeRuntimeStatSampler constructs a new RuntimeStatSampler object.

func (RuntimeStatSampler) Registry

func (rsr RuntimeStatSampler) Registry() *metric.Registry

Registry returns the metric.Registry object in which the runtime recorder stores its metric gauges.

func (*RuntimeStatSampler) SampleEnvironment

func (rsr *RuntimeStatSampler) SampleEnvironment()

SampleEnvironment queries the runtime system for various interesting metrics, storing the resulting values in the set of metric gauges maintained by RuntimeStatSampler. This makes runtime statistics more convenient for consumption by the time series and status systems.

This method should be called periodically by a higher level system in order to keep runtime statistics current.

type StoreStatus

type StoreStatus struct {
	Desc    cockroach_roachpb.StoreDescriptor `protobuf:"bytes,1,opt,name=desc" json:"desc"`
	Metrics map[string]float64                `` /* 136-byte string literal not displayed */
}

StoreStatus records the most recent values of metrics for a store.

func (*StoreStatus) Descriptor

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

func (*StoreStatus) Marshal

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

func (*StoreStatus) MarshalTo

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

func (*StoreStatus) ProtoMessage

func (*StoreStatus) ProtoMessage()

func (*StoreStatus) Reset

func (m *StoreStatus) Reset()

func (*StoreStatus) Size

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

func (*StoreStatus) String

func (m *StoreStatus) String() string

func (*StoreStatus) Unmarshal

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

Jump to

Keyboard shortcuts

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