Skip to content

Commit

Permalink
Merge pull request #14 from dmitry-ko/main
Browse files Browse the repository at this point in the history
fix: exclude nodes that are not online from balancing
  • Loading branch information
cvk98 committed Mar 21, 2023
2 parents 716337d + 2a03161 commit 38179ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plb.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def cluster_hosts(self):
for item in temp:
if item["type"] == "node":
self.cluster_information.remove(item)
if item["status"] != "online": # Ignore nodes that are not online
continue
item["cpu_used"] = round(item["maxcpu"] * item["cpu"], 2) # Adding the value of the cores used
item["free_mem"] = item["maxmem"] - item["mem"] # Adding the value of free RAM
item["mem_load"] = item["mem"] / item["maxmem"] # Adding the RAM load value
Expand Down

0 comments on commit 38179ca

Please sign in to comment.