winterhazel commented on code in PR #10721:
URL: https://github.com/apache/cloudstack/pull/10721#discussion_r2048077989


##########
usage/src/main/java/com/cloud/usage/parser/NetworkOfferingUsageParser.java:
##########
@@ -155,9 +154,8 @@ private static void createUsageRecord(int type, long 
runningTime, Date startDate
         // Create the usage record
         String usageDesc = "Network offering:" + noId + " for Vm : " + vmId + 
" usage time";
 
-        long defaultNic = (isDefault) ? 1 : 0;
         UsageVO usageRecord =
-            new UsageVO(zoneId, account.getId(), account.getDomainId(), 
usageDesc, usageDisplay + " Hrs", type, new Double(usage), vmId, null, noId, 
null, defaultNic,
+            new UsageVO(zoneId, account.getId(), account.getDomainId(), 
usageDesc, usageDisplay + " Hrs", type, new Double(usage), vmId, null, noId, 
null, noId,

Review Comment:
   @DaanHoogland not having the resource's ID here is undoubtedly inconsistent 
with other usage types. Regardless, I expect that there has been at least a 
reason/use case that prompted the introduction of this value (`defaultNic`) 
into the usage record, although definitely not in such a good way. Removing 
this from the record would break that, and possibly other integrations that 
were developed over this odd organization.
   
   Therefore, considering that the network offering is already available in the 
usage record, that these are (presumably) working currently, and that the 
change can break them, I do not think that it would be beneficial to change it 
for the sake of consistency.
   
   Maybe deprecating this usage type and working on an improved version (e.g. a 
`NIC` type) would be a better direction? See 
https://github.com/apache/cloudstack/issues/10697#issuecomment-2807176522. This 
usage type's behavior is weird, and I frequently see people not understanding 
how it works, performing rating over it, and ending up with unexpected values.  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to