Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lidongze0629 committed Jan 26, 2024
1 parent 76788cc commit e0057f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ def __init__(
def run_alert(self):
"""This function needs to handle exception by itself"""
try:
alert = False
if CLUSTER_TYPE == "HOSTS":
target = [socket.gethostname()]
disk_info = psutil.disk_usage("/")
disk_usage = float(f"{disk_info.used / disk_info.total * 100:.2f}")
if disk_usage > self._threshold:
message = f"Disk usage {disk_usage}% - exceeds threshold."
alert_message = self.generate_alert_message(target, message)
# alert
self.alert(alert_message)
alert = True
if alert:
alert_message = self.generate_alert_message(target, message)
self.alert(alert_message)
except Exception as e:
logger.warn("Failed to get disk usage: %s", str(e))

Expand Down
2 changes: 1 addition & 1 deletion python/graphscope/gsctl/commands/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ def _construct_and_display_data(procedures):
data.append(
[
procedure.name,
procedure.type,
procedure.bound_graph,
procedure.type,
str(procedure.enable),
str(procedure.runnable),
procedure.description,
Expand Down

0 comments on commit e0057f9

Please sign in to comment.