metrics

package
v0.0.0-...-16694d9 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Go Reference

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.

Jump to

Keyboard shortcuts

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