stackdriver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter allows querying and writing Stackdriver metrics.

func NewAdapter

func NewAdapter(ctx context.Context, lookbackInterval time.Duration) (*Adapter, error)

NewAdapter returns a new Stackdriver adapter.

func (*Adapter) Close

func (a *Adapter) Close() error

Close closes the underlying metric client.

func (*Adapter) CreateTimeseries

func (a *Adapter) CreateTimeseries(ctx context.Context, project, name string, desc *metricpb.MetricDescriptor, series []*monitoringpb.TimeSeries) error

CreateTimeseries writes time series data (new data points) for a given metric into Stackdriver. It also creates a metric descriptor if it does not exist.

func (*Adapter) LatestTimestamp

func (a *Adapter) LatestTimestamp(ctx context.Context, project, name string) (time.Time, error)

LatestTimestamp determines the timestamp of a latest point for a given metric in SD. If metric does not exist, a timestamp which is `lookBackInterval` ago in the past is returned to backfill some data.

type MetricClient

MetricClient defines Stackdriver functions used by the metric adapter.

Jump to

Keyboard shortcuts

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