MB-24142: Use correct unit for slowTask recording 24/84424/3 4.6.4 v4.6.4
authorDave Rigby <daver@couchbase.com>
Thu, 27 Apr 2017 15:18:53 +0000 (16:18 +0100)
committerDave Rigby <daver@couchbase.com>
Mon, 16 Oct 2017 13:49:55 +0000 (13:49 +0000)
Change-Id: I388eb43fea01f8b79f5a122afa2c68757736fb81
Reviewed-on: http://review.couchbase.org/84424
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Daniel Owen <owend@couchbase.com>
src/executorthread.cc
src/tasks.h

index c2423f7..c6e2026 100644 (file)
@@ -129,8 +129,7 @@ void ExecutorThread::run() {
             addLogEntry(currentTask->getTaskable().getName() +
                         currentTask->getDescription(),
                        q->getQueueType(), runtime, startReltime,
-                       (runtime > std::chrono::seconds(
-                               currentTask->maxExpectedDuration())));
+                       (runtime > currentTask->maxExpectedDuration()));
 
             if (engine) {
                 ObjectRegistry::onSwitchThread(engine);
index a528b9e..1f9a319 100644 (file)
@@ -95,8 +95,12 @@ public:
      */
     virtual std::string getDescription(void) = 0;
 
-    virtual int maxExpectedDuration(void) {
-        return 3600;
+    /**
+     * The maximum expected duration of this task. Any tasks taking longer than
+     * this to run will be logged as "slow".
+     */
+    virtual std::chrono::microseconds maxExpectedDuration() {
+        return std::chrono::microseconds(3600);
     }
 
     /**