Skip to content

Commit e83cb2b

Browse files
committed
test another logic
1 parent ba6be7f commit e83cb2b

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

internal/internal_event_handlers.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,10 @@ func (weh *workflowExecutionEventHandlerImpl) ProcessEvent(
940940
return err
941941
}
942942

943-
//historySizeErr := weh.estimateHistorySize(event)
944-
//if historySizeErr != nil {
945-
// weh.logger.Error("Failed to estimate history size", zap.Error(historySizeErr))
946-
//}
943+
historySizeErr := weh.estimateHistorySize(event)
944+
if historySizeErr != nil {
945+
weh.logger.Error("Failed to estimate history size", zap.Error(historySizeErr))
946+
}
947947

948948
// When replaying histories to get stack trace or current state the last event might be not
949949
// decision started. So always call OnDecisionTaskStarted on the last event.
@@ -1487,5 +1487,6 @@ func (weh *workflowExecutionEventHandlerImpl) estimateHistorySize(event *m.Histo
14871487
return fmt.Errorf("unknown event type")
14881488
}
14891489
weh.workflowInfo.TotalHistoryBytes += int64(sum)
1490+
weh.logger.Info("EstimateHistorySize", zap.Int("historyBytes", sum), zap.Int64("totalHistoryBytes", weh.workflowInfo.TotalHistoryBytes))
14901491
return nil
14911492
}

internal/internal_task_handlers.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,10 @@ OrderEvents:
372372
eh.currentIndex = 0
373373

374374
// estimate history size for nextEvents and markers
375-
historySizeEstimation += eh.estimateHistorySize(nextEvents)
376-
historySizeEstimation += eh.estimateHistorySize(markers)
377-
378-
eh.eventsHandler.logger.Info(fmt.Sprintf("Returning historySizeEstimation not zero of %d", historySizeEstimation))
375+
//historySizeEstimation += eh.estimateHistorySize(nextEvents)
376+
//historySizeEstimation += eh.estimateHistorySize(markers)
377+
//
378+
//eh.eventsHandler.logger.Info(fmt.Sprintf("Returning historySizeEstimation not zero of %d", historySizeEstimation))
379379

380380
return nextEvents, markers, historySizeEstimation, nil
381381
}
@@ -988,7 +988,7 @@ func (w *workflowExecutionContextImpl) ProcessWorkflowTask(workflowTask *workflo
988988
ProcessEvents:
989989
for {
990990
reorderedEvents, markers, binaryChecksum, historySizeEstimation, err := reorderedHistory.NextDecisionEvents()
991-
w.workflowInfo.TotalHistoryBytes += int64(historySizeEstimation)
991+
//w.workflowInfo.TotalHistoryBytes += int64(historySizeEstimation)
992992
w.wth.logger.Info("Differences between history size estimation and actual size",
993993
zap.Int("HistoryEstimation", historySizeEstimation),
994994
zap.Int64("HistorySizeEstimation", w.workflowInfo.TotalHistoryBytes),

0 commit comments

Comments
 (0)