Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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) IsCumulative ¶
func (*Metric) MetricDescriptor ¶
func (m *Metric) MetricDescriptor(projectName string) *metric.MetricDescriptor
MetricDescriptor returns a Stackdriver MetricDescriptor proto for this metric.
func (*Metric) NeedsMetricDescriptor ¶
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.
Click to show internal directories.
Click to hide internal directories.