diff --git a/Sources/Queues/QueueWorker.swift b/Sources/Queues/QueueWorker.swift index 8aaa32f..ff585ea 100644 --- a/Sources/Queues/QueueWorker.swift +++ b/Sources/Queues/QueueWorker.swift @@ -128,7 +128,7 @@ public struct QueueWorker: Sendable { error: (any Error)? = nil ) { Timer( - label: "\(jobName).duration.timer", + label: "\(jobName).jobDurationTimer", dimensions: [ ("success", error == nil ? "true" : "false"), ("jobName", jobName), diff --git a/Tests/QueuesTests/MetricsTests.swift b/Tests/QueuesTests/MetricsTests.swift index c52252d..6051c92 100644 --- a/Tests/QueuesTests/MetricsTests.swift +++ b/Tests/QueuesTests/MetricsTests.swift @@ -39,7 +39,7 @@ final class MetricsTests: XCTestCase { try await self.app.queues.queue.worker.run() - let timer = try XCTUnwrap(self.metrics.timers.first(where: { $0.label == "MyAsyncJob.duration.timer" })) + let timer = try XCTUnwrap(self.metrics.timers.first(where: { $0.label == "MyAsyncJob.jobDurationTimer" })) let successDimension = try XCTUnwrap(timer.dimensions.first(where: { $0.0 == "success" })) let idDimension = try XCTUnwrap(timer.dimensions.first(where: { $0.0 == "jobName" })) XCTAssertEqual(successDimension.1, "true")