config.go ×4

Frontier kind: Code frontier

unlabeled · c_68ed5ea8de90

460 tests · 3095 LOC · 143 files · introduces 0 tests · 63 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges63 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
463 ranges3095 lines · 143 files · Browse complete extent
All tests (intent)
460 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.

3 files ranked by introduced lines: 63 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/ratelimit_manager.go 33 introduced LOC · 4 ranges

Open complete file

90
91 // Start registers dynamic config subscriptions and computes the initial rate limits.
92 > func (r *rateLimitManager) Start() { ratelimit_manager.go
93 > r.mu.Lock()
94 > defer r.mu.Unlock()
95 >
96 > // Overall system rate limit will be the min of the two configs that are partition wise times the number of partitons.
97 > var cancel func()
98 > r.adminNsRate, cancel = r.config.AdminNamespaceToPartitionRateSub(r.setAdminNsRate)
99 > r.cancels = append(r.cancels, cancel)
100 > r.adminTqRate, cancel = r.config.AdminNamespaceTaskQueueToPartitionRateSub(r.setAdminTqRate)
101 > r.cancels = append(r.cancels, cancel)
102 > r.numReadPartitions, cancel = r.config.NumReadPartitionsSub(r.setNumReadPartitions)
103 > r.cancels = append(r.cancels, cancel)
104 > r.computeEffectiveRPSAndSourceLocked()
105 > }
106
107 func (r *rateLimitManager) setAdminNsRate(rps float64) {
137 // - Else if a worker-level RPS is configured, effectiveRPS = min(system default RPS, worker-configured RPS)
138 // - Otherwise, fall back to the system default RPS from dynamic config.
139 > func (r *rateLimitManager) computeEffectiveRPSAndSourceLocked() { ratelimit_manager.go
140 >
141 > var (
142 > effectiveRPS = math.Inf(1)
143 > rateLimitSource enumspb.RateLimitSource
144 > )
145 > // Overall system rate limit will be the min of the two configs that are partition wise times the number of partions.
146 > systemRPS := min(
147 > r.adminNsRate,
148 > r.adminTqRate,
149 > )
150 > r.systemRPS = systemRPS
151 > fraction := r.config.RateLimitFraction()
152 > switch {
153 case r.apiConfigRPS != nil:
154 effectiveRPS = *r.apiConfigRPS * fraction / float64(r.numReadPartitions)
159 }
160
161 > if effectiveRPS < r.systemRPS { ratelimit_manager.go
162 r.effectiveRPS = effectiveRPS
163 r.rateLimitSource = rateLimitSource
164 > } else { ratelimit_manager.go
165 > r.effectiveRPS = r.systemRPS
166 > r.rateLimitSource = enumspb.RATE_LIMIT_SOURCE_SYSTEM
167 > }
168 }
169
go.temporal.io/server/common/dynamicconfig/setting_gen.go 18 introduced LOC · 2 ranges

Open complete file

1357 func (s TaskQueueTypedSetting[T]) Subscribe(c *Collection) TypedSubscribableWithTaskQueueFilter[T] {
1358 return func(namespace string, taskQueue string, taskQueueType enumspb.TaskQueueType, callback func(T)) (T, func()) {
1359 > prec := []Constraints{ setting_gen.go
1360 > {Namespace: namespace, TaskQueueName: taskQueue, TaskQueueType: taskQueueType},
1361 > {Namespace: namespace, TaskQueueName: taskQueue},
1362 > {TaskQueueName: taskQueue},
1363 > {Namespace: namespace},
1364 > {},
1365 > }
1366 > return subscribe(c, s.key, s.def, s.convert, prec, callback)
1367 > }
1368 }
1369
1380 func (s TaskQueueTypedConstrainedDefaultSetting[T]) Subscribe(c *Collection) TypedSubscribableWithTaskQueueFilter[T] {
1381 return func(namespace string, taskQueue string, taskQueueType enumspb.TaskQueueType, callback func(T)) (T, func()) {
1382 > prec := []Constraints{ setting_gen.go
1383 > {Namespace: namespace, TaskQueueName: taskQueue, TaskQueueType: taskQueueType},
1384 > {Namespace: namespace, TaskQueueName: taskQueue},
1385 > {TaskQueueName: taskQueue},
1386 > {Namespace: namespace},
1387 > {},
1388 > }
1389 > return subscribeWithConstrainedDefault(c, s.key, s.cdef, s.convert, prec, callback)
1390 > }
1391 }
1392
go.temporal.io/server/service/matching/config.go 12 introduced LOC · 4 ranges

Open complete file

507 return max(1, config.NumTaskqueueReadPartitions(ns.String(), taskQueueName, taskType))
508 },
509 > NumReadPartitionsSub: func(cb func(int)) (int, func()) { config.go
510 > return config.NumTaskqueueReadPartitionsSub(ns.String(), taskQueueName, taskType, cb)
511 > },
512 BreakdownMetricsByTaskQueue: func() bool {
513 return config.BreakdownMetricsByTaskQueue(ns.String(), taskQueueName, taskType)
522 return config.AdminNamespaceToPartitionDispatchRate(ns.String())
523 },
524 > AdminNamespaceToPartitionRateSub: func(cb func(float64)) (float64, func()) { config.go
525 > return config.AdminNamespaceToPartitionRateSub(ns.String(), cb)
526 > },
527 AdminNamespaceTaskQueueToPartitionDispatchRate: func() float64 {
528 return config.AdminNamespaceTaskqueueToPartitionDispatchRate(ns.String(), taskQueueName, taskType)
529 },
530 > AdminNamespaceTaskQueueToPartitionRateSub: func(cb func(float64)) (float64, func()) { config.go
531 > return config.AdminNamespaceTaskqueueToPartitionRateSub(ns.String(), taskQueueName, taskType, cb)
532 > },
533 forwarderConfig: forwarderConfig{
534 ForwarderMaxOutstandingPolls: func() int {
549 return config.TaskQueueInfoByBuildIdTTL(ns.String(), taskQueueName, taskType)
550 },
551 > RateLimitFraction: func() float64 { config.go
552 > return config.RateLimitFractionProvider.GetRateLimitFraction(ns, taskQueueName, taskType)
553 > },
554 RateLimiterRefreshInterval: config.RateLimiterRefreshInterval,
555 FairnessKeyRateLimitCacheSize: func() int {