EPL for measurements aggregation with Date_from and Date_to

Hi,

additionally to daily/weekly/monthly/yearly measurements cumulation in another measurement or managed object, we would like to have the flexibility in selecting a datefrom/dateto for this cumulation/aggregation of measurements. For this purpose we need 2 things:

  1. an EPL which gets measurements of all members of all groups and performs an aggregation/cumulation for every worker for all its measurements for the specified datefrom/dateto
  2. in the application dashboard, we need a widget where the administrator can actually input the datefrom and dateto values, those values will be somehow linked to EPL in order to feed the EPL with those 2 values

it is something feasible? and how?

thanks,

Hi,

if I understand your use case correctly, you want to do on-demand aggregations based on the timeframe a user selects in the UI?

This is not the best use of EPL as it works best with streaming data. I think you could make it work by e.g. creating an event when a user selects a date range and then in EPL react to that event, use FindMeasurements to fetch the affected measurements, calculate the aggregation and somehow feed the results back to the user, but this would be very complex.

Better ideas:

  • precalculate the results and store them in measurements. This would mean additional costs for the measurements and you would loose the full flexibility.
  • create a microservice to do the on-demand calculation. The microservice has a REST interface that is much better suited for this use case than the event-driven approach of EPL. The microservice would also mean additional costs.
  • do the aggregation on the client-side. This would mean transporting more data to the client, which maybe prohibitive but you can check the /series endpoint of the Measurements API that provides a more concise format than the normal API.

ok so if we divide the needed scope into very small steps, step#1 would be to allow the user to select ‘date_from’ and date_to in the web interface, how to do it?