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); } };