Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions api/persistence/v1/executions.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions chasm/lib/activity/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,11 @@ func (a *Activity) RecordHeartbeat(
if err != nil {
return nil, err
}
prevHeartbeat, _ := a.LastHeartbeat.TryGet(ctx)
Comment thread
davidporter-id-au marked this conversation as resolved.
a.LastHeartbeat = chasm.NewDataField(ctx, &activitypb.ActivityHeartbeatState{
RecordedTime: timestamppb.New(ctx.Now(a)),
Details: input.Request.GetHeartbeatRequest().GetDetails(),
RecordedTime: timestamppb.New(ctx.Now(a)),
Details: input.Request.GetHeartbeatRequest().GetDetails(),
TotalHeartbeatCount: prevHeartbeat.GetTotalHeartbeatCount() + 1,
})
if heartbeatTimeout := a.GetHeartbeatTimeout().AsDuration(); heartbeatTimeout > 0 {
ctx.AddTask(
Expand Down Expand Up @@ -792,6 +794,7 @@ func (a *Activity) buildActivityExecutionInfo(ctx chasm.Context) *apiactivitypb.
Header: requestData.GetHeader(),
HeartbeatDetails: heartbeat.GetDetails(),
HeartbeatTimeout: a.GetHeartbeatTimeout(),
TotalHeartbeatCount: heartbeat.GetTotalHeartbeatCount(),
LastAttemptCompleteTime: attempt.GetCompleteTime(),
LastFailure: attempt.GetLastFailureDetails().GetFailure(),
LastHeartbeatTime: heartbeat.GetRecordedTime(),
Expand Down
20 changes: 15 additions & 5 deletions chasm/lib/activity/gen/activitypb/v1/activity_state.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions chasm/lib/activity/proto/v1/activity_state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ message ActivityHeartbeatState {
temporal.api.common.v1.Payloads details = 1;
// Time the last heartbeat was recorded.
google.protobuf.Timestamp recorded_time = 2;
// Total number of heartbeats recorded across all attempts of this activity, including retries.
int64 total_heartbeat_count = 3;
}

message ActivityRequestData {
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,5 @@ require (
sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

replace go.temporal.io/api => github.com/davidporter-id-au/api-go v0.0.0-20260422011909-c01e522f0b3b
Comment thread
davidporter-id-au marked this conversation as resolved.
Outdated
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davidporter-id-au/api-go v0.0.0-20260422011909-c01e522f0b3b h1:ym7Cw33V9pqPnzcNCvePGtVgsfGH04NWb212YNmr+vo=
github.com/davidporter-id-au/api-go v0.0.0-20260422011909-c01e522f0b3b/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
github.com/dgryski/go-farm v0.0.0-20140601200337-fc41e106ee0e/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da h1:aIftn67I1fkbMa512G+w+Pxci9hJPB8oMnkcP3iZF38=
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
Expand Down Expand Up @@ -469,8 +471,6 @@ go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0 h1:R
go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0/go.mod h1:I89cynRj8y+383o7tEQVg2SVA6SRgDVIouWPUVXjx0U=
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0 h1:CQvJSldHRUN6Z8jsUeYv8J0lXRvygALXIzsmAeCcZE0=
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0/go.mod h1:xSQ+mEfJe/GjK1LXEyVOoSI1N9JV9ZI923X5kup43W4=
go.temporal.io/api v1.62.10-0.20260420202918-975b82732988 h1:ZJ1SLhzqMz62LR0nIcle5MSHJzqERBGj/tsxQfX8YTo=
go.temporal.io/api v1.62.10-0.20260420202918-975b82732988/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
go.temporal.io/auto-scaled-workers v0.0.0-20260407181057-edd947d743d2 h1:1hKeH3GyR6YD6LKMHGCZ76t6h1Sgha0hXVQBxWi3dlQ=
go.temporal.io/auto-scaled-workers v0.0.0-20260407181057-edd947d743d2/go.mod h1:T8dnzVPeO+gaUTj9eDgm/lT2lZH4+JXNvrGaQGyVi50=
go.temporal.io/sdk v1.41.1 h1:yOpvsHyDD1lNuwlGBv/SUodCPhjv9nDeC9lLHW/fJUA=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ message ActivityInfo {
// Replication: This field is part of ActivityInfo and is automatically replicated
// via state-based replication. No special handling is needed.
temporal.server.api.clock.v1.VectorClock started_clock = 52;

// Total number of heartbeats recorded across all attempts of this activity, including retries.
int64 total_heartbeat_count = 53;
Comment thread
davidporter-id-au marked this conversation as resolved.
Outdated
}

// timer_map column
Expand Down
1 change: 1 addition & 0 deletions service/history/workflow/mutable_state_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,7 @@ func (ms *MutableStateImpl) UpdateActivityProgress(
}
ai.Version = ms.GetCurrentVersion()
ai.LastHeartbeatDetails = request.Details
ai.TotalHeartbeatCount++
Comment thread
davidporter-id-au marked this conversation as resolved.
Outdated
now := ms.timeSource.Now()
ai.LastHeartbeatUpdateTime = timestamppb.New(now)
ms.updateActivityInfos[ai.ScheduledEventId] = ai
Expand Down