Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

API Reference

mbostock edited this page Apr 16, 2012 · 16 revisions

WikiAPI Reference

The Collector is a server that runs (by default) on port 1080.

The Evaluator is a server that runs (by default) on port 1081.

  • /1.0/event/get - query events.
  • /1.0/metric/get - query metrics.
  • /1.0/types/get - query known event types.
  • event.type - the event type (such as "request"); typically singular, of the form /[a-z_][a-zA-Z0-9_]*/.
  • event.time - the event time in ISO 8601 format, UTC.
  • event.data - optional; additional event data to store.
  • event.id - optional; a unique identifier for the event, so it can be updated later.
  • value.time - the metric value time in ISO 8601 format, UTC.
  • value.value - the computed metric value; may be undefined with missing data.
  • value.id - optional; a unique identifier for multiplexing metric requests.
  • metric expression - an expression for computing metric values from grouped events.
  • event expression - a subset of a metric expression for querying events.

Cube stores events in MongoDB. You can access that data directly, if you like.

  • events - a collection for storing events.
  • metrics - a (typically capped) collection for caching computed metrics.

Cube provides a JavaScript WebSockets client for posting events to a collector.

  • cube.emitter - construct a new emitter.
  • emitter.open - connect to the Collector at the specified host and port.
  • emitter.send - send a single event.
  • emitter.close - close the connection, once all events have been sent.
Clone this wiki locally