Adding reports for workers

When writing a new worker, or dealing with an older worker, please consider adding a Report method.

// Reporter defines an interface for extracting human-relevant information
// from a worker.
type Reporter interface {

	// Report returns a map describing the state of the receiver. It is expected
	// to be goroutine-safe.
	//
	// It is polite and helpful to use the Key* constants and conventions defined
	// and described in this package, where appropriate, but that's for the
	// convenience of the humans that read the reports; we don't and shouldn't
	// have any code that depends on particular Report formats.
	Report() map[string]interface{}
}

If the worker supports a Report method, it will be added to the juju_engine_report introspection method.

The method should be:

  • fast
  • goroutine safe

See the apiaddresser for an example.