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

Log disk space available and consumed by SPMI download #91683

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3198,8 +3198,22 @@ def process_mch_files_arg(coreclr_args):
logging.info("Found download cache directory \"%s\" and --force_download not set; skipping download", mch_cache_dir)
return [ mch_cache_dir ]

# MCH files can be large. Log the disk space before and after the download.
if os.path.isdir(coreclr_args.spmi_location):
before_total, _, before_free = shutil.disk_usage(coreclr_args.spmi_location)
before_total_gb = int(before_total / 1024 / 1024 / 1024)
before_free_gb = int(before_free / 1024 / 1024 / 1024)
logging.debug("Disk usage (%s): total %s GB; free %s GB", coreclr_args.spmi_location, format(before_total_gb, ','), format(before_free_gb, ','))

local_mch_paths = download_mch_from_azure(coreclr_args, mch_cache_dir)

if os.path.isdir(coreclr_args.spmi_location): # This should always be true here; just being defensive.
after_total, _, after_free = shutil.disk_usage(coreclr_args.spmi_location)
after_total_gb = int(after_total / 1024 / 1024 / 1024)
after_free_gb = int(after_free / 1024 / 1024 / 1024)
consumed_gb = before_free_gb - after_free_gb
logging.debug("Disk usage (%s): total %s GB; free %s GB; consumed by download %s GB", coreclr_args.spmi_location, format(after_total_gb, ','), format(after_free_gb, ','), format(consumed_gb, ','))

# Add the private store files
if coreclr_args.private_store is not None:
# Only include the directories corresponding to the current JIT/EE version, target OS, and MCH architecture (this is the
Expand Down
Loading