Skip to content
Open
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
29 changes: 17 additions & 12 deletions common/persistence/sql/sqlplugin/tests/visibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -1341,19 +1341,24 @@ func (s *visibilitySuite) newRandomVisibilityRow(
historyLength *int64,
) sqlplugin.VisibilityRow {
s.version++
var executionDuration *int64
if closeTime != nil {
executionDuration = new(closeTime.Sub(executionTime).Nanoseconds())
}
return sqlplugin.VisibilityRow{
NamespaceID: namespaceID.String(),
RunID: runID.String(),
WorkflowTypeName: workflowTypeName,
WorkflowID: workflowID,
StartTime: startTime,
ExecutionTime: executionTime,
Status: status,
CloseTime: closeTime,
HistoryLength: historyLength,
Memo: shuffle.Bytes(testVisibilityData),
Encoding: testVisibilityEncoding,
Version: s.version,
NamespaceID: namespaceID.String(),
RunID: runID.String(),
WorkflowTypeName: workflowTypeName,
WorkflowID: workflowID,
StartTime: startTime,
ExecutionTime: executionTime,
Status: status,
CloseTime: closeTime,
HistoryLength: historyLength,
ExecutionDuration: executionDuration,
Memo: shuffle.Bytes(testVisibilityData),
Encoding: testVisibilityEncoding,
Version: s.version,
}
}

Expand Down
2 changes: 1 addition & 1 deletion common/persistence/sql/sqlplugin/visibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type (
CloseTime *time.Time
HistoryLength *int64
HistorySizeBytes *int64
ExecutionDuration *time.Duration
ExecutionDuration *int64
StateTransitionCount *int64
Memo []byte
Encoding string
Expand Down
4 changes: 2 additions & 2 deletions common/persistence/visibility/store/sql/visibility_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (s *VisibilityStore) RecordWorkflowExecutionClosed(
row.CloseTime = &request.CloseTime
row.HistoryLength = &request.HistoryLength
row.HistorySizeBytes = &request.HistorySizeBytes
row.ExecutionDuration = &request.ExecutionDuration
row.ExecutionDuration = new(request.ExecutionDuration.Nanoseconds())
row.StateTransitionCount = &request.StateTransitionCount

result, err := s.sqlStore.DB.ReplaceIntoVisibility(ctx, row)
Expand Down Expand Up @@ -852,7 +852,7 @@ func (s *VisibilityStore) rowToInfo(
info.CloseTime = *row.CloseTime
}
if row.ExecutionDuration != nil {
info.ExecutionDuration = *row.ExecutionDuration
info.ExecutionDuration = time.Duration(*row.ExecutionDuration)
}
if row.HistoryLength != nil {
info.HistoryLength = *row.HistoryLength
Expand Down
Loading