long start = Workflow.currentTimeMillis();
operation1();
long duration = Workflow.currentTimeMillis() - start;
My question is if the worker died when it runs operation1(), and temporal restores the workflow. What would happen to the start?
Will the start restored to the start timestamp on the first run? Or it will become actual timestamp on the second run (when restoring)?
I am asking this because in former case, the calculated duration would be too large: Duration(end of run 2 - start of run 1)
In the latter case, the duration would be too small, because in my understanding, all recorded activities will use the recorded results, so the time spent on run 2 will be shorter.
Correct. But it assumes that the workflow worker has been down for a day. In a normal situation, the recovery will happen immediately after the operation’s completion.
You can watch the workflow task queue schedule to start latency metric. If it starts growing then the workflow workers cannot keep up with the workflow update reate or down.