context update vs cron
-
If I have a point taking the delta between a totalizer every 15 minutes, using this equation
return p317.value - p317.ago(MINUTE, 15)
would it be better on the cpu (mango) to use a context update or to use a CRON pattern
0 0/15 * * * ?
-
I would use a cron for that regardless but the CPU question depends on how often your contex point where to update.
-
So if I am doing things on a "time" basis, cron is better? It is my understanding that I would use a context update more for a "Status" , or event handler.
-
I'm not sure there is a hard and fast simplification for the selection of the type. That said, that's a fine intuition to start from.
Another kind of meta data point will be something like the 'Time since status' genre. In this case, I typically use a cron AND a context update. While just using a cron would enable you to recompute the minutes since the last update/change/negative value/whatever, but it isn't responsive and would probably never report a zero. So the context update is useful to zero it out.