mon

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const QuotaExceeded = 429

Variables

This section is empty.

Functions

func AsDuration

func AsDuration(str string) time.Duration

func Contains

func Contains(set string, k MetricKind, t ValueType) bool

Returns `true` if either `k` or `t` is contained in the string `set`.

func IngestDelay

func IngestDelay(md *monitoring.MetricDescriptor) time.Duration

func MetricAbbrs

func MetricAbbrs(
	md *monitoring.MetricDescriptor,
) (MetricKind, ValueType, string)

func MetricKindLabel

func MetricKindLabel(md *monitoring.MetricDescriptor) string

func NewCounterVec

func NewCounterVec(
	system, subsys, name, help string, label_keys ...string,
) *prometheus.CounterVec

func NewGaugeVec

func NewGaugeVec(
	system, subsys, name, help string, label_keys ...string,
) *prometheus.GaugeVec

func NewHistVec

func NewHistVec(
	system, subsys, name, help string,
	buckets []float64,
	label_keys ...string,
) *prometheus.HistogramVec

func SamplePeriod

func SamplePeriod(md *monitoring.MetricDescriptor) time.Duration

func SecondsSince

func SecondsSince(start time.Time) float64

Types

type Client

type Client struct {
	*monitoring.Service
}

func MustMonitoringClient

func MustMonitoringClient(gcpClient *http.Client) Client

func (Client) GetLatestTimeSeries

func (m Client) GetLatestTimeSeries(
	ctx context.Context,
	ch chan<- *monitoring.TimeSeries,
	projectID string,
	md *monitoring.MetricDescriptor,
	maxPeriods int,
	maxDuration string,
)

func (Client) GetMetricDescs

func (m Client) GetMetricDescs(
	ctx context.Context,
	ch chan<- *monitoring.MetricDescriptor,
	projectID string,
	prefix string,
)

func (Client) StreamLatestTimeSeries

func (m Client) StreamLatestTimeSeries(
	ctx context.Context,
	projectID string,
	md *monitoring.MetricDescriptor,
	maxPeriods int,
	maxDuration string,
) <-chan *monitoring.TimeSeries

func (Client) StreamMetricDescs

func (m Client) StreamMetricDescs(
	ctx context.Context, projectID, prefix string,
) <-chan *monitoring.MetricDescriptor

type MetricKind

type MetricKind byte
const (
	KCount MetricKind = 'C'
	KDelta MetricKind = 'D'
	KGauge MetricKind = 'G'
)

type ValueType

type ValueType byte
const (
	THist   ValueType = 'H'
	TFloat  ValueType = 'F'
	TInt    ValueType = 'I'
	TBool   ValueType = 'B'
	TString ValueType = 'S'
)

Jump to

Keyboard shortcuts

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