Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Better log format when show the disk size #46869

Merged
merged 12 commits into from
Oct 30, 2024
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