Skip to content

Commit

Permalink
Change back job duration timer label
Browse files Browse the repository at this point in the history
  • Loading branch information
ptoffy committed Nov 26, 2024
1 parent d3256eb commit dadc6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Queues/QueueWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion Tests/QueuesTests/MetricsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit dadc6ac

Please sign in to comment.