-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.5.3
Python version
3.8
Steps to Reproduce
- Create a power feed and some devices in a rack, such that the power utilization on the power feed is 2.5% - specific instructions in discussion Documenting the "power utilization" features of Netbox #12837
- Look at the power feed utilization
- Look at the rack level power utilization
Expected Behavior
Both to show the same
Observed Behavior
Power-feed utilization shows as "2.5%"
But rack-level utilization power shows as "2.0%"
The problem is that percentage() in netbox/utilities/templatetags/helpers.py rounds to nearest 0.1%
return round(x / y * 100, 1)
Whereas Rack.get_power_utilization in netbox/dcim/models/racks.py rounds down to integer:
return int(allocated_draw / available_power_total * 100)
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application

