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

feat(ingest): Track disk usage in report #7812

Merged

Conversation

asikowitz
Copy link
Collaborator

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@asikowitz asikowitz requested a review from treff7es April 13, 2023 14:32
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Apr 13, 2023
self.mem_info = humanfriendly.format_size(mem_usage)

disk_usage = psutil.disk_usage("/")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How expensive is this call under the hood?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This calls https://man7.org/linux/man-pages/man3/statvfs.3.html under the hood. I can't find exact info on how expensive this is but I'm pretty sure it's just reading block-level info and should be super cheap. Locally, it runs instantly although guess there could be caching.

Going to switch to shutil though because it's in the standard library and seems to have better docs

@asikowitz asikowitz merged commit ce79540 into datahub-project:master Apr 13, 2023
@asikowitz asikowitz deleted the ingestion-track-disk-usage branch April 13, 2023 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants