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 17, 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.

Time-stamped events are how you get data into Cube.

  • event.type - a name for grouping related events (such as "request").
  • event.time - the event time in ISO 8601 format, UTC.
  • event.id - an optional unique identifier for replacing events.
  • event.data - an optional JSON blob for storing additional data with events.

Metrics are how you analyze events; group and reduce.

  • metric.time - the metric value time in ISO 8601 format, UTC.
  • metric.value - the computed metric value; may be undefined with missing data.
  • metric.id - optional; a unique identifier for multiplexing metric requests.

The evaluator supports two different types of queries for finding events and computing 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.
  • cube_request - a built-in event that records requests sent to Cube's endpoints.
  • cube_compute - a built-in event that records information about Cube's work computing metric.
Clone this wiki locally