Greplin/scales — pull request #5 by stefanp (2011-11-11 01:03:05+00:00)
Title: Stefan

This adds support for regular expression in aggregations keys.

Use it by specifying a (name, regex) tuple as the key in an aggregator definition, ie:

```python
agg = aggregation.Aggregation({
'http_hits' : {
('ok', re.compile("[1-3][0-9][0-9]")): [aggregation.Sum(dataFormat=aggregation.DataFormats.DIRECT)],
('err', re.compile("[4-5][0-9][0-9]")): [aggregation.Sum(dataFormat = aggregation.DataFormats.DIRECT)]
}})
```

This would sum successful and failed hits separately.