README

GoDoc

golang.org/x/build/cmd/coordinator/metrics

Package metrics enumerates the set of Stackdriver metrics used by the Go build system.

Documentation

Overview

Package metrics enumerates the set of Stackdriver metrics used by the Go build system.

Index

Constants

This section is empty.

Variables

View Source
var Metrics = []*Metric{
	ReverseCount,
}

Metrics is the set of all Stackdriver metrics being used to monitor the Go build system.

View Source
var ReverseCount = &Metric{
	Name: "reverse/count",
	Descriptor: &metpb.MetricDescriptor{
		Type: "custom.googleapis.com/reverse/count",
		Labels: []*label.LabelDescriptor{
			{
				Key:       "hosttype",
				ValueType: label.LabelDescriptor_STRING,
			},
		},
		MetricKind: metpb.MetricDescriptor_GAUGE,
		ValueType:  metpb.MetricDescriptor_INT64,
	},
}

ReverseCount is the Stackdriver metric for monitoring the number of reverse buildlets up at any given moment.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Name       string
	Descriptor *metpb.MetricDescriptor
}

Metric defines a custom metric type used by Go build system.

func (*Metric) DescriptorPath

func (m *Metric) DescriptorPath(project string) string

DescriptorPath returns the unique path for this metric among all GCP resources in all projects. See cloud.google.com/monitoring/custom-metrics/creating-metrics for details.

func (*Metric) Labels

func (m *Metric) Labels(labels ...string) (map[string]string, error)

Labels populates the set of labels with the given label values. The labels should be passed in the same order as defined in the metric descriptor. All labels listed in the Descriptor must be assigned values.

func (*Metric) TypedValue

func (m *Metric) TypedValue(v interface{}) (*monpb.TypedValue, error)

TypedValue returns the cooresponding *monpb.TypedValue based on the metric descriptor's value type.

Source Files