opencensus

package
v0.0.0-...-44e8350 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package opencensus for the Stackdriver Prometheus collector.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestExporter

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

TestExporter keeps exported metric data in memory to aid in testing the instrumentation.

Metrics can be retrieved with `GetPoint()`. In order to deterministically retrieve the most recent values, you must first invoke `ReadAndExport()`.

func NewTestExporter

func NewTestExporter(metricReader *metricexport.Reader) *TestExporter

NewTestExporter returns a new exporter.

func (*TestExporter) ExportMetrics

func (e *TestExporter) ExportMetrics(ctx context.Context, data []*metricdata.Metric) error

ExportMetrics records the view data.

func (*TestExporter) GetPoint

func (e *TestExporter) GetPoint(metricName string, labels map[string]string) (metricdata.Point, bool)

GetPoint returns the latest point for the time series identified by the given labels.

func (*TestExporter) ReadAndExport

func (e *TestExporter) ReadAndExport()

ReadAndExport reads the current values for all metrics and makes them available to this exporter.

func (*TestExporter) String

func (e *TestExporter) String() string

Jump to

Keyboard shortcuts

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