Skip to content

Commit

Permalink
[Core] Better log format when show the disk size (ray-project#46869)
Browse files Browse the repository at this point in the history
Signed-off-by: zhilong <zhilong.chen@mail.mcgill.ca>
Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
  • Loading branch information
Bye-legumes authored and mohitjain2504 committed Nov 15, 2024
1 parent 88c09f0 commit c877753
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ray/common/file_system_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,15 @@ bool FileSystemMonitor::OverCapacityImpl(
return false;
}

// Convert bytes to GB
const double available_gb =
static_cast<double>(space_info->available) / (1024 * 1024 * 1024);
double capacity_gb = static_cast<double>(space_info->capacity) / (1024 * 1024 * 1024);

std::ostringstream ostr;
ostr << path << " is over " << capacity_threshold_ * 100
<< "\% full, available space: " << space_info->available
<< "; capacity: " << space_info->capacity
<< "\% full, available space: " << available_gb << " GB"
<< "; capacity: " << capacity_gb << " GB"
<< ". Object creation will fail if spilling is required.";
RAY_EVENT_EVERY_MS(ERROR, "Out of Disk", 10 * 1000) << ostr.str();
RAY_LOG_EVERY_MS(ERROR, 10 * 1000) << ostr.str();
Expand Down

0 comments on commit c877753

Please sign in to comment.