Skip to content

Commit da1cc6b

Browse files
rkannan82claude
andcommitted
Use explicit type switches and remove taskQueueBreakdown override
- Match StickyPartition explicitly instead of using default case - Default to unknownValue for unrecognized partition types - Remove taskQueueBreakdown=false override; BreakdownMetricsByTaskQueue already controls this Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 323e85c commit da1cc6b

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

common/metrics/task_queues.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ func GetPerTaskQueuePartitionIDScope(
6363
} else {
6464
value = normal
6565
}
66+
case *tqid.StickyPartition:
67+
value = sticky
6668
case *tqid.WorkerCommandsPartition:
6769
value = workerCommands
68-
taskQueueBreakdown = false
6970
default:
70-
value = sticky
71+
value = unknownValue
7172
}
7273

7374
return GetPerTaskQueueScope(handler, namespaceName, partition.TaskQueue(), taskQueueBreakdown,
@@ -89,11 +90,12 @@ func GetPerTaskQueuePartitionTypeScope(
8990
value = unknownValue
9091
case *tqid.NormalPartition:
9192
value = normal
93+
case *tqid.StickyPartition:
94+
value = sticky
9295
case *tqid.WorkerCommandsPartition:
9396
value = workerCommands
94-
taskQueueBreakdown = false
9597
default:
96-
value = sticky
98+
value = unknownValue
9799
}
98100

99101
return GetPerTaskQueueScope(handler, namespaceName, partition.TaskQueue(), taskQueueBreakdown,

service/matching/matching_engine_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5259,9 +5259,9 @@ func TestLoggerAndMetricsForPartition_BreakdownEnabled(t *testing.T) {
52595259
expectPartitionTag: "0",
52605260
},
52615261
{
5262-
name: "worker-commands queue gets __worker_commands__ partition and __omitted__ taskqueue",
5262+
name: "worker-commands queue gets __worker_commands__ partition tag",
52635263
partition: newTestTaskQueue(ns.ID().String(), "my-task-queue", enumspb.TASK_QUEUE_TYPE_NEXUS).WorkerCommandsPartition("/temporal-sys/worker-commands/ns/key"),
5264-
expectTQValue: "__omitted__",
5264+
expectTQValue: "my-task-queue",
52655265
expectPartitionTag: "__worker_commands__",
52665266
},
52675267
{

0 commit comments

Comments
 (0)