Skip to content

Commit

Permalink
Fix metrics scope misuse (temporalio#2515)
Browse files Browse the repository at this point in the history
* Fix metrics scope bug when emitting mutable state metrics
  • Loading branch information
wxing1292 authored Feb 17, 2022
1 parent 1f2b291 commit ed29a48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions service/history/workflow/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ func emitMutableStateStatus(
sizeScope.RecordDistribution(metrics.ChildInfoSize, stats.ChildInfoSize)
countScope.RecordDistribution(metrics.ChildInfoCount, stats.ChildInfoCount)

countScope.RecordDistribution(metrics.RequestCancelInfoSize, stats.RequestCancelInfoSize)
sizeScope.RecordDistribution(metrics.RequestCancelInfoSize, stats.RequestCancelInfoSize)
countScope.RecordDistribution(metrics.RequestCancelInfoCount, stats.RequestCancelInfoCount)

sizeScope.RecordDistribution(metrics.SignalInfoSize, stats.SignalInfoSize)
countScope.RecordDistribution(metrics.SignalInfoCount, stats.SignalInfoCount)

sizeScope.RecordDistribution(metrics.BufferedEventsSize, stats.BufferedEventsSize)
sizeScope.RecordDistribution(metrics.BufferedEventsCount, stats.BufferedEventsCount)
countScope.RecordDistribution(metrics.BufferedEventsCount, stats.BufferedEventsCount)

if stats.HistoryStatistics != nil {
sizeScope.RecordDistribution(metrics.HistorySize, stats.HistoryStatistics.SizeDiff)
sizeScope.RecordDistribution(metrics.HistoryCount, stats.HistoryStatistics.CountDiff)
countScope.RecordDistribution(metrics.HistoryCount, stats.HistoryStatistics.CountDiff)
}
}

Expand Down

0 comments on commit ed29a48

Please sign in to comment.