Skip to content

Commit

Permalink
Changes following review
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chapman <[email protected]>
  • Loading branch information
richardkchapman committed Jul 24, 2024
1 parent b0fe74a commit a7fd5dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 4 additions & 8 deletions roxie/udplib/udptrr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1424,14 +1424,10 @@ class CReceiveManager : implements IReceiveManager, public CInterface
DBGLOG("UdpReceiver: %u bytes received packet %" SEQF "u %x from %s", res, hdr.sendSeq, hdr.pktSeq, hdr.node.getTraceText(s).str());
}
}
{
UdpRdTracker::TimeDivision d(timeTracker, UdpRdTracker::pushing);
parent.input_queue->pushOwn(b);
}
{
UdpRdTracker::TimeDivision d(timeTracker, UdpRdTracker::allocating);
b = udpBufferManager->allocate();
}
d.switchState(UdpRdTracker::pushing);
parent.input_queue->pushOwn(b);
d.switchState(UdpRdTracker::allocating);
b = udpBufferManager->allocate();
}
if (udpStatsReportInterval)
{
Expand Down
10 changes: 7 additions & 3 deletions system/jlib/jmisc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,11 @@ template<unsigned NUMSTATES, bool reportOther> class TimeDivisionTracker
unsigned prevState = currentState;
unsigned __int64 now = get_cycles_now();
if (reportIntervalCycles && now - lastReport >= reportIntervalCycles)
{
report(true);
if (newState != currentState)
now = get_cycles_now();
}
if (newState != prevState)
{
totals[currentState] += now - lastTick;
currentState = newState;
Expand Down Expand Up @@ -404,12 +407,13 @@ template<unsigned NUMSTATES, bool reportOther> class TimeDivisionTracker
doneOne = true;
}
if (reset)
{
totals[i] = 0;
counts[i] = 0;
}
}
if (doneOne)
DBGLOG("%s", str.str());
if (reset)
lastTick = now;
}

class TimeDivision
Expand Down

0 comments on commit a7fd5dd

Please sign in to comment.