1234567891011121314151617181920212223242526272829303132 |
- package report
- import "time"
- // MetricRow is a tuple of data used to render a metric as a sparkline and
- // accoutrements.
- type MetricRow struct {
- ID string `json:"id"`
- Label string `json:"label"`
- Format string `json:"format"`
- Group string `json:"group"`
- Value float64 `json:"value"`
- ValueEmpty bool `json:"value_empty"`
- Priority float64 `json:"priority"`
- URL string `json:"url"`
- // Metric *Metric
- Metric
- }
- // Metric is a list of timeseries data with some metadata. Clients must use the
- // Add method to add values. Metrics are immutable.
- type Metric struct {
- Samples []Sample `json:"samples,omitempty"`
- Min float64 `json:"min"`
- Max float64 `json:"max"`
- }
- // Sample is a single datapoint of a metric.
- type Sample struct {
- Timestamp time.Time `json:"date"`
- Value float64 `json:"value"`
- }
|