Skip to content

Commit 98ced27

Browse files
committed
separate metrics for better tracking and info
1 parent 6bcf0a1 commit 98ced27

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

internal/common/metrics/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,7 @@ const (
117117

118118
ConcurrentTaskQuota = CadenceMetricsPrefix + "concurrent-task-quota"
119119
ConcurrentTaskRunning = CadenceMetricsPrefix + "concurrent-task-running"
120+
121+
EstimatedHistorySize = CadenceMetricsPrefix + "estimated-history-size"
122+
ServerSideHistorySize = CadenceMetricsPrefix + "server-side-history-size"
120123
)

internal/internal_task_handlers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ func (w *workflowExecutionContextImpl) ProcessWorkflowTask(workflowTask *workflo
858858
ProcessEvents:
859859
for {
860860
reorderedEvents, markers, binaryChecksum, err := reorderedHistory.NextDecisionEvents()
861-
w.wth.metricsScope.GetTaggedScope("workflowtype", w.workflowInfo.WorkflowType.Name).Gauge("cadence-historysize-ratio").Update(float64(w.workflowInfo.TotalHistoryBytes) / float64(w.workflowInfo.HistoryBytesServer))
861+
w.wth.metricsScope.GetTaggedScope("workflowtype", w.workflowInfo.WorkflowType.Name).Gauge(metrics.EstimatedHistorySize).Update(float64(w.workflowInfo.TotalHistoryBytes))
862+
w.wth.metricsScope.GetTaggedScope("workflowtype", w.workflowInfo.WorkflowType.Name).Gauge(metrics.ServerSideHistorySize).Update(float64(w.workflowInfo.HistoryBytesServer))
862863
if err != nil {
863864
return nil, err
864865
}

0 commit comments

Comments
 (0)