Skip to content

Commit

Permalink
Fix host_usage calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Powers committed Jan 22, 2025
1 parent 1eeb7a6 commit c51fe03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions balance_service/enforcement/usage_enforcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ def _get_reservation_sus(self, reservation):
for alloc in allocations:
su_factor = self.__get_billrate(alloc, resource_type)
# What propotion of the host is being used by this reservation
host_usage = (
alloc.get("vcpus", reservation["vcpus"]) / reservation["vcpus"]
host_usage = reservation["vcpus"] / alloc.get(
"vcpus", reservation["vcpus"]
)
running_total += su_factor * host_usage
return running_total
Expand Down

0 comments on commit c51fe03

Please sign in to comment.