Skip to content

Commit

Permalink
Fix disk metric showing double the actual value (ray-project#32674) (r…
Browse files Browse the repository at this point in the history
…ay-project#32993)

Signed-off-by: Alan Guo <aguo@anyscale.com>

the disks stats returns stats about two paths / and /tmp/ray. Since both those paths are on the same partition, disk_usage will return the same value. We do not need to combine them.

In the UI, we show the disk stats for / so I'll do the same for the metric as well.
  • Loading branch information
alanwguo committed Mar 3, 2023
1 parent dbe97e1 commit 4032d02
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dashboard/modules/reporter/reporter_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,10 +907,8 @@ def _record_stats(self, stats, cluster_stats):
value=disk_io_speed_stats[3],
tags={"ip": ip},
)
used, free = 0, 0
for entry in stats["disk"].values():
used += entry.used
free += entry.free
used = stats["disk"]["/"].used
free = stats["disk"]["/"].free
disk_utilization = float(used / (used + free)) * 100
disk_usage_record = Record(
gauge=METRICS_GAUGES["node_disk_usage"], value=used, tags={"ip": ip}
Expand Down

0 comments on commit 4032d02

Please sign in to comment.