We want to log how long each step would take:
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 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.