Skip to content

Commit

Permalink
Refactor TableScanOperator stats collection
Browse files Browse the repository at this point in the history
Reorganizes TableScanOperator stats collection to match the changes
made to ScanFilterAndProjectOperator.
  • Loading branch information
pettyjamesm authored and mbasmanova committed Jan 7, 2020
1 parent 0191168 commit 072f645
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,26 @@ public Page getOutput()
page = page.getLoadedPage();

// update operator stats
long endCompletedBytes = source.getCompletedBytes();
long endCompletedPositions = source.getCompletedPositions();
long endReadTimeNanos = source.getReadTimeNanos();
operatorContext.recordRawInputWithTiming(endCompletedBytes - completedBytes, endCompletedPositions - completedPositions, endReadTimeNanos - readTimeNanos);
operatorContext.recordProcessedInput(page.getSizeInBytes(), page.getPositionCount());
completedBytes = endCompletedBytes;
completedPositions = endCompletedPositions;
readTimeNanos = endReadTimeNanos;
recordSourceRawInputStats();
}

// updating system memory usage should happen after page is loaded.
systemMemoryContext.setBytes(source.getSystemMemoryUsage());

return page;
}

private void recordSourceRawInputStats()
{
checkState(source != null, "source must not be null");
// update operator stats
long endCompletedBytes = source.getCompletedBytes();
long endCompletedPositions = source.getCompletedPositions();
long endReadTimeNanos = source.getReadTimeNanos();
operatorContext.recordRawInputWithTiming(endCompletedBytes - completedBytes, endCompletedPositions - completedPositions, endReadTimeNanos - readTimeNanos);
completedBytes = endCompletedBytes;
completedPositions = endCompletedPositions;
readTimeNanos = endReadTimeNanos;
}
}

0 comments on commit 072f645

Please sign in to comment.