|
@@ -40,6 +40,7 @@ type SummaryAllocation struct {
|
|
|
ExternalCost float64 `json:"externalCost"`
|
|
ExternalCost float64 `json:"externalCost"`
|
|
|
Share bool `json:"-"`
|
|
Share bool `json:"-"`
|
|
|
UnmountedPVCost float64 `json:"-"`
|
|
UnmountedPVCost float64 `json:"-"`
|
|
|
|
|
+ Efficiency float64 `json:"efficiency"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// NewSummaryAllocation converts an Allocation to a SummaryAllocation by
|
|
// NewSummaryAllocation converts an Allocation to a SummaryAllocation by
|
|
@@ -88,7 +89,7 @@ func NewSummaryAllocation(alloc *Allocation, reconcile, reconcileNetwork bool) *
|
|
|
if sa.IsUnmounted() {
|
|
if sa.IsUnmounted() {
|
|
|
sa.UnmountedPVCost = sa.PVCost
|
|
sa.UnmountedPVCost = sa.PVCost
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ sa.Efficiency = sa.TotalEfficiency()
|
|
|
return sa
|
|
return sa
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -151,6 +152,7 @@ func (sa *SummaryAllocation) Add(that *SummaryAllocation) error {
|
|
|
sa.RAMCost += that.RAMCost
|
|
sa.RAMCost += that.RAMCost
|
|
|
sa.SharedCost += that.SharedCost
|
|
sa.SharedCost += that.SharedCost
|
|
|
|
|
|
|
|
|
|
+ sa.Efficiency = sa.TotalEfficiency()
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -173,6 +175,7 @@ func (sa *SummaryAllocation) Clone() *SummaryAllocation {
|
|
|
RAMCost: sa.RAMCost,
|
|
RAMCost: sa.RAMCost,
|
|
|
SharedCost: sa.SharedCost,
|
|
SharedCost: sa.SharedCost,
|
|
|
ExternalCost: sa.ExternalCost,
|
|
ExternalCost: sa.ExternalCost,
|
|
|
|
|
+ Efficiency: sa.Efficiency,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|