In some situations, we discovered that CloudKitty ends up persisting
many zero values (processed datapoints) in the storage backend, which
can have a significant impact on the usage report queries.
In some cases, this might not be a problem, but in large-scale
deployments, these extra datapoints can cause not just an extra usage of
space for the storage backend, but also make the API slow.
This patch introduces a new option called "skip_datapoints_expression",
which can be defined, globally in the "cloudkitty.conf", in the
"orchestrator" section, or in the metrics.yml definition. The expression
"skip_datapoints_expression" must be a String where python code that
will be evaluated in runtime can be used.
For instance, for somebody that wants to skip/ignore datapoints that
have quantity as zeros, the following expression can be used:
The following is the string to be used in the YML definition:
```
skip_datapoints_expression: "datapoint.get('vol', {}).get('qty') == 0"
```
Alternatively, to define it in the "cloudkitty.conf":
```
[orchestrator]
skip_datapoints_expression = "datapoint.get('vol', {}).get('qty') == 0"
```
Change-Id: Id6e44a3389f9b3eaacf0394a2ddbc0e405734722
Signed-off-by: Rafael Weingärtner <rafael@apache.org>