File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/main/java/com/uber/cadence/internal/replay Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ class ReplayDecider implements Decider {
79
79
80
80
private final Scope metricsScope ;
81
81
82
- private long wfStartTime = - 1 ;
82
+ private final long wfStartTimeNanos ;
83
83
84
84
private final WorkflowExecutionStartedEventAttributes startedEvent ;
85
85
@@ -102,6 +102,7 @@ class ReplayDecider implements Decider {
102
102
throw new IllegalArgumentException (
103
103
"First event in the history is not WorkflowExecutionStarted" );
104
104
}
105
+ wfStartTimeNanos = decisionTask .getHistory ().getEvents ().get (0 ).getTimestamp ();
105
106
106
107
context =
107
108
new DecisionContextImpl (
@@ -288,12 +289,10 @@ private void completeWorkflow() {
288
289
}
289
290
}
290
291
291
- if (wfStartTime != -1 ) {
292
- long nanoTime =
293
- TimeUnit .NANOSECONDS .convert (System .currentTimeMillis (), TimeUnit .MILLISECONDS );
294
- com .uber .m3 .util .Duration d = com .uber .m3 .util .Duration .ofNanos (nanoTime - wfStartTime );
295
- metricsScope .timer (MetricsType .WORKFLOW_E2E_LATENCY ).record (d );
296
- }
292
+ long nanoTime =
293
+ TimeUnit .NANOSECONDS .convert (System .currentTimeMillis (), TimeUnit .MILLISECONDS );
294
+ com .uber .m3 .util .Duration d = com .uber .m3 .util .Duration .ofNanos (nanoTime - wfStartTimeNanos );
295
+ metricsScope .timer (MetricsType .WORKFLOW_E2E_LATENCY ).record (d );
297
296
}
298
297
299
298
private void updateTimers () {
You can’t perform that action at this time.
0 commit comments