Skip to content

Commit

Permalink
HPCC-30405 Code review 1.2
Browse files Browse the repository at this point in the history
- Removes queryTraceManager::createNullSpan
- Utilizes getNullSpan jlib function
- Remove superfluous semicolons

Signed-off-by: Rodrigo Pastrana <rodrigo.pastrana@lexisnexisrisk.com>
  • Loading branch information
rpastrana committed Oct 25, 2023
1 parent 8f27049 commit 9d2e47e
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion common/thorhelper/thorcommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ class CStatsContextLogger : public CSimpleInterfaceOf<IContextLogger>
protected:
const LogMsgJobInfo job;
unsigned traceLevel = 1;
Owned<ISpan> activeSpan = queryTraceManager().createNullSpan();
Owned<ISpan> activeSpan = getNullSpan();
mutable CRuntimeStatisticCollection stats;
public:
CStatsContextLogger(const CRuntimeStatisticCollection &_mapping, const LogMsgJobInfo & _job=unknownJob) : job(_job), stats(_mapping) {}
Expand Down
2 changes: 1 addition & 1 deletion roxie/ccd/ccd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ class ContextLogger : implements IRoxieContextLogger, public CInterface
mutable bool aborted;
mutable CIArrayOf<LogItem> log;
private:
Owned<ISpan> activeSpan = queryTraceManager().createNullSpan();
Owned<ISpan> activeSpan = getNullSpan();
ContextLogger(const ContextLogger &); // Disable copy constructor
public:
IMPLEMENT_IINTERFACE;
Expand Down
2 changes: 1 addition & 1 deletion system/jlib/jlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2829,7 +2829,7 @@ class CRuntimeStatisticCollection;
class DummyLogCtx : implements IContextLogger
{
private:
Owned<ISpan> activeSpan = queryTraceManager().createNullSpan();
Owned<ISpan> activeSpan = getNullSpan();

public:
DummyLogCtx() {}
Expand Down
10 changes: 0 additions & 10 deletions system/jlib/jtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,12 +878,7 @@ class CTraceManager : implements ITraceManager, public CInterface
toXML(traceConfig, xml);
DBGLOG("traceConfig tree: %s", xml.str());
#endif
StringBuffer xml;
toXML(traceConfig, xml);
DBGLOG("^^traceConfig tree: %s", xml.str());

bool disableTracing = traceConfig && traceConfig->getPropBool("@disable", false);
disableTracing = true;

using namespace opentelemetry::trace;
if (disableTracing)
Expand Down Expand Up @@ -960,11 +955,6 @@ class CTraceManager : implements ITraceManager, public CInterface
return new CServerSpan(name, moduleName.get(), httpHeaders, flags);
}

ISpan * createNullSpan() const override
{
return getNullSpan();
}

const char * getTracedComponentName() const override
{
return moduleName.get();
Expand Down
1 change: 0 additions & 1 deletion system/jlib/jtrace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ extern jlib_decl IProperties * getClientHeaders(const ISpan * span);

interface ITraceManager : extends IInterface
{
virtual ISpan * createNullSpan() const = 0;
virtual ISpan * createServerSpan(const char * name, StringArray & httpHeaders, SpanFlags flags = SpanFlags::None) const = 0;
virtual ISpan * createServerSpan(const char * name, const IProperties * httpHeaders, SpanFlags flags = SpanFlags::None) const = 0;
virtual bool isTracingEnabled() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion testing/unittests/jlibtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class JlibTraceTest : public CppUnit::TestFixture
return;
}

Owned<ISpan> nullSpan = queryTraceManager().createNullSpan();
Owned<ISpan> nullSpan = getNullSpan();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected nullptr nullspan detected", true, nullSpan != nullptr);

{
Expand Down

0 comments on commit 9d2e47e

Please sign in to comment.