|
|
@@ -115,6 +115,7 @@ func (orig LbAllocations) Clone() LbAllocations {
|
|
|
Cost: lbAlloc.Cost,
|
|
|
Private: lbAlloc.Private,
|
|
|
Ip: lbAlloc.Ip,
|
|
|
+ Hours: lbAlloc.Hours,
|
|
|
}
|
|
|
}
|
|
|
return newAllocs
|
|
|
@@ -124,7 +125,8 @@ type LbAllocation struct {
|
|
|
Service string `json:"service"`
|
|
|
Cost float64 `json:"cost"`
|
|
|
Private bool `json:"private"`
|
|
|
- Ip string `json:"ip"` //@bingen:field[version=19]
|
|
|
+ Ip string `json:"ip"` //@bingen:field[version=19]
|
|
|
+ Hours float64 `json:"hours"` //@bingen:field[version=21]
|
|
|
}
|
|
|
|
|
|
func (lba *LbAllocation) SanitizeNaN() {
|
|
|
@@ -135,6 +137,10 @@ func (lba *LbAllocation) SanitizeNaN() {
|
|
|
log.DedupedWarningf(5, "LBAllocation: Unexpected NaN found for Cost service:%s", lba.Service)
|
|
|
lba.Cost = 0
|
|
|
}
|
|
|
+ if math.IsNaN(lba.Hours) {
|
|
|
+ log.DedupedWarningf(5, "LBAllocation: Unexpected NaN found for Hours service:%s", lba.Service)
|
|
|
+ lba.Hours = 0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// RawAllocationOnlyData is information that only belong in "raw" Allocations,
|
|
|
@@ -1249,10 +1255,12 @@ func (thisLbAllocs LbAllocations) Add(thatLbAllocs LbAllocations) LbAllocations
|
|
|
thisLbAlloc = &LbAllocation{
|
|
|
Service: thatlbAlloc.Service,
|
|
|
Cost: thatlbAlloc.Cost,
|
|
|
+ Hours: thatlbAlloc.Hours,
|
|
|
}
|
|
|
mergedLbAllocs[lbKey] = thisLbAlloc
|
|
|
} else {
|
|
|
thisLbAlloc.Cost += thatlbAlloc.Cost
|
|
|
+ thisLbAlloc.Hours += thatlbAlloc.Hours
|
|
|
}
|
|
|
|
|
|
}
|