ratelimit_manager.go ×2

Frontier kind: Code frontier

unlabeled · c_bb58efd15abb

4 tests · 5215 LOC · 189 files · introduces 0 tests · 22 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges22 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1038 ranges5215 lines · 189 files · Browse complete extent
All tests (intent)
4 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: 22 introduced LOC across 3 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/ratelimit_manager.go 19 introduced LOC · 2 ranges

Open complete file

174 // If the effective RPS has changed, we need to update the rate limiters.
175 if oldRPS != newRPS {
176 > r.updateRatelimitLocked() ratelimit_manager.go
177 > r.updateSimpleRateLimitWithBurstLocked(defaultBurstDuration)
178 > }
179 // Internally, checks if the per-key rate limit has changed and updates it accordingly.
180 r.updatePerKeySimpleRateLimitWithBurstLocked(defaultBurstDuration)
253
254 // updateRatelimitLocked checks and updates the overall queue rate limit if changed.
255 > func (r *rateLimitManager) updateRatelimitLocked() { ratelimit_manager.go
256 > newRPS := r.effectiveRPS
257 > // If the effective RPS is zero, we set the burst to zero as well.
258 > // This prevents any initial tasks from executing immediately.
259 > // Allows pausing of the task queue by setting the RPS to zero.
260 > var burst int
261 > if newRPS != 0 {
262 > // If the effective RPS is non-zero, we can set a burst based on the effective RPS.
263 > burst = max(int(math.Ceil(newRPS)), r.config.MinTaskThrottlingBurstSize())
264 > }
265 > r.dynamicRateBurst.SetRPS(newRPS)
266 > r.dynamicRateBurst.SetBurst(burst)
267 > // updateRatelimitLocked is invoked whenever the effective RPS value changes.
268 > // At this point, the dynamicRateLimiter is always updated with the latest rate and burst values,
269 > // ensuring that the new rate limit takes effect immediately.
270 > r.dynamicRateLimiter.Refresh()
271 }
272
go.temporal.io/server/service/matching/config.go 3 introduced LOC · 1 range

Open complete file

447 return config.MaxTaskQueueIdleTime(ns.String(), taskQueueName, taskType)
448 },
449 > MinTaskThrottlingBurstSize: func() int { config.go
450 > return config.MinTaskThrottlingBurstSize(ns.String(), taskQueueName, taskType)
451 > },
452 SyncMatchWaitDuration: func() time.Duration {
453 return config.SyncMatchWaitDuration(ns.String(), taskQueueName, taskType)