mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 03:25:12 +08:00
Partially Use f string (#10218)
* flynt. trial 1. * Trial 1. * Addressed code review.
This commit is contained in:
@@ -49,7 +49,7 @@ class RayOutOfMemoryError(Exception):
|
||||
return ("More than {}% of the memory on ".format(int(
|
||||
100 * threshold)) + "node {} is used ({} / {} GB). ".format(
|
||||
platform.node(), round(used_gb, 2), round(total_gb, 2)) +
|
||||
"The top 10 memory consumers are:\n\n{}".format(proc_str) +
|
||||
f"The top 10 memory consumers are:\n\n{proc_str}" +
|
||||
"\n\nIn addition, up to {} GiB of shared memory is ".format(
|
||||
round(get_shared(psutil.virtual_memory()) / (1024**3), 2))
|
||||
+ "currently being used by the Ray object store. You can set "
|
||||
@@ -134,8 +134,7 @@ class MemoryMonitor:
|
||||
RayOutOfMemoryError.get_message(used_gb, total_gb,
|
||||
self.error_threshold))
|
||||
else:
|
||||
logger.debug("Memory usage is {} / {}".format(
|
||||
used_gb, total_gb))
|
||||
logger.debug(f"Memory usage is {used_gb} / {total_gb}")
|
||||
|
||||
if self.heap_limit:
|
||||
mem_info = psutil.Process(os.getpid()).memory_info()
|
||||
|
||||
Reference in New Issue
Block a user