From 9d4deab87eab4e4ce5dfd53fcf2a827ebd931524 Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Fri, 23 Jun 2023 03:22:37 +0100 Subject: [PATCH] HPCC-29492 Eliminate querySeeks, queryScan & queryWildSeeks for hThor and Roxie Signed-off-by: Shamser Ahmed --- common/thorhelper/thorcommon.hpp | 103 +++++++++++++++++++++++++++++++ ecl/hthor/hthor.ipp | 4 ++ ecl/hthor/hthorkey.cpp | 88 +++++++++----------------- fs/dafsclient/rmtfile.cpp | 4 -- roxie/ccd/ccd.hpp | 4 ++ roxie/ccd/ccdactivities.cpp | 14 ++++- roxie/ccd/ccdcontext.cpp | 9 ++- roxie/ccd/ccdserver.cpp | 8 +++ system/jhtree/jhtree.cpp | 63 ++++++++----------- system/jhtree/jhtree.hpp | 13 ---- system/jlib/jlog.cpp | 4 ++ system/jlib/jlog.hpp | 1 + system/jlib/jstats.cpp | 22 +++++++ system/jlib/jstats.h | 20 +++++- system/jlib/jtrace.hpp | 2 +- thorlcr/thorutil/thormisc.cpp | 22 ------- thorlcr/thorutil/thormisc.hpp | 94 +--------------------------- 17 files changed, 241 insertions(+), 234 deletions(-) diff --git a/common/thorhelper/thorcommon.hpp b/common/thorhelper/thorcommon.hpp index fd2959f3a3a..624a70f1488 100644 --- a/common/thorhelper/thorcommon.hpp +++ b/common/thorhelper/thorcommon.hpp @@ -18,6 +18,7 @@ #ifndef THORCOMMON_HPP #define THORCOMMON_HPP +#include "jlog.hpp" #include "jiface.hpp" #include "jcrc.hpp" #include "jlzw.hpp" @@ -672,6 +673,108 @@ class THORHELPER_API IndirectCodeContext : implements ICodeContext protected: ICodeContext * ctx; }; +class CThorBaseContextLogger : public CSimpleInterfaceOf +{ +protected: + unsigned traceLevel = 1; + LogTrace logTrace; + mutable CRuntimeStatisticCollection stats; + +public: + CThorBaseContextLogger() : stats(jhtreeCacheStatistics) + { + } + virtual void CTXLOG(const char *format, ...) const override __attribute__((format(printf,2,3))) + { + va_list args; + va_start(args, format); + CTXLOGva(MCdebugProgress, unknownJob, NoLogMsgCode, format, args); + va_end(args); + } + + virtual void CTXLOGva(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char *format, va_list args) const override __attribute__((format(printf,5,0))) + { + VALOG(cat, job, code, format, args); + } + virtual void logOperatorExceptionVA(IException *E, const char *file, unsigned line, const char *format, va_list args) const __attribute__((format(printf,5,0))) + { + StringBuffer ss; + ss.append("ERROR"); + if (E) + ss.append(": ").append(E->errorCode()); + if (file) + ss.appendf(": %s(%d) ", file, line); + if (E) + E->errorMessage(ss.append(": ")); + if (format) + ss.append(": ").valist_appendf(format, args); + LOG(MCoperatorProgress, unknownJob, "%s", ss.str()); + } + virtual void noteStatistic(StatisticKind kind, unsigned __int64 value) const override + { + stats.addStatisticAtomic(kind, value); + } + virtual void setStatistic(StatisticKind kind, unsigned __int64 value) const override + { + stats.setStatistic(kind, value); + } + virtual void mergeStats(const CRuntimeStatisticCollection &from) const override + { + stats.merge(from); + } + virtual unsigned queryTraceLevel() const override + { + return traceLevel; + } + virtual void setGlobalId(const char *id, SocketEndpoint &ep, unsigned pid) override + { + logTrace.setGlobalId(id); + } + virtual void setCallerId(const char *id) override + { + logTrace.setCallerId(id); + } + virtual const char *queryGlobalId() const override + { + return logTrace.queryGlobalId(); + } + virtual const char *queryLocalId() const override + { + return logTrace.queryLocalId(); + } + virtual const char *queryCallerId() const override + { + return logTrace.queryCallerId(); + } + virtual void setHttpIdHeaderNames(const char *global, const char *caller) override + { + logTrace.setHttpIdHeaderNames(global, caller); + } + virtual const char *queryGlobalIdHttpHeaderName() const override + { + return logTrace.queryGlobalIdHTTPHeaderName(); + } + virtual const char *queryCallerIdHttpHeaderName() const override + { + return logTrace.queryCallerIdHTTPHeaderName(); + } + virtual const CRuntimeStatisticCollection &queryStats() const override + { + return stats; + } + virtual void recordStatistics(IStatisticGatherer &progress) const override + { + stats.recordStatistics(progress, false); + } + void updateStatsDeltaTo(CRuntimeStatisticCollection &to, CRuntimeStatisticCollection &previous) + { + previous.updateDelta(to, stats); + } + void reset() + { + stats.reset(); + } +}; extern THORHELPER_API bool isActivitySink(ThorActivityKind kind); extern THORHELPER_API bool isActivitySource(ThorActivityKind kind); diff --git a/ecl/hthor/hthor.ipp b/ecl/hthor/hthor.ipp index b76e2c1a214..9ee40fcdd47 100644 --- a/ecl/hthor/hthor.ipp +++ b/ecl/hthor/hthor.ipp @@ -3239,6 +3239,10 @@ protected: void onLimitExceeded(); }; +// improvement: override constructor to store setHttpIdHeaderNames, override CTXLOG & logOperatorExceptionVA to log LogMsgJobInfo +class CHThorContextLogger : public CThorBaseContextLogger +{ +}; #define MAKEFACTORY(NAME) \ extern HTHOR_API IHThorActivity * create ## NAME ## Activity(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThor ## NAME ## Arg &arg, ThorActivityKind kind, EclGraph & _graph) \ diff --git a/ecl/hthor/hthorkey.cpp b/ecl/hthor/hthorkey.cpp index 82e1ede5d56..01344085b3f 100644 --- a/ecl/hthor/hthorkey.cpp +++ b/ecl/hthor/hthorkey.cpp @@ -200,24 +200,10 @@ class CHThorIndexReadActivityBase : public CHThorActivityBase { CHThorActivityBase::updateProgress(progress); StatsActivityScope scope(progress, activityId); + contextLogger.recordStatistics(progress); progress.addStatistic(StNumPostFiltered, queryPostFiltered()); - progress.addStatistic(StNumIndexSeeks, querySeeks()); - progress.addStatistic(StNumIndexScans, queryScans()); - progress.addStatistic(StNumIndexWildSeeks, queryWildSeeks()); } - virtual unsigned querySeeks() const - { - return seeks + (klManager ? klManager->querySeeks() : 0); - } - virtual unsigned queryScans() const - { - return scans + (klManager ? klManager->queryScans() : 0); - } - virtual unsigned queryWildSeeks() const - { - return wildseeks + (klManager ? klManager->queryWildSeeks() : 0); - } virtual unsigned queryPostFiltered() const { return postFiltered; @@ -281,10 +267,8 @@ class CHThorIndexReadActivityBase : public CHThorActivityBase UnsignedArray superIndexCache; unsigned keyIndexCacheIdx = 0; - unsigned seeks; - unsigned scans; unsigned postFiltered; - unsigned wildseeks; + CHThorContextLogger contextLogger; bool singlePart = false; // a single part index, not part of a super file - optimize so never reload the part. bool localSortKey = false; bool initializedFileInfo = false; @@ -313,9 +297,6 @@ CHThorIndexReadActivityBase::CHThorIndexReadActivityBase(IAgentContext &_agent, eclKeySize.set(helper.queryDiskRecordSize()); postFiltered = 0; - seeks = 0; - scans = 0; - wildseeks = 0; helper.setCallback(&callback); limitTransformExtra = nullptr; if (_node) @@ -437,7 +418,7 @@ bool CHThorIndexReadActivityBase::doPreopenLimitFile(unsigned __int64 & count, u { Owned tlk = openKeyFile(df->queryPart(num)); verifyIndex(tlk); - Owned tlman = createLocalKeyManager(eclKeySize.queryRecordAccessor(true), tlk, NULL, helper.hasNewSegmentMonitors(), false); + Owned tlman = createLocalKeyManager(eclKeySize.queryRecordAccessor(true), tlk, &contextLogger, helper.hasNewSegmentMonitors(), false); initManager(tlman, true); while(tlman->lookup(false) && (count<=limit)) { @@ -473,7 +454,7 @@ IKeyIndex * CHThorIndexReadActivityBase::doPreopenLimitPart(unsigned __int64 & r verifyIndex(kidx); if (limit != (unsigned) -1) { - Owned kman = createLocalKeyManager(eclKeySize.queryRecordAccessor(true), kidx, NULL, helper.hasNewSegmentMonitors(), false); + Owned kman = createLocalKeyManager(eclKeySize.queryRecordAccessor(true), kidx, &contextLogger, helper.hasNewSegmentMonitors(), false); initManager(kman, false); result += kman->checkCount(limit-result); } @@ -572,10 +553,10 @@ void CHThorIndexReadActivityBase::initManager(IKeyManager *manager, bool isTlk) manager->reset(); } -void CHThorIndexReadActivityBase::initPart() -{ +void CHThorIndexReadActivityBase::initPart() +{ assertex(!keyIndex->isTopLevelKey()); - klManager.setown(createLocalKeyManager(eclKeySize.queryRecordAccessor(true), keyIndex, NULL, helper.hasNewSegmentMonitors(), false)); + klManager.setown(createLocalKeyManager(eclKeySize.queryRecordAccessor(true), keyIndex, &contextLogger, helper.hasNewSegmentMonitors(), false)); initManager(klManager, false); callback.setManager(klManager, nullptr); } @@ -584,12 +565,7 @@ void CHThorIndexReadActivityBase::killPart() { callback.setManager(nullptr, nullptr); if (klManager) - { - seeks += klManager->querySeeks(); - scans += klManager->queryScans(); - wildseeks += klManager->queryWildSeeks(); klManager.clear(); - } } bool CHThorIndexReadActivityBase::setCurrentPart(unsigned whichPart) @@ -606,7 +582,7 @@ bool CHThorIndexReadActivityBase::firstMultiPart() if(!tlk) openTlk(); verifyIndex(tlk); - tlManager.setown(createLocalKeyManager(eclKeySize.queryRecordAccessor(true), tlk, NULL, helper.hasNewSegmentMonitors(), false)); + tlManager.setown(createLocalKeyManager(eclKeySize.queryRecordAccessor(true), tlk, &contextLogger, helper.hasNewSegmentMonitors(), false)); initManager(tlManager, true); nextPartNumber = 0; return nextMultiPart(); @@ -3036,11 +3012,11 @@ class KeyedLookupPartHandler : extends ThreadedPartHandler, implements Owned manager; IAgentContext &agent; DistributedKeyLookupHandler * tlk; - + CHThorContextLogger &contextLogger; public: IMPLEMENT_IINTERFACE; - KeyedLookupPartHandler(IJoinProcessor &_owner, IDistributedFilePart *_part, DistributedKeyLookupHandler * _tlk, unsigned _subno, IThreadPool * _threadPool, IAgentContext &_agent); + KeyedLookupPartHandler(IJoinProcessor &_owner, IDistributedFilePart *_part, DistributedKeyLookupHandler * _tlk, unsigned _subno, IThreadPool * _threadPool, IAgentContext &_agent, CHThorContextLogger & _contextLogger); ~KeyedLookupPartHandler() { @@ -3090,6 +3066,7 @@ class DistributedKeyLookupHandler : public CInterface, implements IThreadedExcep Owned threadPool; IntArray subSizes; IAgentContext &agent; + CHThorContextLogger &contextLogger; void addFile(IDistributedFile &f) { @@ -3100,7 +3077,7 @@ class DistributedKeyLookupHandler : public CInterface, implements IThreadedExcep for (unsigned idx = 0; idx < numParts; idx++) { IDistributedFilePart *part = f.getPart(idx); - parts.append(*new KeyedLookupPartHandler(owner, part, this, tlks.ordinality(), threadPool, agent)); + parts.append(*new KeyedLookupPartHandler(owner, part, this, tlks.ordinality(), threadPool, agent, contextLogger)); } keyFiles.append(OLINK(f)); tlks.append(*f.getPart(numParts)); @@ -3110,8 +3087,8 @@ class DistributedKeyLookupHandler : public CInterface, implements IThreadedExcep public: IMPLEMENT_IINTERFACE; - DistributedKeyLookupHandler(IDistributedFile *f, IJoinProcessor &_owner, IAgentContext &_agent) - : owner(_owner), file(f), agent(_agent) + DistributedKeyLookupHandler(IDistributedFile *f, IJoinProcessor &_owner, IAgentContext &_agent, CHThorContextLogger & _contextLogger) + : owner(_owner), file(f), agent(_agent), contextLogger(_contextLogger) { threadPool.setown(createThreadPool("hthor keyed join lookup thread pool", &threadFactory)); IDistributedSuperFile *super = f->querySuperFile(); @@ -3176,7 +3153,7 @@ class DistributedKeyLookupHandler : public CInterface, implements IThreadedExcep //Owned trans.setown(owner.getLayoutTranslator(&f)); owner.verifyIndex(&f, index, trans); - Owned manager = createLocalKeyManager(owner.queryIndexRecord(), index, NULL, owner.hasNewSegmentMonitors(), false); + Owned manager = createLocalKeyManager(owner.queryIndexRecord(), index, &contextLogger, owner.hasNewSegmentMonitors(), false); managers.append(*manager.getLink()); } opened = true; @@ -3205,8 +3182,8 @@ class DistributedKeyLookupHandler : public CInterface, implements IThreadedExcep const IDynamicTransform * queryRecordLayoutTranslator() const { return trans; } }; -KeyedLookupPartHandler::KeyedLookupPartHandler(IJoinProcessor &_owner, IDistributedFilePart *_part, DistributedKeyLookupHandler * _tlk, unsigned _subno, IThreadPool * _threadPool, IAgentContext &_agent) - : ThreadedPartHandler(_part, _tlk, _threadPool), owner(_owner), agent(_agent), tlk(_tlk) +KeyedLookupPartHandler::KeyedLookupPartHandler(IJoinProcessor &_owner, IDistributedFilePart *_part, DistributedKeyLookupHandler * _tlk, unsigned _subno, IThreadPool * _threadPool, IAgentContext &_agent, CHThorContextLogger & _contextLogger) + : ThreadedPartHandler(_part, _tlk, _threadPool), owner(_owner), agent(_agent), tlk(_tlk), contextLogger(_contextLogger) { } @@ -3215,7 +3192,7 @@ void KeyedLookupPartHandler::openPart() if(manager) return; Owned index = openKeyFile(*part); - manager.setown(createLocalKeyManager(owner.queryIndexRecord(), index, NULL, owner.hasNewSegmentMonitors(), false)); + manager.setown(createLocalKeyManager(owner.queryIndexRecord(), index, &contextLogger, owner.hasNewSegmentMonitors(), false)); const IDynamicTransform * trans = tlk->queryRecordLayoutTranslator(); if(trans && !index->isTopLevelKey()) manager->setLayoutTranslator(trans); @@ -3230,13 +3207,14 @@ class MonolithicKeyLookupHandler : public CInterface, implements IKeyLookupHandl IJoinProcessor &owner; IAgentContext &agent; bool opened; + CHThorContextLogger &contextLogger; public: IMPLEMENT_IINTERFACE; - MonolithicKeyLookupHandler(IDistributedFile *f, IJoinProcessor &_owner, IAgentContext &_agent) - : file(f), owner(_owner), agent(_agent), opened(false) + MonolithicKeyLookupHandler(IDistributedFile *f, IJoinProcessor &_owner, IAgentContext &_agent, CHThorContextLogger & _contextLogger) + : file(f), owner(_owner), agent(_agent), opened(false), contextLogger(_contextLogger) { super = f->querySuperFile(); if (super) @@ -3295,7 +3273,7 @@ class MonolithicKeyLookupHandler : public CInterface, implements IKeyLookupHandl { Owned index = openKeyFile(f.queryPart(0)); owner.verifyIndex(&f, index, trans); - manager.setown(createLocalKeyManager(owner.queryIndexRecord(), index, NULL, owner.hasNewSegmentMonitors(), false)); + manager.setown(createLocalKeyManager(owner.queryIndexRecord(), index, &contextLogger, owner.hasNewSegmentMonitors(), false)); } else { @@ -3308,7 +3286,7 @@ class MonolithicKeyLookupHandler : public CInterface, implements IKeyLookupHandl parts->addIndex(index.getLink()); } owner.verifyIndex(&f, index, trans); - manager.setown(createKeyMerger(owner.queryIndexRecord(), parts, 0, nullptr, owner.hasNewSegmentMonitors(), false)); + manager.setown(createKeyMerger(owner.queryIndexRecord(), parts, 0, &contextLogger, owner.hasNewSegmentMonitors(), false)); } if(trans) manager->setLayoutTranslator(trans); @@ -3404,9 +3382,6 @@ class CHThorKeyedJoinActivity : public CHThorThreadedActivityBase, implements I RelaxedAtomic prefiltered; RelaxedAtomic postfiltered; RelaxedAtomic skips; - unsigned seeks; - unsigned scans; - unsigned wildseeks; OwnedRowArray extractedRows; Owned ldFile; IDistributedFile * dFile; @@ -3418,6 +3393,8 @@ class CHThorKeyedJoinActivity : public CHThorThreadedActivityBase, implements I Owned translator; RecordTranslationMode recordTranslationModeHint = RecordTranslationMode::Unspecified; bool isCodeSigned = false; + CHThorContextLogger contextLogger; + public: CHThorKeyedJoinActivity(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThorKeyedJoinArg &_arg, ThorActivityKind _kind, EclGraph & _graph, IPropertyTree *_node) : CHThorThreadedActivityBase(_agent, _activityId, _subgraphId, _arg, _arg, _kind, _graph, _arg.queryDiskRecordSize(), _node), helper(_arg) @@ -3425,8 +3402,6 @@ class CHThorKeyedJoinActivity : public CHThorThreadedActivityBase, implements I prefiltered = 0; postfiltered = 0; skips = 0; - seeks = 0; - scans = 0; eclKeySize.set(helper.queryIndexRecordSize()); if (_node) { @@ -3982,9 +3957,9 @@ class CHThorKeyedJoinActivity : public CHThorThreadedActivityBase, implements I mono = useMonolithic(*dFile); } if (mono) - lookup.setown(new MonolithicKeyLookupHandler(dFile, *this, agent)); + lookup.setown(new MonolithicKeyLookupHandler(dFile, *this, agent, contextLogger)); else - lookup.setown(new DistributedKeyLookupHandler(dFile, *this, agent)); + lookup.setown(new DistributedKeyLookupHandler(dFile, *this, agent, contextLogger)); agent.logFileAccess(dFile, "HThor", "READ", graph); } else @@ -4002,15 +3977,12 @@ class CHThorKeyedJoinActivity : public CHThorThreadedActivityBase, implements I manager->finishSegmentMonitors(); manager->reset(); manager->resetCounts(); + contextLogger.reset(); } virtual void doneManager(IKeyManager * manager) { manager->releaseSegmentMonitors(); - CriticalBlock b(statsCrit); - seeks += manager->querySeeks(); - scans += manager->queryScans(); - wildseeks += manager->queryWildSeeks(); } virtual bool addMatch(MatchSet * ms, IKeyManager * manager) @@ -4081,9 +4053,7 @@ class CHThorKeyedJoinActivity : public CHThorThreadedActivityBase, implements I progress.addStatistic(StNumPreFiltered, prefiltered); progress.addStatistic(StNumPostFiltered, postfiltered); progress.addStatistic(StNumIndexSkips, skips); - progress.addStatistic(StNumIndexSeeks, seeks); - progress.addStatistic(StNumIndexScans, scans); - progress.addStatistic(StNumIndexWildSeeks, wildseeks); + contextLogger.recordStatistics(progress); } protected: diff --git a/fs/dafsclient/rmtfile.cpp b/fs/dafsclient/rmtfile.cpp index 7b876e63883..1d1d9c96f42 100644 --- a/fs/dafsclient/rmtfile.cpp +++ b/fs/dafsclient/rmtfile.cpp @@ -2525,10 +2525,6 @@ class CRemoteKey : public CSimpleInterfaceOf pending = true; return prefetchBuffer.queryRow(); } - virtual unsigned querySeeks() const override { return 0; } // not sure how best to handle these, perhaps should log/record somewhere on server-side - virtual unsigned queryScans() const override { return 0; } - virtual unsigned querySkips() const override { return 0; } - virtual unsigned queryWildSeeks() const override { return 0; } }; diff --git a/roxie/ccd/ccd.hpp b/roxie/ccd/ccd.hpp index 0b0c8bc9349..7fa2aaea244 100644 --- a/roxie/ccd/ccd.hpp +++ b/roxie/ccd/ccd.hpp @@ -782,6 +782,10 @@ class ContextLogger : implements IRoxieContextLogger, public CInterface { return stats; } + virtual void recordStatistics(IStatisticGatherer &progress) const override + { + stats.recordStatistics(progress, false); + } }; class StringContextLogger : public ContextLogger diff --git a/roxie/ccd/ccdactivities.cpp b/roxie/ccd/ccdactivities.cpp index 23564e431c0..0d13892613c 100644 --- a/roxie/ccd/ccdactivities.cpp +++ b/roxie/ccd/ccdactivities.cpp @@ -3004,7 +3004,13 @@ class CRoxieIndexReadActivity : public CRoxieIndexActivity, implements IIndexRea if (continuationNeeded && !continuationFailed) { if (doTrace(traceSmartStepping, TraceFlags::Detailed)) - logctx.CTXLOG("Indexread returning partial result set %d rows from %d seeks, %d scans, %d skips", processed-processedBefore, tlk->querySeeks(), tlk->queryScans(), tlk->querySkips()); + { + const CRuntimeStatisticCollection & stats = logctx.queryStats(); + unsigned __int64 seeks = stats.getStatisticValue(StNumIndexSeeks); + unsigned __int64 scans = stats.getStatisticValue(StNumIndexScans); + unsigned __int64 skips = stats.getStatisticValue(StNumIndexSkips); + logctx.CTXLOG("Indexread returning partial result set %d rows from %" I64F"u seeks, %" I64F"u scans, %" I64F"u skips", processed-processedBefore, seeks, scans, skips); + } if (sendContinuation(output)) { noteStats(keyprocessed-keyprocessedBefore, skipped); @@ -3031,7 +3037,11 @@ class CRoxieIndexReadActivity : public CRoxieIndexActivity, implements IIndexRea { if (doTrace(traceSmartStepping, TraceFlags::Max) && !aborted) { - logctx.CTXLOG("Indexread returning result set %d rows from %d seeks, %d scans, %d skips", processed-processedBefore, tlk->querySeeks(), tlk->queryScans(), tlk->querySkips()); + const CRuntimeStatisticCollection & stats = logctx.queryStats(); + unsigned __int64 seeks = stats.getStatisticValue(StNumIndexSeeks); + unsigned __int64 scans = stats.getStatisticValue(StNumIndexScans); + unsigned __int64 skips = stats.getStatisticValue(StNumIndexSkips); + logctx.CTXLOG("Indexread returning result set %d rows from %" I64F"u seeks, %" I64F"u scans, %" I64F"u skips", processed-processedBefore, seeks, scans, skips); if (steppingOffset) logctx.CTXLOG("Indexread return: steppingOffset %d, steppingRow %p, stepExtra.returnMismatches() %d",steppingOffset, steppingRow, (int) stepExtra.returnMismatches()); } diff --git a/roxie/ccd/ccdcontext.cpp b/roxie/ccd/ccdcontext.cpp index c52a0546538..0cdef81b791 100644 --- a/roxie/ccd/ccdcontext.cpp +++ b/roxie/ccd/ccdcontext.cpp @@ -1179,7 +1179,7 @@ class InlineXmlDataReader : public WorkUnitRowReaderBase //--------------------------------------------------------------------------------------- -static const StatisticsMapping graphStatistics({}); +static const StatisticsMapping roxieGraphStatistics({}); class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext, implements roxiemem::ITimeLimiter, implements IRowAllocatorMetaActIdCacheCallback, public CInterface { protected: @@ -1266,7 +1266,7 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext public: IMPLEMENT_IINTERFACE; CRoxieContextBase(const IQueryFactory *_factory, const IRoxieContextLogger &_logctx) - : factory(_factory), options(factory->queryOptions()), logctx(_logctx), globalStats(graphStatistics) + : factory(_factory), options(factory->queryOptions()), logctx(_logctx), globalStats(roxieGraphStatistics) { startTime = lastWuAbortCheck = msTick(); persists = NULL; @@ -1328,7 +1328,10 @@ class CRoxieContextBase : implements IRoxieAgentContext, implements ICodeContext { return logctx.getStats(ret); } - + virtual void recordStatistics(IStatisticGatherer &progress) const override + { + globalStats.recordStatistics(progress, false); + } virtual void CTXLOGa(TracingCategory category, const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char *prefix, const char *text) const override { logctx.CTXLOGa(category, cat, job, code, prefix, text); diff --git a/roxie/ccd/ccdserver.cpp b/roxie/ccd/ccdserver.cpp index 147005f7a80..92389162351 100644 --- a/roxie/ccd/ccdserver.cpp +++ b/roxie/ccd/ccdserver.cpp @@ -232,6 +232,10 @@ class IndirectAgentContext : implements IRoxieAgentContext, public CInterface { ctx->gatherStats(merged); } + virtual void recordStatistics(IStatisticGatherer &progress) const override + { + ctx->recordStatistics(progress); + } virtual bool collectingDetailedStatistics() const { return ctx->collectingDetailedStatistics(); @@ -1399,6 +1403,10 @@ class CRoxieServerActivity : implements CInterfaceOf, impl { return stats; } + virtual void recordStatistics(IStatisticGatherer &progress) const + { + stats.recordStatistics(progress, false); + } virtual bool isPassThrough() { return false; diff --git a/system/jhtree/jhtree.cpp b/system/jhtree/jhtree.cpp index 79ce977dd51..1992927ba3d 100644 --- a/system/jhtree/jhtree.cpp +++ b/system/jhtree/jhtree.cpp @@ -390,31 +390,11 @@ class jhtree_decl CKeyLevelManager : implements IKeyManager, public CInterface return keyCursor ? 1 : 0; } - virtual unsigned querySeeks() const - { - return stats.seeks; - } - - virtual unsigned queryScans() const - { - return stats.scans; - } - - virtual unsigned querySkips() const - { - return stats.skips; - } - virtual void resetCounts() { stats.reset(); } - virtual unsigned queryWildSeeks() const - { - return stats.wildseeks; - } - void setKey(IKeyIndexBase * _key) { ::Release(keyCursor); @@ -1525,7 +1505,6 @@ bool CKeyIndex::prewarmPage(offset_t offset, NodeType type) const CJHSearchNode *CKeyIndex::locateFirstLeafNode(KeyStatsCollector &stats) const { keySeeks++; - stats.seeks++; offset_t leafOffset = keyHdr->getFirstLeafPos(); if (leafOffset != (offset_t)-1) @@ -1556,7 +1535,7 @@ const CJHSearchNode *CKeyIndex::locateFirstLeafNode(KeyStatsCollector &stats) co const CJHSearchNode *CKeyIndex::locateLastLeafNode(KeyStatsCollector &stats) const { keySeeks++; - stats.seeks++; + stats.noteSeeks(1, 0, 0); //Unusual - an index with no elements if (keyHdr->getNumRecords() == 0) @@ -1588,9 +1567,6 @@ const CJHSearchNode *CKeyIndex::locateLastLeafNode(KeyStatsCollector &stats) con void KeyStatsCollector::noteSeeks(unsigned lseeks, unsigned lscans, unsigned lwildseeks) { - seeks += lseeks; - scans += lscans; - wildseeks += lwildseeks; if (ctx) { if (lseeks) ctx->noteStatistic(StNumIndexSeeks, lseeks); @@ -1601,7 +1577,6 @@ void KeyStatsCollector::noteSeeks(unsigned lseeks, unsigned lscans, unsigned lwi void KeyStatsCollector::noteSkips(unsigned lskips, unsigned lnullSkips) { - skips += lskips; if (ctx) { if (lskips) ctx->noteStatistic(StNumIndexSkips, lskips); @@ -1611,11 +1586,6 @@ void KeyStatsCollector::noteSkips(unsigned lskips, unsigned lnullSkips) void KeyStatsCollector::reset() { - seeks = 0; - scans = 0; - wildseeks = 0; - skips = 0; - nullskips = 0; } CKeyCursor::CKeyCursor(CKeyIndex &_key, const IIndexFilterList *_filter, bool _logExcessiveSeeks) @@ -2001,6 +1971,7 @@ bool CKeyCursor::lookupSkip(const void *seek, size32_t seekOffset, size32_t seek else stats.noteSkips(0, 1); bool ret = lookup(true, stats); + #ifdef _DEBUG if (doTrace(traceSmartStepping, TraceFlags::Max)) { @@ -2016,7 +1987,18 @@ bool CKeyCursor::lookupSkip(const void *seek, size32_t seekOffset, size32_t seek { recstr.appendf("%02x ", ((unsigned char *) recordBuffer)[i]); } - DBGLOG("SKIP: Got skips=%02d seeks=%02d scans=%02d : %s", stats.skips, stats.seeks, stats.scans, recstr.str()); + if (stats.ctx) + { + const CRuntimeStatisticCollection &statsCollection = stats.ctx->queryStats(); + unsigned __int64 seeks = statsCollection.getStatisticValue(StNumIndexSeeks); + unsigned __int64 scans = statsCollection.getStatisticValue(StNumIndexScans); + unsigned __int64 skips = statsCollection.getStatisticValue(StNumIndexSkips); + DBGLOG("SKIP: Got skips=%" I64F "u seeks=%" I64F "u scans=%" I64F "u : %s", skips, seeks, scans, recstr.str()); + } + else + { + DBGLOG("SKIP: (no ContextLogger - not tracking stats) : %s", recstr.str()); + } } #endif return ret; @@ -2960,7 +2942,18 @@ class CKeyMerger : public CKeyLevelManager { recstr.appendf("%02x ", ((unsigned char *) keyBuffer)[i]); } - DBGLOG("SKIP: Out skips=%02d seeks=%02d scans=%02d : %s", stats.skips, stats.seeks, stats.scans, recstr.str()); + if (stats.ctx) + { + const CRuntimeStatisticCollection &statsCollection = stats.ctx->queryStats(); + unsigned __int64 seeks = statsCollection.getStatisticValue(StNumIndexSeeks); + unsigned __int64 scans = statsCollection.getStatisticValue(StNumIndexScans); + unsigned __int64 skips = statsCollection.getStatisticValue(StNumIndexSkips); + DBGLOG("SKIP: Out skips=%" I64F "u seeks=%" I64F "u scans=%" I64F "u : %s", skips, seeks, scans, recstr.str()); + } + else + { + DBGLOG("SKIP: (no ContextLogger - not tracking stats) : %s", recstr.str()); + } } #endif if (stats.ctx) @@ -3332,10 +3325,6 @@ extern jhtree_decl IIndexLookup *createIndexLookup(IKeyManager *keyManager) else return nullptr; } - virtual unsigned querySeeks() const override { return keyManager->querySeeks(); } - virtual unsigned queryScans() const override { return keyManager->queryScans(); } - virtual unsigned querySkips() const override { return keyManager->querySkips(); } - virtual unsigned queryWildSeeks() const override { return keyManager->queryWildSeeks(); } }; return new CIndexLookup(keyManager); } diff --git a/system/jhtree/jhtree.hpp b/system/jhtree/jhtree.hpp index 9338cc85278..32aca365da0 100644 --- a/system/jhtree/jhtree.hpp +++ b/system/jhtree/jhtree.hpp @@ -45,11 +45,6 @@ class KeyStatsCollector { public: IContextLogger *ctx; - unsigned seeks = 0; - unsigned scans = 0; - unsigned wildseeks = 0; - unsigned skips = 0; - unsigned nullskips = 0; KeyStatsCollector(IContextLogger *_ctx) : ctx(_ctx) {} void reset(); @@ -258,10 +253,6 @@ interface IIndexLookup : extends IInterface // similar to a small subset of IKey virtual const void *nextKey() = 0; virtual unsigned __int64 getCount() = 0; virtual unsigned __int64 checkCount(unsigned __int64 limit) = 0; - virtual unsigned querySeeks() const = 0; - virtual unsigned queryScans() const = 0; - virtual unsigned querySkips() const = 0; - virtual unsigned queryWildSeeks() const = 0; }; interface IKeyManager : public IInterface, extends IIndexReadContext @@ -283,10 +274,6 @@ interface IKeyManager : public IInterface, extends IIndexReadContext virtual unsigned __int64 checkCount(unsigned __int64 limit) = 0; virtual void serializeCursorPos(MemoryBuffer &mb) = 0; virtual void deserializeCursorPos(MemoryBuffer &mb) = 0; - virtual unsigned querySeeks() const = 0; - virtual unsigned queryScans() const = 0; - virtual unsigned querySkips() const = 0; - virtual unsigned queryWildSeeks() const = 0; virtual const byte *loadBlob(unsigned __int64 blobid, size32_t &blobsize, IContextLogger *ctx) = 0; virtual void releaseBlobs() = 0; virtual void resetCounts() = 0; diff --git a/system/jlib/jlog.cpp b/system/jlib/jlog.cpp index cc6987ba8dc..9ba9759fd27 100644 --- a/system/jlib/jlog.cpp +++ b/system/jlib/jlog.cpp @@ -2899,6 +2899,10 @@ class DummyLogCtx : implements IContextLogger { throwUnexpected(); } + virtual void recordStatistics(IStatisticGatherer &progress) const override + { + throwUnexpected(); + } } dummyContextLogger; extern jlib_decl const IContextLogger &queryDummyContextLogger() diff --git a/system/jlib/jlog.hpp b/system/jlib/jlog.hpp index b711cfc40f1..45f342d2d85 100644 --- a/system/jlib/jlog.hpp +++ b/system/jlib/jlog.hpp @@ -1262,6 +1262,7 @@ interface jlib_decl IContextLogger : extends IInterface virtual void setCallerId(const char *id) = 0; virtual const char *queryCallerId() const = 0; virtual const CRuntimeStatisticCollection & queryStats() const = 0; + virtual void recordStatistics(IStatisticGatherer &progress) const = 0; }; extern jlib_decl StringBuffer &appendGloballyUniqueId(StringBuffer &s); diff --git a/system/jlib/jstats.cpp b/system/jlib/jstats.cpp index 09365063614..f052f970eab 100644 --- a/system/jlib/jstats.cpp +++ b/system/jlib/jstats.cpp @@ -1318,6 +1318,28 @@ bool StatisticsMapping::equals(const StatisticsMapping & other) return true; } +// stat. mappings shared between master and slave activities +const StatisticsMapping spillStatistics({StTimeSpillElapsed, StTimeSortElapsed, StNumSpills, StSizeSpillFile}); +const StatisticsMapping jhtreeCacheStatistics({ StNumIndexSeeks, StNumIndexScans, StNumPostFiltered, StNumIndexWildSeeks, + StNumNodeCacheAdds, StNumLeafCacheAdds, StNumBlobCacheAdds, StNumNodeCacheHits, StNumLeafCacheHits, StNumBlobCacheHits, StCycleNodeLoadCycles, StCycleLeafLoadCycles, + StCycleBlobLoadCycles, StCycleNodeReadCycles, StCycleLeafReadCycles, StCycleBlobReadCycles, StNumNodeDiskFetches, StNumLeafDiskFetches, StNumBlobDiskFetches, + StCycleNodeFetchCycles, StCycleLeafFetchCycles, StCycleBlobFetchCycles}); +const StatisticsMapping basicActivityStatistics({StTimeLocalExecute, StTimeBlocked}); +const StatisticsMapping groupActivityStatistics({StNumGroups, StNumGroupMax}, basicActivityStatistics); +const StatisticsMapping hashJoinActivityStatistics({StNumLeftRows, StNumRightRows}, basicActivityStatistics); +const StatisticsMapping indexReadActivityStatistics({StNumRowsProcessed}, diskReadRemoteStatistics, basicActivityStatistics, jhtreeCacheStatistics); +const StatisticsMapping indexWriteActivityStatistics({StPerReplicated, StNumLeafCacheAdds, StNumNodeCacheAdds, StNumBlobCacheAdds }, basicActivityStatistics, diskWriteRemoteStatistics); +const StatisticsMapping keyedJoinActivityStatistics({ StNumIndexAccepted, StNumPreFiltered, StNumDiskSeeks, StNumDiskAccepted, StNumDiskRejected}, basicActivityStatistics, jhtreeCacheStatistics); +const StatisticsMapping loopActivityStatistics({StNumIterations}, basicActivityStatistics); +const StatisticsMapping lookupJoinActivityStatistics({StNumSmartJoinSlavesDegradedToStd, StNumSmartJoinDegradedToLocal}, basicActivityStatistics); +const StatisticsMapping joinActivityStatistics({StNumLeftRows, StNumRightRows}, basicActivityStatistics, spillStatistics); +const StatisticsMapping diskReadActivityStatistics({StNumDiskRowsRead, }, basicActivityStatistics, diskReadRemoteStatistics); +const StatisticsMapping diskWriteActivityStatistics({StPerReplicated}, basicActivityStatistics, diskWriteRemoteStatistics); +const StatisticsMapping sortActivityStatistics({}, basicActivityStatistics, spillStatistics); +const StatisticsMapping graphStatistics({StNumExecutions, StSizeSpillFile, StSizeGraphSpill, StTimeUser, StTimeSystem, StNumContextSwitches, StSizeMemory, StSizePeakMemory, StSizeRowMemory, StSizePeakRowMemory}, basicActivityStatistics); +const StatisticsMapping diskReadPartStatistics({StNumDiskRowsRead}, diskReadRemoteStatistics); +const StatisticsMapping indexDistribActivityStatistics({}, basicActivityStatistics, jhtreeCacheStatistics); + const StatisticsMapping allStatistics(StKindAll); const StatisticsMapping heapStatistics({StNumAllocations, StNumAllocationScans}); const StatisticsMapping diskLocalStatistics({StCycleDiskReadIOCycles, StSizeDiskRead, StNumDiskReads, StCycleDiskWriteIOCycles, StSizeDiskWrite, StNumDiskWrites, StNumDiskRetries}); diff --git a/system/jlib/jstats.h b/system/jlib/jstats.h index 3c28aff2936..3415f5a096c 100644 --- a/system/jlib/jstats.h +++ b/system/jlib/jstats.h @@ -530,7 +530,6 @@ class jlib_decl CRuntimeStatistic RelaxedAtomic value; }; -interface IContextLogger; class CNestedRuntimeStatisticMap; //The CRuntimeStatisticCollection used to gather statistics for an activity - it has no notion of its scope, but can contain nested scopes. @@ -943,4 +942,23 @@ class jlib_decl RuntimeStatisticTarget : implements IStatisticTarget extern jlib_decl StringBuffer & formatMoney(StringBuffer &out, unsigned __int64 value); extern jlib_decl stat_type aggregateStatistic(StatisticKind kind, IStatisticCollection * statsCollection); +//statistics gathered by the different activities +extern jlib_decl const StatisticsMapping spillStatistics; +extern jlib_decl const StatisticsMapping jhtreeCacheStatistics; +extern jlib_decl const StatisticsMapping basicActivityStatistics; +extern jlib_decl const StatisticsMapping groupActivityStatistics; +extern jlib_decl const StatisticsMapping hashJoinActivityStatistics; +extern jlib_decl const StatisticsMapping indexReadActivityStatistics; +extern jlib_decl const StatisticsMapping indexWriteActivityStatistics; +extern jlib_decl const StatisticsMapping joinActivityStatistics; +extern jlib_decl const StatisticsMapping keyedJoinActivityStatistics; +extern jlib_decl const StatisticsMapping lookupJoinActivityStatistics; +extern jlib_decl const StatisticsMapping loopActivityStatistics; +extern jlib_decl const StatisticsMapping diskReadActivityStatistics; +extern jlib_decl const StatisticsMapping diskReadPartStatistics; +extern jlib_decl const StatisticsMapping diskWriteActivityStatistics; +extern jlib_decl const StatisticsMapping sortActivityStatistics; + +extern jlib_decl const StatisticsMapping graphStatistics; +extern jlib_decl const StatisticsMapping indexDistribActivityStatistics; #endif diff --git a/system/jlib/jtrace.hpp b/system/jlib/jtrace.hpp index 6aa184bbdc0..947ee6f8904 100644 --- a/system/jlib/jtrace.hpp +++ b/system/jlib/jtrace.hpp @@ -201,7 +201,7 @@ extern jlib_decl TraceFlags loadTraceFlags(const IPropertyTree * globals, const // Temporarily modify the trace context and/or flags for the current thread, for the lifetime of the LogContextScope object - +interface IContextLogger; class jlib_decl LogContextScope { public: diff --git a/thorlcr/thorutil/thormisc.cpp b/thorlcr/thorutil/thormisc.cpp index 6fafd660216..6e2d3e58b75 100644 --- a/thorlcr/thorutil/thormisc.cpp +++ b/thorlcr/thorutil/thormisc.cpp @@ -72,28 +72,6 @@ mptag_t kjServiceMpTag; Owned globals; static Owned ClusterMPAllocator; -// stat. mappings shared between master and slave activities -const StatisticsMapping spillStatistics({StTimeSpillElapsed, StTimeSortElapsed, StNumSpills, StSizeSpillFile}); -const StatisticsMapping jhtreeCacheStatistics({ StNumIndexSeeks, StNumIndexScans, StNumPostFiltered, StNumIndexWildSeeks, - StNumNodeCacheAdds, StNumLeafCacheAdds, StNumBlobCacheAdds, StNumNodeCacheHits, StNumLeafCacheHits, StNumBlobCacheHits, StCycleNodeLoadCycles, StCycleLeafLoadCycles, - StCycleBlobLoadCycles, StCycleNodeReadCycles, StCycleLeafReadCycles, StCycleBlobReadCycles, StNumNodeDiskFetches, StNumLeafDiskFetches, StNumBlobDiskFetches, - StCycleNodeFetchCycles, StCycleLeafFetchCycles, StCycleBlobFetchCycles}); -const StatisticsMapping basicActivityStatistics({StTimeLocalExecute, StTimeBlocked}); -const StatisticsMapping groupActivityStatistics({StNumGroups, StNumGroupMax}, basicActivityStatistics); -const StatisticsMapping hashJoinActivityStatistics({StNumLeftRows, StNumRightRows}, basicActivityStatistics); -const StatisticsMapping indexReadActivityStatistics({StNumRowsProcessed}, diskReadRemoteStatistics, basicActivityStatistics, jhtreeCacheStatistics); -const StatisticsMapping indexWriteActivityStatistics({StPerReplicated, StNumLeafCacheAdds, StNumNodeCacheAdds, StNumBlobCacheAdds }, basicActivityStatistics, diskWriteRemoteStatistics); -const StatisticsMapping keyedJoinActivityStatistics({ StNumIndexAccepted, StNumPreFiltered, StNumDiskSeeks, StNumDiskAccepted, StNumDiskRejected}, basicActivityStatistics, jhtreeCacheStatistics); -const StatisticsMapping loopActivityStatistics({StNumIterations}, basicActivityStatistics); -const StatisticsMapping lookupJoinActivityStatistics({StNumSmartJoinSlavesDegradedToStd, StNumSmartJoinDegradedToLocal}, basicActivityStatistics); -const StatisticsMapping joinActivityStatistics({StNumLeftRows, StNumRightRows}, basicActivityStatistics, spillStatistics); -const StatisticsMapping diskReadActivityStatistics({StNumDiskRowsRead, }, basicActivityStatistics, diskReadRemoteStatistics); -const StatisticsMapping diskWriteActivityStatistics({StPerReplicated}, basicActivityStatistics, diskWriteRemoteStatistics); -const StatisticsMapping sortActivityStatistics({}, basicActivityStatistics, spillStatistics); -const StatisticsMapping graphStatistics({StNumExecutions, StSizeSpillFile, StSizeGraphSpill, StTimeUser, StTimeSystem, StNumContextSwitches, StSizeMemory, StSizePeakMemory, StSizeRowMemory, StSizePeakRowMemory}, basicActivityStatistics); -const StatisticsMapping diskReadPartStatistics({StNumDiskRowsRead}, diskReadRemoteStatistics); -const StatisticsMapping indexDistribActivityStatistics({}, basicActivityStatistics, jhtreeCacheStatistics); - MODULE_INIT(INIT_PRIORITY_STANDARD) { ClusterMPAllocator.setown(createMPtagRangeAllocator(MPTAG_THORGLOBAL_BASE,MPTAG_THORGLOBAL_COUNT)); diff --git a/thorlcr/thorutil/thormisc.hpp b/thorlcr/thorutil/thormisc.hpp index 5390d900892..126df4c97ca 100644 --- a/thorlcr/thorutil/thormisc.hpp +++ b/thorlcr/thorutil/thormisc.hpp @@ -130,27 +130,6 @@ enum RegistryCode:unsigned { rc_register, rc_deregister }; #define destroyThorRow(ptr) free(ptr) #define reallocThorRow(ptr, size) realloc(ptr, size) - -//statistics gathered by the different activities -extern graph_decl const StatisticsMapping spillStatistics; -extern graph_decl const StatisticsMapping jhtreeCacheStatistics; -extern graph_decl const StatisticsMapping basicActivityStatistics; -extern graph_decl const StatisticsMapping groupActivityStatistics; -extern graph_decl const StatisticsMapping hashJoinActivityStatistics; -extern graph_decl const StatisticsMapping indexReadActivityStatistics; -extern graph_decl const StatisticsMapping indexWriteActivityStatistics; -extern graph_decl const StatisticsMapping joinActivityStatistics; -extern graph_decl const StatisticsMapping keyedJoinActivityStatistics; -extern graph_decl const StatisticsMapping lookupJoinActivityStatistics; -extern graph_decl const StatisticsMapping loopActivityStatistics; -extern graph_decl const StatisticsMapping diskReadActivityStatistics; -extern graph_decl const StatisticsMapping diskReadPartStatistics; -extern graph_decl const StatisticsMapping diskWriteActivityStatistics; -extern graph_decl const StatisticsMapping sortActivityStatistics; - -extern graph_decl const StatisticsMapping graphStatistics; -extern graph_decl const StatisticsMapping indexDistribActivityStatistics; - class BooleanOnOff { bool &tf; @@ -612,14 +591,10 @@ extern graph_decl void setExpertOpt(const char *opt, const char *value); //// // IContextLogger -class CThorContextLogger : public CSimpleInterfaceOf +class CThorContextLogger : public CThorBaseContextLogger { - unsigned traceLevel = 1; - LogTrace logTrace; - mutable CRuntimeStatisticCollection stats; - public: - CThorContextLogger() : stats(jhtreeCacheStatistics) + CThorContextLogger() { if (globals->hasProp("@httpGlobalIdHeader")) setHttpIdHeaderNames(globals->queryProp("@httpGlobalIdHeader"), globals->queryProp("@httpCallerIdHeader")); @@ -631,11 +606,6 @@ class CThorContextLogger : public CSimpleInterfaceOf CTXLOGva(MCdebugProgress, thorJob, NoLogMsgCode, format, args); va_end(args); } - - virtual void CTXLOGva(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char *format, va_list args) const override __attribute__((format(printf,5,0))) - { - VALOG(cat, job, code, format, args); - } virtual void logOperatorExceptionVA(IException *E, const char *file, unsigned line, const char *format, va_list args) const __attribute__((format(printf,5,0))) { StringBuffer ss; @@ -650,66 +620,6 @@ class CThorContextLogger : public CSimpleInterfaceOf ss.append(": ").valist_appendf(format, args); LOG(MCoperatorProgress, thorJob, "%s", ss.str()); } - virtual void noteStatistic(StatisticKind kind, unsigned __int64 value) const override - { - stats.addStatisticAtomic(kind, value); - } - virtual void setStatistic(StatisticKind kind, unsigned __int64 value) const override - { - stats.setStatistic(kind, value); - } - virtual void mergeStats(const CRuntimeStatisticCollection &from) const override - { - stats.merge(from); - } - virtual unsigned queryTraceLevel() const override - { - return traceLevel; - } - virtual void setGlobalId(const char *id, SocketEndpoint &ep, unsigned pid) override - { - logTrace.setGlobalId(id); - } - virtual void setCallerId(const char *id) override - { - logTrace.setCallerId(id); - } - virtual const char *queryGlobalId() const override - { - return logTrace.queryGlobalId(); - } - virtual const char *queryLocalId() const override - { - return logTrace.queryLocalId(); - } - virtual const char *queryCallerId() const override - { - return logTrace.queryCallerId(); - } - virtual void setHttpIdHeaderNames(const char *global, const char *caller) override - { - logTrace.setHttpIdHeaderNames(global, caller); - } - virtual const char *queryGlobalIdHttpHeaderName() const override - { - return logTrace.queryGlobalIdHTTPHeaderName(); - } - virtual const char *queryCallerIdHttpHeaderName() const override - { - return logTrace.queryCallerIdHTTPHeaderName(); - } - virtual const CRuntimeStatisticCollection &queryStats() const override - { - return stats; - } - void updateStatsDeltaTo(CRuntimeStatisticCollection &to, CRuntimeStatisticCollection &previous) - { - previous.updateDelta(to, stats); - } - void reset() - { - stats.reset(); - } }; #endif