Permalink
Browse files

Merge branch '0.2.3'

  • Loading branch information...
2 parents ccea66b + 17bec5c commit 7148af153f23b8ec6b487120675f67cba85c9a87 @mbostock mbostock committed May 17, 2012
Showing with 6 additions and 4 deletions.
  1. +2 −1 lib/cube/evaluator.js
  2. +3 −2 lib/cube/event.js
  3. +1 −1 package.json
View
@@ -65,8 +65,9 @@ exports.register = function(db, endpoints) {
limit = +request.limit,
step = +request.step;
- // Provide default start and stop times for recent metrics.
+ // Provide default start, stop and step times for recent metrics.
// If the limit is not specified, or too big, use the maximum limit.
+ if (!("step" in request)) request.step = step = 1e4;
if (!("stop" in request)) request.stop = Math.floor(Date.now() / step) * step;
if (!("start" in request)) request.start = 0;
if (!(limit <= limitMax)) limit = limitMax;
View
@@ -5,7 +5,8 @@ var mongodb = require("mongodb"),
parser = require("./event-expression"),
tiers = require("./tiers"),
types = require("./types"),
- bisect = require("./bisect");
+ bisect = require("./bisect"),
+ ObjectID = mongodb.ObjectID;
var type_re = /^[a-z][a-zA-Z0-9_]+$/,
invalidate = {$set: {i: true}},
@@ -187,7 +188,7 @@ exports.getter = function(db) {
handle(error);
// A null event indicates that there are no more results.
- if (event) callback({time: event.t, data: event.d});
+ if (event) callback({id: event._id instanceof ObjectID ? undefined : event._id, time: event.t, data: event.d});
else callback(null);
});
});
View
@@ -1,6 +1,6 @@
{
"name": "cube",
- "version": "0.2.2",
+ "version": "0.2.3",
"description": "A system for analyzing time series data using MongoDB and Node.",
"keywords": ["time series"],
"homepage": "http://square.github.com/cube/",

0 comments on commit 7148af1

Please sign in to comment.