Create a get_utilization() method on the RIR model #3951

Closed
opened 2025-12-29 18:32:14 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Aug 6, 2020).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Create a get_utilization() method on the RIR model to return the total utilization of all assigned aggregates, similar to what exists on the Prefix model.

Justification

RIR utilization is currently calculated by manipulating the queryset used in the list view. This is both inefficient and inflexible, because no convenient method exists for determining the utilization of a particular RIR. Moving this logic into a method is cleaner and allows us to remove the alter_queryset() method on ObjectListView.

Originally created by @jeremystretch on GitHub (Aug 6, 2020). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Create a `get_utilization()` method on the RIR model to return the total utilization of all assigned aggregates, similar to what exists on the Prefix model. ### Justification RIR utilization is currently calculated by manipulating the queryset used in the list view. This is both inefficient and inflexible, because no convenient method exists for determining the utilization of a particular RIR. Moving this logic into a method is cleaner and allows us to remove the `alter_queryset()` method on ObjectListView.
adam added the type: housekeeping label 2025-12-29 18:32:14 +01:00
adam closed this issue 2025-12-29 18:32:14 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 15, 2020):

Assigning myself to further investigate the feasibility of this. If found to be more trouble than it's likely worth, I'll open a separate issue to deprecate the RIR statistics feature entirely.

@jeremystretch commented on GitHub (Sep 15, 2020): Assigning myself to further investigate the feasibility of this. If found to be more trouble than it's likely worth, I'll open a separate issue to deprecate the RIR statistics feature entirely.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3951