Skip to content

Commit

Permalink
atlas: limit task timer to just the task
Browse files Browse the repository at this point in the history
Will look at the lock time separately. Helps to avoid
confusion about how long the actual work of the task
is taking.
  • Loading branch information
brharrington committed Mar 14, 2024
1 parent 4d993c6 commit a8295c7
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,13 @@ private void timePublishTask(String id, Runnable task) {
}

private void timePublishTask(String id, String lockName, Runnable task) {
publishTaskTimer(id).recordRunnable(() -> {
Lock lock = publishTaskLocks.computeIfAbsent(lockName, n -> new ReentrantLock());
lock.lock();
try {
task.run();
} finally {
lock.unlock();
}
});
Lock lock = publishTaskLocks.computeIfAbsent(lockName, n -> new ReentrantLock());
lock.lock();
try {
publishTaskTimer(id).recordRunnable(task);
} finally {
lock.unlock();
}
}

void sendToAtlas() {
Expand Down

0 comments on commit a8295c7

Please sign in to comment.