Skip to content

Commit

Permalink
fix runtimeStats
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchengchenghh committed Nov 13, 2024
1 parent 70f6afc commit e67e248
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
6 changes: 3 additions & 3 deletions velox/exec/tests/MultiFragmentTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2304,12 +2304,12 @@ TEST_P(MultiFragmentTest, mergeSmallBatchesInExchange) {
test(100'000, 1);
} else if (GetParam() == VectorSerde::Kind::kCompactRow) {
test(1, 1'000);
test(1'000, 28);
test(10'000, 3);
test(1'000, 38);
test(10'000, 4);
test(100'000, 1);
} else {
test(1, 1'000);
test(1'000, 63);
test(1'000, 72);
test(10'000, 7);
test(100'000, 1);
}
Expand Down
14 changes: 14 additions & 0 deletions velox/serializers/CompactRowSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,20 @@ class CompactRowVectorSerializer : public IterativeVectorSerializer {
buffers_.clear();
}

std::unordered_map<std::string, RuntimeCounter> runtimeStats() override {
std::unordered_map<std::string, RuntimeCounter> map;
map.insert(
{{"compressedBytes",
RuntimeCounter(stats_.compressedBytes, RuntimeCounter::Unit::kBytes)},
{"compressionInputBytes",
RuntimeCounter(
stats_.compressionInputBytes, RuntimeCounter::Unit::kBytes)},
{"compressionSkippedBytes",
RuntimeCounter(
stats_.compressionSkippedBytes, RuntimeCounter::Unit::kBytes)}});
return map;
}

void clear() override {}

private:
Expand Down
14 changes: 14 additions & 0 deletions velox/serializers/UnsafeRowSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,20 @@ class UnsafeRowVectorSerializer : public IterativeVectorSerializer {
buffers_.clear();
}

std::unordered_map<std::string, RuntimeCounter> runtimeStats() override {
std::unordered_map<std::string, RuntimeCounter> map;
map.insert(
{{"compressedBytes",
RuntimeCounter(stats_.compressedBytes, RuntimeCounter::Unit::kBytes)},
{"compressionInputBytes",
RuntimeCounter(
stats_.compressionInputBytes, RuntimeCounter::Unit::kBytes)},
{"compressionSkippedBytes",
RuntimeCounter(
stats_.compressionSkippedBytes, RuntimeCounter::Unit::kBytes)}});
return map;
}

void clear() override {}

private:
Expand Down

0 comments on commit e67e248

Please sign in to comment.