Skip to content

Commit

Permalink
race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
pdoerner committed May 23, 2023
1 parent 859950e commit e283bfb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/aggregate/persistence_health_signal_aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,17 @@ func (s *PersistenceHealthSignalAggregator[_]) emitMetricsLoop() {
for {
select {
case <-s.emitMetricsTimer.C:
s.latencyLock.RLock()
for key, avg := range s.latencyAverages {
s.metricsHandler.Gauge(metrics.PersistenceAvgLatencyPerShardPerNamespace.GetMetricName()).Record(avg.Average(), key.GetMetricTags()...)
}
s.latencyLock.RUnlock()

s.errorLock.RLock()
for key, ratio := range s.errorRatios {
s.metricsHandler.Gauge(metrics.PersistenceErrPerShardPerNamespace.GetMetricName()).Record(ratio.Average(), key.GetMetricTags()...)
}
s.errorLock.RUnlock()
}
}
}

0 comments on commit e283bfb

Please sign in to comment.