status

package
v0.0.0-...-69190e3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package status is a generated protocol buffer package.

It is generated from these files:

cockroach/pkg/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) AddNode

func (mr *MetricsRecorder) AddNode(
	reg *metric.Registry, desc roachpb.NodeDescriptor, startedAt int64,
)

AddNode adds the Registry from an initialized node, along with its descriptor and start time.

func (*MetricsRecorder) AddStore

func (mr *MetricsRecorder) AddStore(store storeMetrics)

AddStore adds the Registry from the provided store as a store-level registry in this recorder. 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) PrintAsText

func (mr *MetricsRecorder) PrintAsText(w io.Writer) error

PrintAsText writes the current metrics values as plain-text to the writer.

func (*MetricsRecorder) WriteStatusSummary

func (mr *MetricsRecorder) WriteStatusSummary(ctx context.Context, db *client.DB) error

WriteStatusSummary generates a summary and immediately writes it to the given client.

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"`
	Args          []string                         `protobuf:"bytes,7,rep,name=args" json:"args,omitempty"`
	Env           []string                         `protobuf:"bytes,8,rep,name=env" json:"env,omitempty"`
}

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 {

	// Metric gauges maintained by the sampler.
	CgoCalls       *metric.Gauge
	Goroutines     *metric.Gauge
	GoAllocBytes   *metric.Gauge
	GoTotalBytes   *metric.Gauge
	CgoAllocBytes  *metric.Gauge
	CgoTotalBytes  *metric.Gauge
	GcCount        *metric.Gauge
	GcPauseNS      *metric.Gauge
	GcPausePercent *metric.GaugeFloat64
	CPUUserNS      *metric.Gauge
	CPUUserPercent *metric.GaugeFloat64
	CPUSysNS       *metric.Gauge
	CPUSysPercent  *metric.GaugeFloat64
	Rss            *metric.Gauge
	FDOpen         *metric.Gauge
	FDSoftLimit    *metric.Gauge
	Uptime         *metric.Gauge // We use a gauge to be able to call Update.
	BuildTimestamp *metric.Gauge
	// 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) 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