Skip to content

Commit

Permalink
[native]Add non-reclaimable operator memory reclaim attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxmeng committed Oct 12, 2023
1 parent 5a08d8a commit c7818f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ void PeriodicTaskManager::updateArbitratorStatsTask() {
REPORT_IF_NOT_ZERO(
kCounterArbitratorFreeCapacityBytes,
deltaArbitratorStats.freeCapacityBytes);
REPORT_IF_NOT_ZERO(
kCounterArbitratorNonReclaimableAttempts,
deltaArbitratorStats.numNonReclaimableAttempts);

if (!deltaArbitratorStats.empty()) {
LOG(INFO) << "Updated memory arbitrator stats: "
<< updatedArbitratorStats.toString();
Expand Down
2 changes: 2 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ void registerPrestoCppCounters() {
kCounterArbitratorNumReclaimedBytes, facebook::velox::StatType::SUM);
REPORT_ADD_STAT_EXPORT_TYPE(
kCounterArbitratorFreeCapacityBytes, facebook::velox::StatType::AVG);
REPORT_ADD_STAT_EXPORT_TYPE(
kCounterArbitratorNonReclaimableAttempts, facebook::velox::StatType::SUM);

// NOTE: Metrics type exporting for file handle cache counters are in
// PeriodicTaskManager because they have dynamic names. The following counters
Expand Down
3 changes: 3 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ constexpr folly::StringPiece kCounterArbitratorNumReclaimedBytes{
/// The free memory capacity in bytes.
constexpr folly::StringPiece kCounterArbitratorFreeCapacityBytes{
"presto_cpp.arbitrator_free_capacity_bytes"};
/// The number of non-reclaimable operator reclaim attempts.
constexpr folly::StringPiece kCounterArbitratorNonReclaimableAttempts{
"presto_cpp.arbitrator_non_reclaimable_attempts"};

/// ================== Disk Spilling Counters =================

Expand Down

0 comments on commit c7818f1

Please sign in to comment.