From a746d7f259254361db4fce561e742150dbe09efa Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Fri, 19 Jul 2024 11:12:30 +0100 Subject: [PATCH] HPCC-32138 Changes following review Signed-off-by: Shamser Ahmed --- thorlcr/thorutil/thbuf.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/thorlcr/thorutil/thbuf.cpp b/thorlcr/thorutil/thbuf.cpp index fcd40ebf6c7..5c97841fc23 100644 --- a/thorlcr/thorutil/thbuf.cpp +++ b/thorlcr/thorutil/thbuf.cpp @@ -2452,6 +2452,7 @@ class CSharedFullSpillingWriteAhead : public CInterfaceOfflush(); tempFileOwner->noteSize(iFileIO->getStatistic(StSizeDiskWrite)); - ::mergeStats(inactiveStats, iFileIO); + CRuntimeStatisticCollection currentFileStats(inactiveStats.queryMapping()); + ::mergeStats(currentFileStats, iFileIO); + previousFileStats.updateDelta(inactiveStats, currentFileStats); + previousFileStats.reset(); iFileIO.clear(); } } @@ -2539,6 +2543,9 @@ class CSharedFullSpillingWriteAhead : public CInterfaceOfflush(); totalInputRowsRead.fetch_add(newRowsWritten); tempFileOwner->noteSize(iFileIO->getStatistic(StSizeDiskWrite)); + CRuntimeStatisticCollection currentFileStats(inactiveStats.queryMapping()); + ::mergeStats(currentFileStats, iFileIO); + previousFileStats.updateDelta(inactiveStats, currentFileStats); // JCSMORE - could track size written, and start new file at this point (e.g. every 100MB), // and track their starting points (by row #) in a vector // We could then tell if/when the readers catch up, and remove consumed files as they do. @@ -2552,7 +2559,7 @@ class CSharedFullSpillingWriteAhead : public CInterfaceOfqueryRowMetaData()), serializer(rowIf->queryRowSerializer()), allocator(rowIf->queryRowAllocator()), deserializer(rowIf->queryRowDeserializer()), - inactiveStats(spillingWriteAheadStatistics) + inactiveStats(spillingWriteAheadStatistics), previousFileStats(spillingWriteAheadStatistics) { assertex(input); @@ -2716,10 +2723,7 @@ class CSharedFullSpillingWriteAhead : public CInterfaceOfgetStatistic(kind); - return v; + return inactiveStats.getStatisticValue(kind); } };