Skip to content

Commit e6286bd

Browse files
committed
MB-24142: Use correct unit for slowTask recording
Change-Id: I388eb43fea01f8b79f5a122afa2c68757736fb81 Reviewed-on: http://review.couchbase.org/84424 Well-Formed: Build Bot <[email protected]> Tested-by: Build Bot <[email protected]> Reviewed-by: Daniel Owen <[email protected]>
1 parent 4ea2003 commit e6286bd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/executorthread.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ void ExecutorThread::run() {
129129
addLogEntry(currentTask->getTaskable().getName() +
130130
currentTask->getDescription(),
131131
q->getQueueType(), runtime, startReltime,
132-
(runtime > std::chrono::seconds(
133-
currentTask->maxExpectedDuration())));
132+
(runtime > currentTask->maxExpectedDuration()));
134133

135134
if (engine) {
136135
ObjectRegistry::onSwitchThread(engine);

src/tasks.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ friend class TaskQueue;
9595
*/
9696
virtual std::string getDescription(void) = 0;
9797

98-
virtual int maxExpectedDuration(void) {
99-
return 3600;
98+
/**
99+
* The maximum expected duration of this task. Any tasks taking longer than
100+
* this to run will be logged as "slow".
101+
*/
102+
virtual std::chrono::microseconds maxExpectedDuration() {
103+
return std::chrono::microseconds(3600);
100104
}
101105

102106
/**

0 commit comments

Comments
 (0)