Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseReport ¶
func ParseReport(reportData []byte) (report metrics.MetricReport, err error)
ParseReport parses the given JSON data and returns a metrics.MetricReport, or an error.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is a convenience type that encapsulates a pipeline.Input and a stats.Provider and provides programmatic interfaces similar to those provided by the standalone agent: init, add report, get status, shutdown. Agent is used by the various language-specific SDK implementations contained under this package.
func NewAgent ¶
NewAgent creates a new Agent. The configuration is passed as YAML or JSON in configData. The state directory is passed as stateDir. If stateDir is empty, state will not be persisted.
func (*Agent) AddReport ¶
func (agent *Agent) AddReport(report metrics.MetricReport) error
AddReport adds a new usage report.
func (*Agent) AddReportJson ¶
AddReportJson adds a new usage report after fist unmarshalling it from JSON.
func (*Agent) GetStatus ¶
GetStatus returns a stats.Snapshot object containing current agent status.
func (*Agent) GetStatusJson ¶
GetStatusJson returns a stats.Snapshot object serialized as JSON.