How to detect if Analysis is triggered live or backfilling/recalculating?

Discussion created by ChristophRose on Nov 20, 2020
Latest reply on Nov 21, 2020 by Dan Fishman

A very simple question, and I have some ideas as to possible approaches, but I thought this might also be useful for some others:


What is the best way to find out in an Analysis if this Analysis is being triggered "live" - or if it is being backfilled/recalculating?


Background: Lets say we want a relatively accurate operating time meter that I can show on a PI Vision trend. One way to do this is to trigger an Analysis every minute or so to update the current value. However, when backfilling/recalculating I don't need to write the current operating time every minute, but only on archived events (when the motor turns on or off) as interpolation is perfectly accurate.

Now, I could change the Analysis before recalculating, but I would prefer that that wouldn't be necessary. So what is a nice trick to detect - in the Analysis -  if the Analysis is being recalculated?