Skip to content

Commit c6aadda

Browse files
authoredJun 27, 2023
Expose started time in ActivityInfo (temporalio#1798)
1 parent 4e9b081 commit c6aadda

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
 

‎temporal-sdk/src/main/java/io/temporal/activity/ActivityInfo.java

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ public interface ActivityInfo {
6666
*/
6767
long getScheduledTimestamp();
6868

69+
/**
70+
* Time when the Activity Task (current attempt) was started.
71+
*
72+
* @return Timestamp in milliseconds (UNIX Epoch time)
73+
*/
74+
long getStartedTimestamp();
75+
6976
/**
7077
* Time when the Activity Task (current attempt) was scheduled by the Temporal Server.
7178
*

‎temporal-sdk/src/main/java/io/temporal/internal/activity/ActivityInfoImpl.java

+7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ public long getScheduledTimestamp() {
8282
return Timestamps.toMillis(response.getScheduledTime());
8383
}
8484

85+
@Override
86+
public long getStartedTimestamp() {
87+
return Timestamps.toMillis(response.getStartedTime());
88+
}
89+
8590
@Override
8691
public long getCurrentAttemptScheduledTimestamp() {
8792
return Timestamps.toMillis(response.getCurrentAttemptScheduledTime());
@@ -183,6 +188,8 @@ public String toString() {
183188
+ getActivityType()
184189
+ ", scheduledTimestamp="
185190
+ getScheduledTimestamp()
191+
+ ", startedTimestamp="
192+
+ getStartedTimestamp()
186193
+ ", currentAttemptScheduledTimestamp="
187194
+ getCurrentAttemptScheduledTimestamp()
188195
+ ", scheduleToCloseTimeout="

0 commit comments

Comments
 (0)
Please sign in to comment.