Skip to content

Commit

Permalink
docs: Update the command for max power capacity formula
Browse files Browse the repository at this point in the history
  • Loading branch information
jneo8 committed Nov 22, 2023
1 parent 690b01d commit 36f508b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions prometheus_hardware_exporter/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,11 @@ def fetch(self) -> List[Payload]:
ps_redundancy = True

power_capacities = self.dmidecode.get_power_capacities()
# If power supply is redundancy is enabled,
# maximum_power_capacity = average power_capacities, else sum.
# If power supply redundancy is enabled,
# it means server only use one power in the same time and another is for backup
# We calculate the average capacities as the value of maximum_power_capacity
# Note: We don't consider the situation that two powers' capacities are
# different on a single server.
maximum_power_capacity = (
(ps_redundancy and len(power_capacities) > 0)
and sum(power_capacities) / len(power_capacities)
Expand Down

0 comments on commit 36f508b

Please sign in to comment.