Atlas › Test

false_OR_false

Exact test identity: go.temporal.io/server/common/taskqueue/TestMergeStats_RateLimitingActive/false_OR_false

Package
go.temporal.io/server/common/taskqueue
Suite / test hierarchy
TestMergeStats_RateLimitingActive/false_OR_false
Test
false_OR_false
Introduced at
stats.go ×1 Frontier kind: Joint frontier
Covered ranges
8
Covered lines
16
Covered files
1

Co-introduced tests

3 other tests enter at the same concept.

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/taskqueue/stats.go 16 covered LOC · 8 ranges

Open complete file

7
8 // MergeStats merges from into into. Mutates into.
9 > func MergeStats(into, from *taskqueuepb.TaskQueueStats) { stats.go
10 > if from == nil {
11 return
12 }
13 > into.ApproximateBacklogCount += from.ApproximateBacklogCount stats.go
14 > into.ApproximateBacklogAge = oldestBacklogAge(into.ApproximateBacklogAge, from.ApproximateBacklogAge)
15 > into.TasksAddRate += from.TasksAddRate
16 > into.TasksDispatchRate += from.TasksDispatchRate
17 > into.RateLimitingActive = into.RateLimitingActive || from.RateLimitingActive
18 }
19
31 }
32
33 > func oldestBacklogAge(left, right *durationpb.Duration) *durationpb.Duration { stats.go
34 > if left == nil {
35 > left = durationpb.New(0) stats.go
36 > }
37 > if right == nil { stats.go
38 > right = durationpb.New(0) stats.go
39 > }
40 > if left.AsDuration() > right.AsDuration() { stats.go
41 return left
42 }
43 > return right stats.go
44 }