Skip to content

Commit c8a6d55

Browse files
authored
Add processedStrides and processedSplits metrics (#264)
1 parent 8f969eb commit c8a6d55

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

velox/connectors/hive/HiveConnector.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ void HiveDataSource::addSplit(std::shared_ptr<ConnectorSplit> split) {
547547
runtimeStats_.skippedSplitBytes += split_->length;
548548
return;
549549
}
550+
++runtimeStats_.processedSplits;
550551

551552
auto fileType = reader_->rowType();
552553

velox/dwio/common/Statistics.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,18 +517,26 @@ struct RuntimeStatistics {
517517
// Number of splits skipped based on statistics.
518518
int64_t skippedSplits{0};
519519

520+
// Number of splits processed based on statistics.
521+
int64_t processedSplits{0};
522+
520523
// Total bytes in splits skipped based on statistics.
521524
int64_t skippedSplitBytes{0};
522525

523526
// Number of strides (row groups) skipped based on statistics.
524527
int64_t skippedStrides{0};
525528

529+
// Number of strides (row groups) processed based on statistics.
530+
int64_t processedStrides{0};
531+
526532
std::unordered_map<std::string, RuntimeCounter> toMap() {
527533
return {
528534
{"skippedSplits", RuntimeCounter(skippedSplits)},
535+
{"processedSplits", RuntimeCounter(processedSplits)},
529536
{"skippedSplitBytes",
530537
RuntimeCounter(skippedSplitBytes, RuntimeCounter::Unit::kBytes)},
531-
{"skippedStrides", RuntimeCounter(skippedStrides)}};
538+
{"skippedStrides", RuntimeCounter(skippedStrides)},
539+
{"processedStrides", RuntimeCounter(processedStrides)}};
532540
}
533541
};
534542

velox/dwio/parquet/reader/ParquetReader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ bool ParquetRowReader::advanceToNextRowGroup() {
612612
void ParquetRowReader::updateRuntimeStats(
613613
dwio::common::RuntimeStatistics& stats) const {
614614
stats.skippedStrides += skippedRowGroups_;
615+
stats.processedStrides += rowGroupIds_.size();
615616
}
616617

617618
void ParquetRowReader::resetFilterCaches() {

velox/dwio/parquet/reader/TimestampColumnReader.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ class TimestampColumnReader : public IntegerColumnReader {
2929
common::ScanSpec& scanSpec)
3030
: IntegerColumnReader(nodeType, nodeType, params, scanSpec) {}
3131

32-
static constexpr int64_t JULIAN_TO_UNIX_EPOCH_DAYS = 2440588LL;
33-
static constexpr int64_t SECONDS_PER_DAY = 86400LL;
34-
3532
void read(
3633
vector_size_t offset,
3734
RowSet rows,

velox/exec/tests/PrintPlanWithStatsTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ TEST_F(PrintPlanWithStatsTest, innerJoinWithTableScan) {
185185
{" prefetchBytes [ ]* sum: .+, count: 1, min: .+, max: .+"},
186186
{" preloadedSplits[ ]+sum: .+, count: .+, min: .+, max: .+",
187187
true},
188+
{" processedSplits [ ]* sum: 1, count: 1, min: 1, max: 1"},
189+
{" processedStrides [ ]* sum: 0, count: 1, min: 0, max: 0"},
188190
{" queryThreadIoLatency[ ]* sum: .+, count: .+ min: .+, max: .+"},
189191
{" ramReadBytes [ ]* sum: .+, count: 1, min: .+, max: .+"},
190192
{" readyPreloadedSplits[ ]+sum: .+, count: .+, min: .+, max: .+",
@@ -257,6 +259,8 @@ TEST_F(PrintPlanWithStatsTest, partialAggregateWithTableScan) {
257259
{" numRamRead [ ]* sum: 6, count: 1, min: 6, max: 6"},
258260
{" numStorageRead [ ]* sum: .+, count: 1, min: .+, max: .+"},
259261
{" prefetchBytes [ ]* sum: .+, count: 1, min: .+, max: .+"},
262+
{" processedSplits [ ]* sum: 1, count: 1, min: 1, max: 1"},
263+
{" processedStrides [ ]* sum: 0, count: 1, min: 0, max: 0"},
260264
{" preloadedSplits[ ]+sum: .+, count: .+, min: .+, max: .+",
261265
true},
262266
{" queryThreadIoLatency[ ]* sum: .+, count: .+ min: .+, max: .+"},

0 commit comments

Comments
 (0)