MB-24141: Use correct unit for slowTask recording 48/77448/2
authorDave Rigby <daver@couchbase.com>
Thu, 27 Apr 2017 15:18:53 +0000 (16:18 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 27 Apr 2017 20:28:36 +0000 (20:28 +0000)
Change-Id: I388eb43fea01f8b79f5a122afa2c68757736fb81
Reviewed-on: http://review.couchbase.org/77448
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Manu Dhundi <manu@couchbase.com>
src/executorthread.cc
src/globaltask.h

index 3618dd7..85ee813 100644 (file)
@@ -134,8 +134,7 @@ void ExecutorThread::run() {
             addLogEntry(currentTask->getTaskable().getName() +
                         to_string(currentTask->getDescription()),
                        q->getQueueType(), runtime, startReltime,
-                       (runtime > std::chrono::seconds(
-                               currentTask->maxExpectedDuration())));
+                       (runtime > currentTask->maxExpectedDuration()));
 
             if (engine) {
                 ObjectRegistry::onSwitchThread(engine);
index 44b8244..ac209b4 100644 (file)
@@ -87,8 +87,12 @@ public:
      */
     virtual cb::const_char_buffer getDescription() = 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);
     }
 
     /**