Documentation ¶
Index ¶
Constants ¶
const ( IntType = "int" DoubleType = "double" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definition ¶
Definition describes a single reportable metric's name and type.
func (*Definition) Validate ¶
func (m *Definition) Validate() error
type MetricReport ¶
type MetricReport struct { Name string `json:"name"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` Labels map[string]string `json:"labels"` Value MetricValue `json:"value"` }
MetricReport represents an aggregated interval for a unique metric + labels combination.
func (MetricReport) Copy ¶
func (mr MetricReport) Copy() MetricReport
Copy returns a deep copy of the MetricReport
func (MetricReport) Equal ¶
func (mr MetricReport) Equal(other MetricReport) bool
Equal returns if the two MetricReports are the same.
func (MetricReport) Validate ¶
func (mr MetricReport) Validate(def Definition) error
Validate returns an error if the report does not match its definition.
type MetricValue ¶
type MetricValue struct { Int64Value *int64 `json:"int64Value,omitempty"` DoubleValue *float64 `json:"doubleValue,omitempty"` }
MetricValue holds a single named metric value. Only one of the individual type fields should be non-nil.
func (MetricValue) Validate ¶
func (mv MetricValue) Validate(def Definition) error
Validate returns an error if the metric value does not match its definition.
type StampedMetricReport ¶
type StampedMetricReport struct { MetricReport `json:",inline"` Id string }
StampedMetricReport is a MetricReport stamped with a unique identifier.
func NewStampedMetricReport ¶
func NewStampedMetricReport(report MetricReport) StampedMetricReport
NewStampedMetricReport creates a new StampedMetricReport with a random, unique identifier.
func (StampedMetricReport) Equal ¶
func (smr StampedMetricReport) Equal(other StampedMetricReport) bool
Equal returns if the two StampedMetricReports are the same.