Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.
Marcel Hecko edited this page Jan 28, 2014 · 53 revisions

Cube is a system for collecting timestamped events and deriving metrics. By collecting events rather than metrics, Cube lets you compute aggregate statistics post hoc. It also enables richer analysis, such as quantiles and histograms of arbitrary event sets. Cube is built on MongoDB and available under the Apache License.

Resources

Contributing

We'd love for you to participate in the development of Cube. Before we can accept your pull request, please sign our Individual Contributor License Agreement. It's a short form that covers our bases and makes sure you're eligible to contribute. Thank you!

Thank You

Cube is built with the following open-source systems and libraries:

For Internal Use Only

Cube is designed for internal use only. Cube does not provide access control, so any data you put into Cube can be queried by anyone that can access your evaluator. You can separate the collector and evaluator, and use a firewall to prevent access to the collector. We may add some type of access control in the future if there is demand for user-facing applications.

Another method of access control is to hide Cube behind a secure, authenticated proxy. Even then, be aware that Cube is not yet hardened against denial-of-service attacks and other malicious requests, and is still in the early stages of development.

Installation (MongoDB, Node, NPM)

Mac OS X

You can install MongoDB, Node.js and NPM like so:

brew update && brew upgrade # optional but recommended
brew install node mongodb npm

Or via Macports

You can install MongoDB, Node.js and NPM like so:

sudo port selfupdate
sudo port install mongodb nodejs npm

Cube is tested against MongoDB 2.0+ and Node 0.8+

Linux

Ubuntu 11.04

sudo apt-get install mongodb mongodb-server

Installation (Cube)

Next you’ll need to install Cube’s node modules.

npm install cube
# OR: git clone https://github.com/square/cube.git
cd cube
npm install

If you're curious, the dependencies are defined in package.json.

Installation on Heroku

Usage

To start Cube:

mkdir -p /usr/local/var/log/cube
node bin/collector.js 2>&1 >> /usr/local/var/log/cube/collector.log &
node bin/evaluator.js 2>&1 >> /usr/local/var/log/cube/evaluator.log &

You can now connect to localhost:1080 for the collector, and localhost:1081 for the evaluator. You can visit http://localhost:1081/ in your browser to see the default dashboard.

If you just want some data in order to play around with the dashboard, run the random data emitter:

node examples/random-emitter/random-emitter.js

You’ll want to ^C the random emitter after a few seconds. You can then reload your dashboard to see the new data.

If your dashboard produces a 404 error, make sure you ran cube precisely as specified. You need to cd to the cube installation directory, otherwise the contents of the static directory are inaccessible.

Production use

Cube can be used in production on streams up to several thousand requests per second (nearly a billion requests per day). Please see the Performance and Scaling notes.

Clone this wiki locally