messages

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flatten

func Flatten(labels map[string]string) string

Flatten serializes a set of label keys and values.

Types

type Log

type Log struct {
	Payload  interface{}
	Labels   map[string]string
	Severity logging.Severity
}

type Metric

type Metric struct {
	Name      string
	Labels    map[string]string `json:"-"`
	Value     float64
	IntValue  int64
	EventTime time.Time
	StartTime time.Time                 `json:"-"`
	Unit      string                    // TODO Should this be "1" if it's empty?
	Type      events.Envelope_EventType `json:"-"`
}

Metric represents one of the metrics contained in an events.Envelope.

func (*Metric) Hash

func (m *Metric) Hash() string

func (*Metric) IsCumulative

func (m *Metric) IsCumulative() bool

func (*Metric) MetricDescriptor

func (m *Metric) MetricDescriptor(projectName string) *metric.MetricDescriptor

MetricDescriptor returns a Stackdriver MetricDescriptor proto for this metric.

func (*Metric) NeedsMetricDescriptor

func (m *Metric) NeedsMetricDescriptor() bool

NeedsMetricDescriptor determines whether a custom metric descriptor needs to be created for this metric in Stackdriver. We do that if we need to set a custom unit, or mark metric as a cumulative.

func (*Metric) TimeSeries

func (m *Metric) TimeSeries() *monitoring.TimeSeries

TimeSeries returns a Stackdriver TimeSeries proto for this metric value.

Jump to

Keyboard shortcuts

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