Skip to Content

Calculation of status duration in Application Enablement

What would be a proposed approach for calculating duration between status changes through Application Enablement services?

For example if I have a thing with only one property (status property called 'working').

And I would like to calculate working time of this thing for the last week.

Is there any standard/proposed approach for calculating this?

Case here is that first occurrence of true means machine started and the next time it is false would mean it has stopped. So I need to get both timestamps to know it's working time. And then I would have to add up such working times.

So typically in a standard database I would compare two database rows with LEAD or LAG to check if there was a status change. But how to do it in AE?

Thanks in advance!


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Dec 10, 2018 at 11:03 AM

    My first guess would be the analytical odata api.

    When there are regular intervals for the status update then if we could count a specific value of the status measure with the analytical odata api then this would do the trick. But I think we can only count the number of measurements. So this would only work if you would only send the uptime status and ommit sending anything, when the machine is down.

    If it cannot be done in one query or when you do not have regular intervals then it requires to scan over changes to the value of the status property and create another measure with the “integrated” value based on status. As we do not support ingestion processing of the data coming in yet this would be have to be a batch job right now.

    Add comment
    10|10000 characters needed characters exceeded