I have a ServicePoint that as two fields:
measurements: MeasurementSeries motorData: [MotorData]
into the measurements i have PointMeasurement for status (bool) and for position [0.0, 1.0]
into the motorData i have the field consumption (int)
i need to create a metric for the type Facility that evaluate the sum of the expressions [status == 1 ? consumption * position : 0] for every ServicePoints.
The problem is that if i define the different simple metrics for consumption, status and position for type Facility i don’t obtain the correct value, ie:
consumption status position _total_ ServicePoint 1 10 1 0.5 5 ServicePoint 2 10 1 0.5 5 ServicePoint 3 10 0 1 0
if i call the metric on a Facility i want to obtain the value 10 (5+5+0)
so basically the idea is to evaluate the metric “by rows” instead “by columns”
my simple idea is to create SimpleMetrics for consumption, status and position and a CompoundMetric to evaluate the expression consumption * status * position but the problem is that the CompoundMetric only works for type ServicePoint and not for Facility (or better, it works but it multiplicate the aggregation of consumption, status and position. Instead i want to aggregate the multiplication between consumption, status and position over the several ServicePoints).
Any suggestions on how to do that??