Allowing mongodb authentication
Making auth/no-auth callback handling a little better
Merge branch 'master' into mongo-auth
Log the URL's query string, too.
Serialize metric computation.

Now when multiple requests for the same metrics are received concurrently, only
the first request will do actual work, and the other requests will return the
cached results.

This commit required two non-backwards-compatible changes. It removes group
query support (which was only partially supported, and could crash the server by
running out of memory), and the metrics WebSocket endpoint now emits `null` when
the last metric is reported. This makes it easier for clients to detect when all
metrics are available.

In the future, I'd like to reconsider grouped queries, perhaps by providing a
new endpoint that returns metadata about events. For example, it could query
events and return the cardinality of different properties, or the top values.
Given the metadata, the client could then generate the desired queries and
choose the appropriate visualizations.
Detect collectd's high-resolution time format.

There was a brief interval during which collectd used the high-resolution time
format in conjunction with JSON. That is no longer the case. To support both
versions, we must now guess which format collectd is using. If the specified
date is more than ~31.7 years in the future (1e12 milliseconds), then the date
is assumed to be high-resolution and divided by 1073741824. Otherwise, the date
is assumed to be in seconds since UNIX epoch.
Merge branch 'mongo-auth' of https://github.com/mrkurt/cube into 0.2.0
Minor cleanup to authentication code.
Process task queue in FIFO order.

The previous implementation was LIFO, which meant that frequent small requests
could easily stall rare longer requests. I still plan on changing the queue so
that only metrics for the same unary expression are serialized.
Serialize unary expressions by event type.

Rather than serialize all expressions, only serialize unary expressions of the
same event type. This allows expressions on different event types to proceed in
parallel, hopefully improving performance while still avoiding redundant computation.
Add some simple metrics.

You can now query /1.0.info to get some basic metrics from Cube and diagnose
what's going on internally. For example, you can see the number of metrics that
have been computed by event type and metric tier, and then compare that to the
number of metrics that were cached.
Invalidate metrics with greater precision.

Previously, the collector would track the minimum and maximum time for events
received over five seconds. Any metrics between these two times would be
invalidated. While simple, this approach has unfortunate behavior: a single
outlier event (say, from a year ago) that arrives concurrently with a current
event will wipe out all computed metrics! Now we track exactly which metric
intervals are affected by incoming events, and only invalidate those.
Fix a bug with incorrect stat recording.

Pyramidal metrics are computed recursively, so we were incorrectly attributing
computed metrics to the outermost tier, rather than the innermost tier.
Automatically reconnect on close or error.

Emitters will now retry automatically when an error occurs.
Revert to websocket 1.0.3 (pure JavaScript).
Fix #31 - Create collections automatically.

By choosing some reasonable defaults, we can allow Cube to create collections
for both events and metrics automatically, with the right indexes. You can still
create collections by hand if you want to override these defaults (for example,
adding custom indexes to the event collections, or increasing the size of the
capped metrics collections). But this is really nice for working out of the box;
it just works!
Invalidate associated metrics immediately.

The previous approach of aggregating events into five-second intervals and
performing bulk invalidation smacks of premature optimization. Much simpler to
just invalidate any associated metrics immediately as the events are received.
This appears to have minimal performance impact, besides.
Minor tweak.
Remove dead code.
Allow HTTP GET for events.

You can now issue a simple HTTP GET to retrieve events from Cube synchronously,
rather than fetching events asynchronously via WebSockets. The parameters are
identical to the WebSockets API. So,

    {
      "expression": "random(random)",
      "start": "2012-01-09T01:23:00Z",
      "stop": "2012-01-10T04:56:00Z"
    }

Is equivalent to:

   http://localhost:1081/1.0/event
     ?expression=random(random)
     &start=2012-01-09T01:23:00Z
     &stop=2012-01-10T04:56:00Z

The results are returned as a JSON array in chronological order. If an error
occurs, Cube now responds with a single JSON object containing the error
message. I've also fixed the event and metric expression grammars so that they
validate event types (which are more restrictive than properties).

Fixes #24. See also @6796e23.