Skip to content

Commit

Permalink
Fix off-by-one (or two) in GET metrics.
Browse files Browse the repository at this point in the history
Fixes the computation of the expected number of metric values.
  • Loading branch information
mbostock committed Jan 26, 2012
1 parent 4e8b01d commit 6c47292
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cube/server/metric.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ exports.getter = function(db) {

// Return the expected number of values.
var expected = 0;
while ((start = tier.step(start)) < stop) ++expected;
while (start < stop) ++expected, start = tier.step(start);
return expected;
};
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cube",
"version": "0.1.0",
"version": "0.1.1",
"description": "A system for time series visualization using MongoDB, Node and D3.",
"keywords": ["time series", "visualization"],
"homepage": "http://square.github.com/cube/",
Expand Down

0 comments on commit 6c47292

Please sign in to comment.