square/cube — Issue #32: grouped metrics should return a map of values
Author: mbostock
Created: 2012-01-21 19:01:55+00:00
State: open
Labels: bug

Currently you get back individual results for each host + time, rather than just a single value:

```js
{"time": "2011-09-10T12:40:00Z", "group": "web11", "value": 5023}
{"time": "2011-09-10T12:40:00Z", "group": "web12", "value": 492}
{"time": "2011-09-10T12:40:00Z", "group": "web13", "value": 1401}
```

This actually causes the /metric/get endpoint to hang, because it's expecting the wrong number of results.

To fix this, and so clients in general can tell when all the results have been returned and when results are missing, we should combine the results for each time, like this:

```js
{"time": "2011-09-10T12:40:00Z", "value": {"web11": 5023, "web12":
492, "web13", "value": 1401}}
```

This might not perform as well with very high-cardinality groups, though; I'd like to add a top N or bottom N to the group-by as well to solve that problem.