Skip to content

Commit f395c35

Browse files
committed
Save network offering_id in usage_id
1 parent f13cf59 commit f395c35

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

usage/src/main/java/com/cloud/usage/parser/NetworkOfferingUsageParser.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static boolean parse(AccountVO account, Date startDate, Date endDate) {
116116
// Only create a usage record if we have a runningTime of bigger than zero.
117117
if (useTime > 0L) {
118118
NOInfo info = noMap.get(noIdKey);
119-
createUsageRecord(UsageTypes.NETWORK_OFFERING, useTime, startDate, endDate, account, info.getVmId(), info.getNOId(), info.getZoneId(), info.isDefault());
119+
createUsageRecord(UsageTypes.NETWORK_OFFERING, useTime, startDate, endDate, account, info.getVmId(), info.getNOId(), info.getZoneId());
120120
}
121121
}
122122

@@ -135,8 +135,7 @@ private static void updateNOUsageData(Map<String, Pair<Long, Long>> usageDataMap
135135
usageDataMap.put(key, noUsageInfo);
136136
}
137137

138-
private static void createUsageRecord(int type, long runningTime, Date startDate, Date endDate, AccountVO account, long vmId, long noId, long zoneId,
139-
boolean isDefault) {
138+
private static void createUsageRecord(int type, long runningTime, Date startDate, Date endDate, AccountVO account, long vmId, long noId, long zoneId) {
140139
// Our smallest increment is hourly for now
141140
if (s_logger.isDebugEnabled()) {
142141
s_logger.debug("Total running time " + runningTime + "ms");
@@ -155,9 +154,8 @@ private static void createUsageRecord(int type, long runningTime, Date startDate
155154
// Create the usage record
156155
String usageDesc = "Network offering:" + noId + " for Vm : " + vmId + " usage time";
157156

158-
long defaultNic = (isDefault) ? 1 : 0;
159157
UsageVO usageRecord =
160-
new UsageVO(zoneId, account.getId(), account.getDomainId(), usageDesc, usageDisplay + " Hrs", type, new Double(usage), vmId, null, noId, null, defaultNic,
158+
new UsageVO(zoneId, account.getId(), account.getDomainId(), usageDesc, usageDisplay + " Hrs", type, new Double(usage), vmId, null, noId, null, noId,
161159
null, startDate, endDate);
162160
s_usageDao.persist(usageRecord);
163161
}

0 commit comments

Comments
 (0)