|
|
@@ -61,6 +61,8 @@ type Allocation struct {
|
|
|
CPUCost float64 `json:"cpuCost"`
|
|
|
CPUCostAdjustment float64 `json:"cpuCostAdjustment"`
|
|
|
GPUHours float64 `json:"gpuHours"`
|
|
|
+ GPURequestAverage float64 `json:"gpuRequestAverage"`
|
|
|
+ GPUUsageAverage float64 `json:"gpuUsageAverage"`
|
|
|
GPUCost float64 `json:"gpuCost"`
|
|
|
GPUCostAdjustment float64 `json:"gpuCostAdjustment"`
|
|
|
NetworkTransferBytes float64 `json:"networkTransferBytes"`
|
|
|
@@ -205,6 +207,8 @@ func (a *Allocation) Clone() *Allocation {
|
|
|
CPUCost: a.CPUCost,
|
|
|
CPUCostAdjustment: a.CPUCostAdjustment,
|
|
|
GPUHours: a.GPUHours,
|
|
|
+ GPURequestAverage: a.GPURequestAverage,
|
|
|
+ GPUUsageAverage: a.GPUUsageAverage,
|
|
|
GPUCost: a.GPUCost,
|
|
|
GPUCostAdjustment: a.GPUCostAdjustment,
|
|
|
NetworkTransferBytes: a.NetworkTransferBytes,
|
|
|
@@ -274,6 +278,12 @@ func (a *Allocation) Equal(that *Allocation) bool {
|
|
|
if !util.IsApproximately(a.GPUHours, that.GPUHours) {
|
|
|
return false
|
|
|
}
|
|
|
+ if !util.IsApproximately(a.GPURequestAverage, that.GPURequestAverage) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if !util.IsApproximately(a.GPUUsageAverage, that.GPUUsageAverage) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
if !util.IsApproximately(a.GPUCost, that.GPUCost) {
|
|
|
return false
|
|
|
}
|
|
|
@@ -508,6 +518,8 @@ func (a *Allocation) MarshalJSON() ([]byte, error) {
|
|
|
jsonEncodeFloat64(buffer, "cpuEfficiency", a.CPUEfficiency(), ",")
|
|
|
jsonEncodeFloat64(buffer, "gpuCount", a.GPUs(), ",")
|
|
|
jsonEncodeFloat64(buffer, "gpuHours", a.GPUHours, ",")
|
|
|
+ jsonEncodeFloat64(buffer, "gpuRequestAverage", a.GPURequestAverage, ",")
|
|
|
+ jsonEncodeFloat64(buffer, "gpuUsageAverage", a.GPUUsageAverage, ",")
|
|
|
jsonEncodeFloat64(buffer, "gpuCost", a.GPUCost, ",")
|
|
|
jsonEncodeFloat64(buffer, "gpuCostAdjustment", a.GPUCostAdjustment, ",")
|
|
|
jsonEncodeFloat64(buffer, "networkTransferBytes", a.NetworkTransferBytes, ",")
|