|
|
@@ -63,9 +63,11 @@ type Allocation struct {
|
|
|
CPUCoreUsageAverage float64 `json:"cpuCoreUsageAverage"`
|
|
|
CPUCost float64 `json:"cpuCost"`
|
|
|
CPUCostAdjustment float64 `json:"cpuCostAdjustment"`
|
|
|
+ CPUCostIdle float64 `json:"cpuCostIdle"` //@bingen:field[ignore]
|
|
|
GPUHours float64 `json:"gpuHours"`
|
|
|
GPUCost float64 `json:"gpuCost"`
|
|
|
GPUCostAdjustment float64 `json:"gpuCostAdjustment"`
|
|
|
+ GPUCostIdle float64 `json:"gpuCostIdle"` //@bingen:field[ignore]
|
|
|
NetworkTransferBytes float64 `json:"networkTransferBytes"`
|
|
|
NetworkReceiveBytes float64 `json:"networkReceiveBytes"`
|
|
|
NetworkCost float64 `json:"networkCost"`
|
|
|
@@ -82,6 +84,7 @@ type Allocation struct {
|
|
|
RAMBytesUsageAverage float64 `json:"ramByteUsageAverage"`
|
|
|
RAMCost float64 `json:"ramCost"`
|
|
|
RAMCostAdjustment float64 `json:"ramCostAdjustment"`
|
|
|
+ RAMCostIdle float64 `json:"ramCostIdle"` //@bingen:field[ignore]
|
|
|
SharedCost float64 `json:"sharedCost"`
|
|
|
ExternalCost float64 `json:"externalCost"`
|
|
|
// RawAllocationOnly is a pointer so if it is not present it will be
|
|
|
@@ -669,11 +672,13 @@ func (a *Allocation) Clone() *Allocation {
|
|
|
CPUCoreRequestAverage: a.CPUCoreRequestAverage,
|
|
|
CPUCoreUsageAverage: a.CPUCoreUsageAverage,
|
|
|
CPUCost: a.CPUCost,
|
|
|
+ CPUCostIdle: a.CPUCostIdle,
|
|
|
CPUCostAdjustment: a.CPUCostAdjustment,
|
|
|
GPUHours: a.GPUHours,
|
|
|
GPURequestAverage: a.GPURequestAverage,
|
|
|
GPUUsageAverage: a.GPUUsageAverage,
|
|
|
GPUCost: a.GPUCost,
|
|
|
+ GPUCostIdle: a.GPUCostIdle,
|
|
|
GPUCostAdjustment: a.GPUCostAdjustment,
|
|
|
NetworkTransferBytes: a.NetworkTransferBytes,
|
|
|
NetworkReceiveBytes: a.NetworkReceiveBytes,
|
|
|
@@ -690,6 +695,7 @@ func (a *Allocation) Clone() *Allocation {
|
|
|
RAMBytesRequestAverage: a.RAMBytesRequestAverage,
|
|
|
RAMBytesUsageAverage: a.RAMBytesUsageAverage,
|
|
|
RAMCost: a.RAMCost,
|
|
|
+ RAMCostIdle: a.RAMCostIdle,
|
|
|
RAMCostAdjustment: a.RAMCostAdjustment,
|
|
|
SharedCost: a.SharedCost,
|
|
|
ExternalCost: a.ExternalCost,
|
|
|
@@ -731,6 +737,9 @@ func (a *Allocation) Equal(that *Allocation) bool {
|
|
|
if !util.IsApproximately(a.CPUCost, that.CPUCost) {
|
|
|
return false
|
|
|
}
|
|
|
+ if !util.IsApproximately(a.CPUCostIdle, that.CPUCostIdle) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
if !util.IsApproximately(a.CPUCostAdjustment, that.CPUCostAdjustment) {
|
|
|
return false
|
|
|
}
|
|
|
@@ -740,6 +749,9 @@ func (a *Allocation) Equal(that *Allocation) bool {
|
|
|
if !util.IsApproximately(a.GPUCost, that.GPUCost) {
|
|
|
return false
|
|
|
}
|
|
|
+ if !util.IsApproximately(a.GPUCostIdle, that.GPUCostIdle) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
if !util.IsApproximately(a.GPUCostAdjustment, that.GPUCostAdjustment) {
|
|
|
return false
|
|
|
}
|
|
|
@@ -779,6 +791,9 @@ func (a *Allocation) Equal(that *Allocation) bool {
|
|
|
if !util.IsApproximately(a.RAMCost, that.RAMCost) {
|
|
|
return false
|
|
|
}
|
|
|
+ if !util.IsApproximately(a.RAMCostIdle, that.RAMCostIdle) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
if !util.IsApproximately(a.RAMCostAdjustment, that.RAMCostAdjustment) {
|
|
|
return false
|
|
|
}
|
|
|
@@ -1249,6 +1264,9 @@ func (a *Allocation) add(that *Allocation) {
|
|
|
a.CPUCost += that.CPUCost
|
|
|
a.GPUCost += that.GPUCost
|
|
|
a.RAMCost += that.RAMCost
|
|
|
+ a.CPUCostIdle += that.CPUCostIdle
|
|
|
+ a.GPUCostIdle += that.GPUCostIdle
|
|
|
+ a.RAMCostIdle += that.RAMCostIdle
|
|
|
a.NetworkCost += that.NetworkCost
|
|
|
a.NetworkCrossZoneCost += that.NetworkCrossZoneCost
|
|
|
a.NetworkCrossRegionCost += that.NetworkCrossRegionCost
|
|
|
@@ -2545,6 +2563,10 @@ func (a *Allocation) SanitizeNaN() {
|
|
|
log.DedupedWarningf(5, "Allocation: Unexpected NaN found for CPUCost: name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
a.CPUCost = 0
|
|
|
}
|
|
|
+ if math.IsNaN(a.CPUCostIdle) {
|
|
|
+ log.DedupedWarningf(5, "Allocation: Unexpected NaN found for CPUCostIdle: name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
+ a.CPUCostIdle = 0
|
|
|
+ }
|
|
|
if math.IsNaN(a.CPUCoreRequestAverage) {
|
|
|
log.DedupedWarningf(5, "Allocation: Unexpected NaN found for CPUCoreRequestAverage: name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
a.CPUCoreRequestAverage = 0
|
|
|
@@ -2577,6 +2599,10 @@ func (a *Allocation) SanitizeNaN() {
|
|
|
log.DedupedWarningf(5, "Allocation: Unexpected NaN found for GPUCost name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
a.GPUCost = 0
|
|
|
}
|
|
|
+ if math.IsNaN(a.GPUCostIdle) {
|
|
|
+ log.DedupedWarningf(5, "Allocation: Unexpected NaN found for GPUCostIdle name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
+ a.GPUCostIdle = 0
|
|
|
+ }
|
|
|
if math.IsNaN(a.GPUCostAdjustment) {
|
|
|
log.DedupedWarningf(5, "Allocation: Unexpected NaN found for GPUCostAdjustment name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
a.GPUCostAdjustment = 0
|
|
|
@@ -2637,6 +2663,10 @@ func (a *Allocation) SanitizeNaN() {
|
|
|
log.DedupedWarningf(5, "Allocation: Unexpected NaN found for RAMCost name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
a.RAMCost = 0
|
|
|
}
|
|
|
+ if math.IsNaN(a.RAMCostIdle) {
|
|
|
+ log.DedupedWarningf(5, "Allocation: Unexpected NaN found for RAMCostIdle name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
+ a.RAMCostIdle = 0
|
|
|
+ }
|
|
|
if math.IsNaN(a.RAMCostAdjustment) {
|
|
|
log.DedupedWarningf(5, "Allocation: Unexpected NaN found for RAMCostAdjustment name:%s, window:%s, properties:%s", a.Name, a.Window.String(), a.Properties.String())
|
|
|
a.RAMCostAdjustment = 0
|