浏览代码

HPCC-15479 Fix Roxie not logging query COMPLETE

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Anthony Fishbeck 9 年之前
父节点
当前提交
daa67804cd
共有 3 个文件被更改,包括 10 次插入9 次删除
  1. 8 8
      roxie/ccd/ccdlistener.cpp
  2. 1 0
      roxie/ccd/ccdprotocol.cpp
  3. 1 1
      roxie/ccd/hpccprotocol.hpp

+ 8 - 8
roxie/ccd/ccdlistener.cpp

@@ -962,7 +962,7 @@ public:
         UNIMPLEMENTED;
     }
 
-    virtual void noteQuery(IHpccProtocolMsgContext *msgctx, const char *peer, bool failed, unsigned bytesOut, unsigned elapsed, unsigned priority, unsigned memused, unsigned slavesReplyLen, bool continuationNeeded)
+    virtual void noteQuery(IHpccProtocolMsgContext *msgctx, const char *peer, bool failed, unsigned bytesOut, unsigned elapsed, unsigned memused, unsigned slavesReplyLen, bool continuationNeeded)
     {
     }
 
@@ -1432,7 +1432,7 @@ public:
     {
         return queryFactory ? queryFactory->queryOptions().priority : (unsigned) -2;
     }
-    void noteQueryStats(bool failed, unsigned elapsedTime, unsigned priority)
+    void noteQueryStats(bool failed, unsigned elapsedTime)
     {
         Owned <IJlibDateTime> now = createDateTimeNow();
         unsigned y,mo,d,h,m,s,n;
@@ -1441,7 +1441,7 @@ public:
         lastQueryTime = h*10000 + m * 100 + s;
         lastQueryDate = y*10000 + mo * 100 + d;
 
-        switch(priority)
+        switch(getQueryPriority())
         {
         case 0: loQueryStats.noteQuery(failed, elapsedTime); break;
         case 1: hiQueryStats.noteQuery(failed, elapsedTime); break;
@@ -1450,9 +1450,9 @@ public:
         }
         combinedQueryStats.noteQuery(failed, elapsedTime);
     }
-    void noteQuery(const char *peer, bool failed, unsigned elapsed, unsigned memused, unsigned slavesReplyLen, unsigned bytesOut, unsigned priority, bool continuationNeeded)
+    void noteQuery(const char *peer, bool failed, unsigned elapsed, unsigned memused, unsigned slavesReplyLen, unsigned bytesOut, bool continuationNeeded)
     {
-        noteQueryStats(failed, elapsed, priority);
+        noteQueryStats(failed, elapsed);
         if (queryFactory)
         {
             queryFactory->noteQuery(startTime, failed, elapsed, memused, slavesReplyLen, bytesOut);
@@ -1464,7 +1464,7 @@ public:
             {
                 StringBuffer s;
                 logctx->getStats(s);
-                logctx->CTXLOG("COMPLETE: %s %s from %s complete in %d msecs memory=%d Mb priority=%d slavesreply=%d resultsize=%d continue=%d%s", queryName.get(), uid.get(), peer, elapsed, memused, priority, slavesReplyLen, bytesOut, continuationNeeded, s.str());
+                logctx->CTXLOG("COMPLETE: %s %s from %s complete in %d msecs memory=%d Mb priority=%d slavesreply=%d resultsize=%d continue=%d%s", queryName.get(), uid.get(), peer, elapsed, memused, getQueryPriority(), slavesReplyLen, bytesOut, continuationNeeded, s.str());
             }
         }
     }
@@ -1729,10 +1729,10 @@ public:
         roxieMsgCtx->ensureDebugCommandHandler().doDebugCommand(msg, &roxieMsgCtx->ensureDebuggerContext(uid), out);
     }
 
-    virtual void noteQuery(IHpccProtocolMsgContext *msgctx, const char *peer, bool failed, unsigned bytesOut, unsigned elapsed, unsigned priority, unsigned memused, unsigned slavesReplyLen, bool continuationNeeded)
+    virtual void noteQuery(IHpccProtocolMsgContext *msgctx, const char *peer, bool failed, unsigned bytesOut, unsigned elapsed, unsigned memused, unsigned slavesReplyLen, bool continuationNeeded)
     {
         RoxieProtocolMsgContext *roxieMsgCtx = checkGetRoxieMsgContext(msgctx);
-        roxieMsgCtx->noteQuery(peer, failed, elapsed, memused, slavesReplyLen, bytesOut, priority, continuationNeeded);
+        roxieMsgCtx->noteQuery(peer, failed, elapsed, memused, slavesReplyLen, bytesOut, continuationNeeded);
     }
 
 };

+ 1 - 0
roxie/ccd/ccdprotocol.cpp

@@ -1947,6 +1947,7 @@ readAnother:
         }
         unsigned bytesOut = client? client->bytesOut() : 0;
         unsigned elapsed = msTick() - qstart;
+        sink->noteQuery(msgctx.get(), peerStr, failed, bytesOut, elapsed,  memused, slavesReplyLen, continuationNeeded);
         if (continuationNeeded)
         {
             rawText.clear();

+ 1 - 1
roxie/ccd/hpccprotocol.hpp

@@ -96,7 +96,7 @@ interface IHpccProtocolMsgSink : extends IInterface
     virtual IHpccProtocolMsgContext *createMsgContext(time_t startTime) = 0;
     virtual StringArray &getTargetNames(StringArray &targets) = 0;
 
-    virtual void noteQuery(IHpccProtocolMsgContext *msgctx, const char *peer, bool failed, unsigned bytesOut, unsigned elapsed, unsigned priority, unsigned memused, unsigned slavesReplyLen, bool continuationNeeded) = 0;
+    virtual void noteQuery(IHpccProtocolMsgContext *msgctx, const char *peer, bool failed, unsigned bytesOut, unsigned elapsed, unsigned memused, unsigned slavesReplyLen, bool continuationNeeded) = 0;
     virtual void onQueryMsg(IHpccProtocolMsgContext *msgctx, IPropertyTree *msg, IHpccProtocolResponse *protocol, unsigned flags, PTreeReaderOptions readFlags, const char *target, unsigned idx, unsigned &memused, unsigned &slaveReplyLen) = 0;
 };