File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
temporal-sdk/src/main/java/io/temporal/internal/worker Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 33import static io .temporal .serviceclient .MetricsTag .METRICS_TAGS_CALL_OPTIONS_KEY ;
44
55import com .google .protobuf .DoubleValue ;
6- import com .google .protobuf .Timestamp ;
76import com .uber .m3 .tally .Scope ;
87import io .grpc .Context ;
98import io .temporal .api .common .v1 .WorkerVersionCapabilities ;
@@ -113,10 +112,11 @@ public CompletableFuture<ActivityTask> poll(SlotPermit permit) {
113112 metricsScope .counter (MetricsType .ACTIVITY_POLL_NO_TASK_COUNTER ).inc (1 );
114113 return null ;
115114 }
116- Timestamp startedTime = ProtobufTimeUtils .getCurrentProtoTime ();
117115 metricsScope
118116 .timer (MetricsType .ACTIVITY_SCHEDULE_TO_START_LATENCY )
119- .record (ProtobufTimeUtils .toM3Duration (startedTime , r .getScheduledTime ()));
117+ .record (
118+ ProtobufTimeUtils .toM3Duration (
119+ r .getStartedTime (), r .getCurrentAttemptScheduledTime ()));
120120 return new ActivityTask (
121121 r ,
122122 permit ,
Original file line number Diff line number Diff line change 22
33import static io .temporal .serviceclient .MetricsTag .METRICS_TAGS_CALL_OPTIONS_KEY ;
44
5- import com .google .protobuf .Timestamp ;
65import com .uber .m3 .tally .Scope ;
76import com .uber .m3 .util .ImmutableMap ;
87import io .grpc .Context ;
@@ -154,10 +153,9 @@ public CompletableFuture<WorkflowTask> poll(SlotPermit permit)
154153 pollerMetricScope
155154 .counter (MetricsType .WORKFLOW_TASK_QUEUE_POLL_SUCCEED_COUNTER )
156155 .inc (1 );
157- Timestamp startedTime = ProtobufTimeUtils .getCurrentProtoTime ();
158156 pollerMetricScope
159157 .timer (MetricsType .WORKFLOW_TASK_SCHEDULE_TO_START_LATENCY )
160- .record (ProtobufTimeUtils .toM3Duration (startedTime , r .getScheduledTime ()));
158+ .record (ProtobufTimeUtils .toM3Duration (r . getStartedTime () , r .getScheduledTime ()));
161159 return new WorkflowTask (r , (reason ) -> slotSupplier .releaseSlot (reason , permit ));
162160 })
163161 .whenComplete (
You can’t perform that action at this time.
0 commit comments