health_signal_aggregator.go ×5

Frontier kind: Code frontier

unlabeled · c_b9594b13ca06

18 tests · 2902 LOC · 148 files · introduces 0 tests · 26 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges26 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
415 ranges2902 lines · 148 files · Browse complete extent
All tests (intent)
18 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 26 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/health_signal_aggregator.go 15 introduced LOC · 5 ranges

Open complete file

114 }
115
116 > func (s *healthSignalAggregatorImpl) Record(callerSegment int32, latency time.Duration, err error) { health_signal_aggregator.go
117 > if s.aggregationEnabled {
118 > s.latencyAverage.Record(latency.Milliseconds())
119 >
120 > if s.percentilesEnabled() && s.latencyDistribution != nil {
121 s.latencyDistribution.RecordToLatestWindow(float64(latency.Milliseconds()))
122 }
123
124 > if isUnhealthyError(err) { health_signal_aggregator.go
125 s.errorRatio.Record(1)
127 s.errorRatio.Record(0)
128 }
129 }
130
131 > if callerSegment != CallerSegmentMissing { health_signal_aggregator.go
132 > s.incrementShardRequestCount(callerSegment)
133 > }
134 }
135
154 }
155
156 > func (s *healthSignalAggregatorImpl) incrementShardRequestCount(shardID int32) { health_signal_aggregator.go
157 > s.requestsLock.Lock()
158 > defer s.requestsLock.Unlock()
159 > s.requestCounts[shardID]++
160 > }
161
162 // Traverse through all shards and get the per-namespace persistence RPS for all shards.
go.temporal.io/server/common/aggregate/moving_window_average.go 11 introduced LOC · 1 range

Open complete file

40 }
41
42 > func (a *MovingWindowAvgImpl) Record(val int64) { moving_window_average.go
43 > a.Lock()
44 > defer a.Unlock()
45 >
46 > a.buffer[a.tailIdx] = timestampedData{timestamp: time.Now(), value: val}
47 > a.tailIdx = (a.tailIdx + 1) % a.maxBufferSize
48 >
49 > a.sum += val
50 > a.count++
51 >
52 > if a.tailIdx == a.headIdx {
53 // buffer full, expire oldest element
54 a.sum -= a.buffer[a.headIdx].value