Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update counts to mutable state statistics #4422

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions common/persistence/dataInterfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ type (
SignalInfoSize int
SignalRequestIDSize int
BufferedEventsSize int
// UpdateInfoSize is included in ExecutionInfoSize

// Item count for various information captured within mutable state
ActivityInfoCount int
Expand All @@ -743,6 +744,7 @@ type (
SignalRequestIDCount int
BufferedEventsCount int
TaskCountByCategory map[string]int
UpdateInfoCount int

// Total item count for various information captured within mutable state
TotalActivityCount int64
Expand All @@ -751,6 +753,7 @@ type (
TotalRequestCancelExternalCount int64
TotalSignalExternalCount int64
TotalSignalCount int64
TotalUpdateCount int64
}

HistoryStatistics struct {
Expand Down
18 changes: 18 additions & 0 deletions common/persistence/size.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func statusOfInternalWorkflow(
bufferedEventsCount := len(internalState.BufferedEvents)
bufferedEventsSize := sizeOfBlobSlice(internalState.BufferedEvents)

totalUpdateCount := state.ExecutionInfo.UpdateCount
updateInfoCount := len(state.ExecutionInfo.UpdateInfos)

totalSize := executionInfoSize
totalSize += executionStateSize
totalSize += activityInfoSize
Expand Down Expand Up @@ -111,6 +114,9 @@ func statusOfInternalWorkflow(

BufferedEventsSize: bufferedEventsSize,
BufferedEventsCount: bufferedEventsCount,

UpdateInfoCount: updateInfoCount,
TotalUpdateCount: totalUpdateCount,
}
}

Expand Down Expand Up @@ -161,6 +167,9 @@ func statusOfInternalWorkflowMutation(
signalRequestIDSize := sizeOfStringSet(mutation.UpsertSignalRequestedIDs)
signalRequestIDSize += sizeOfStringSet(mutation.DeleteSignalRequestedIDs)

totalUpdateCount := mutation.ExecutionInfo.UpdateCount
updateInfoCount := len(mutation.ExecutionInfo.UpdateInfos)

bufferedEventsCount := 0
bufferedEventsSize := 0
if mutation.NewBufferedEvents != nil {
Expand Down Expand Up @@ -217,6 +226,9 @@ func statusOfInternalWorkflowMutation(
BufferedEventsCount: bufferedEventsCount,

TaskCountByCategory: taskCountByCategory,

TotalUpdateCount: totalUpdateCount,
UpdateInfoCount: updateInfoCount,
}
}

Expand Down Expand Up @@ -263,6 +275,9 @@ func statusOfInternalWorkflowSnapshot(
signalRequestIDCount := len(snapshot.SignalRequestedIDs)
signalRequestIDSize := sizeOfStringSet(snapshot.SignalRequestedIDs)

totalUpdateCount := snapshot.ExecutionInfo.UpdateCount
updateInfoCount := len(snapshot.ExecutionInfo.UpdateInfos)

bufferedEventsCount := 0
bufferedEventsSize := 0

Expand Down Expand Up @@ -313,5 +328,8 @@ func statusOfInternalWorkflowSnapshot(
BufferedEventsCount: bufferedEventsCount,

TaskCountByCategory: taskCountByCategory,

TotalUpdateCount: totalUpdateCount,
UpdateInfoCount: updateInfoCount,
}
}