Documentation
¶
Overview ¶
Package wireformat defines the format that will be used to send metric batches to the collector and receive updates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvResponse ¶
type EnvResponse struct {
AcknowledgedBatches []string `json:"acks,omitempty"`
UnitStatuses map[string]UnitStatus `json:"unit-statuses,omitempty"`
}
EnvResponse contains the response data relevant to a concrete environment.
type EnvironmentResponses ¶
type EnvironmentResponses map[string]EnvResponse
func (EnvironmentResponses) Ack ¶
func (e EnvironmentResponses) Ack(envUUID, batchUUID string)
Ack adds the specified the batch UUID to the list of acknowledged batches for the specified environment.
func (EnvironmentResponses) SetStatus ¶
func (e EnvironmentResponses) SetStatus(envUUID, unitName, status, info string)
type Metric ¶
type Metric struct {
Key string `json:"key"`
Value string `json:"value"`
Time time.Time `json:"time"`
}
Metric represents a single Metric.
type MetricBatch ¶
type MetricBatch struct {
UUID string `json:"uuid"`
EnvUUID string `json:"env-uuid"`
UnitName string `json:"unit-name"`
CharmUrl string `json:"charm-url"`
Created time.Time `json:"created"`
Metrics []Metric `json:"metrics"`
Credentials []byte `json:"credentials"`
}
MetricBatch is a batch of metrics that will be sent to the metric collector
func ToWire ¶
func ToWire(mb *state.MetricBatch) *MetricBatch
ToWire converts the state.MetricBatch into a type that can be sent over the wire to the collector.
type Response ¶
type Response struct {
UUID string `json:"uuid"`
EnvResponses EnvironmentResponses `json:"env-responses"`
}
Response represents the response from the metrics collector.
type UnitStatus ¶
Click to show internal directories.
Click to hide internal directories.