Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#869 Add DagsHub Logger to Super Gradients

Merged
Ghost merged 1 commits into Deci-AI:master from timho102003:dagshub_logger
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  1. import psutil
  2. from super_gradients.common.environment.monitoring.utils import bytes_to_megabytes
  3. buffer_io_read_bytes = psutil.disk_io_counters().read_bytes
  4. buffer_io_write_bytes = psutil.disk_io_counters().write_bytes
  5. def get_disk_usage_percent() -> float:
  6. """Disk memory used in percent."""
  7. return psutil.disk_usage("/").percent
  8. def get_io_read_mb() -> float:
  9. """Number of MegaBytes read since import"""
  10. return bytes_to_megabytes(psutil.disk_io_counters().read_bytes - buffer_io_read_bytes)
  11. def get_io_write_mb() -> float:
  12. """Number of MegaBytes written since import"""
  13. return bytes_to_megabytes(psutil.disk_io_counters().write_bytes - buffer_io_write_bytes)
  14. def reset_io_read():
  15. """Reset the value of net_io_counters"""
  16. global buffer_io_read_bytes
  17. buffer_io_read_bytes = psutil.disk_io_counters().read_bytes
  18. def reset_io_write():
  19. """Reset the value of net_io_counters"""
  20. global buffer_io_write_bytes
  21. buffer_io_write_bytes = psutil.disk_io_counters().write_bytes
Discard
Tip!

Press p or to see the previous file or, n or to see the next file