@@ -292,7 +292,43 @@ private void UpdateAVSPropertiesDataset(AVSAssessmentPropertiesJSON avsPropertie
292292 totalMonthlyCost += totalMonthlyCostDetail ?? 0.00 ;
293293 }
294294 }
295+ var costComponentsWithTotalMonthlyAvsNodeCost = new List < CostComponent > ( avsSummariesObj ? . Values [ 0 ] ? . Properties ? . CostComponents ? . FindAll ( x => x . CostDetail . Exists ( y => y . Name == "MonthlyAvsNodeCost" ) ) ?? new List < CostComponent > ( ) ) ;
296+ // in each of the cost components, get the cost detail with name "TotalMonthlyCost" and get its value and add them up
297+ double ? totalMonthlyAvsNodeCost = 0.00 ;
298+ foreach ( var costComponent in costComponentsWithTotalMonthlyAvsNodeCost )
299+ {
300+ var totalMonthlyCostDetail = costComponent . CostDetail ? . Find ( x => x . Name == "MonthlyAvsNodeCost" ) ? . Value ;
301+ if ( totalMonthlyCostDetail != null )
302+ {
303+ totalMonthlyAvsNodeCost += totalMonthlyCostDetail ?? 0.00 ;
304+ }
305+ }
306+ var costComponentsWithTotalMonthlyExternalStorageCost = new List < CostComponent > ( avsSummariesObj ? . Values [ 0 ] ? . Properties ? . CostComponents ? . FindAll ( x => x . CostDetail . Exists ( y => y . Name == "MonthlyAvsExternalStorageCost" ) ) ?? new List < CostComponent > ( ) ) ;
307+ // in each of the cost components, get the cost detail with name "TotalMonthlyCost" and get its value and add them up
308+ double ? totalMonthlyExternalStorageCost = 0.00 ;
309+ foreach ( var costComponent in costComponentsWithTotalMonthlyExternalStorageCost )
310+ {
311+ var totalMonthlyCostDetail = costComponent . CostDetail ? . Find ( x => x . Name == "MonthlyAvsExternalStorageCost" ) ? . Value ;
312+ if ( totalMonthlyCostDetail != null )
313+ {
314+ totalMonthlyExternalStorageCost += totalMonthlyCostDetail ?? 0.00 ;
315+ }
316+ }
317+ var costComponentsWithTotalMonthlyExternalNetworkCost = new List < CostComponent > ( avsSummariesObj ? . Values [ 0 ] ? . Properties ? . CostComponents ? . FindAll ( x => x . CostDetail . Exists ( y => y . Name == "MonthlyAvsNetworkCost" ) ) ?? new List < CostComponent > ( ) ) ;
318+ // in each of the cost components, get the cost detail with name "TotalMonthlyCost" and get its value and add them up
319+ double ? totalMonthlyExternalNetworkCost = 0.00 ;
320+ foreach ( var costComponent in costComponentsWithTotalMonthlyExternalNetworkCost )
321+ {
322+ var totalMonthlyCostDetail = costComponent . CostDetail ? . Find ( x => x . Name == "MonthlyAvsNetworkCost" ) ? . Value ;
323+ if ( totalMonthlyCostDetail != null )
324+ {
325+ totalMonthlyExternalNetworkCost += totalMonthlyCostDetail ?? 0.00 ;
326+ }
327+ }
295328 AVSAssessmentsData [ assessmentInfo ] . TotalMonthlyCostEstimate = totalMonthlyCost ?? 0.00 ;
329+ AVSAssessmentsData [ assessmentInfo ] . TotalExternalStorageCost = totalMonthlyExternalStorageCost ?? 0.00 ;
330+ AVSAssessmentsData [ assessmentInfo ] . TotalNodeCost = totalMonthlyAvsNodeCost ?? 0.00 ;
331+ AVSAssessmentsData [ assessmentInfo ] . TotalExternalNetworkCost = totalMonthlyExternalNetworkCost ?? 0.00 ;
296332 AVSAssessmentsData [ assessmentInfo ] . PredictedCpuUtilizationPercentage = avsSummariesObj ? . Values [ 0 ] ? . Properties ? . CpuUtilization ?? 0.00 ;
297333 AVSAssessmentsData [ assessmentInfo ] . PredictedMemoryUtilizationPercentage = avsSummariesObj ? . Values [ 0 ] ? . Properties ? . RamUtilization ?? 0.00 ;
298334 AVSAssessmentsData [ assessmentInfo ] . PredictedStorageUtilizationPercentage = avsSummariesObj ? . Values [ 0 ] ? . Properties ? . StorageUtilization ?? 0.00 ;
0 commit comments