Przeglądaj źródła

Generate codec code with bingen

Sean Holcomb 5 lat temu
rodzic
commit
dffe0f03f1
2 zmienionych plików z 12 dodań i 13 usunięć
  1. 1 1
      pkg/kubecost/bingen.go
  2. 11 12
      pkg/kubecost/kubecost_codecs.go

+ 1 - 1
pkg/kubecost/bingen.go

@@ -21,4 +21,4 @@ package kubecost
 // @bingen:generate:AllocationSet
 // @bingen:generate:AllocationSet
 // @bingen:generate:AllocationSetRange
 // @bingen:generate:AllocationSetRange
 
 
-//go:generate bingen -package=kubecost -version=8 -buffer=github.com/kubecost/cost-model/pkg/util
+//go:generate bingen -package=kubecost -version=9 -buffer=github.com/kubecost/cost-model/pkg/util

+ 11 - 12
pkg/kubecost/kubecost_codecs.go

@@ -14,11 +14,10 @@ package kubecost
 import (
 import (
 	"encoding"
 	"encoding"
 	"fmt"
 	"fmt"
+	util "github.com/kubecost/cost-model/pkg/util"
 	"reflect"
 	"reflect"
 	"strings"
 	"strings"
 	"time"
 	"time"
-
-	util "github.com/kubecost/cost-model/pkg/util"
 )
 )
 
 
 const (
 const (
@@ -26,7 +25,7 @@ const (
 	GeneratorPackageName string = "kubecost"
 	GeneratorPackageName string = "kubecost"
 
 
 	// CodecVersion is the version passed into the generator
 	// CodecVersion is the version passed into the generator
-	CodecVersion uint8 = 8
+	CodecVersion uint8 = 9
 )
 )
 
 
 //--------------------------------------------------------------------------
 //--------------------------------------------------------------------------
@@ -270,26 +269,26 @@ func (target *Allocation) UnmarshalBinary(data []byte) (err error) {
 	y := buff.ReadFloat64() // read float64
 	y := buff.ReadFloat64() // read float64
 	target.PVByteHours = y
 	target.PVByteHours = y
 
 
-	z := buff.ReadFloat64() // read float64
-	target.PVCost = z
-
 	aa := buff.ReadFloat64() // read float64
 	aa := buff.ReadFloat64() // read float64
-	target.RAMByteHours = aa
+	target.PVCost = aa
 
 
 	bb := buff.ReadFloat64() // read float64
 	bb := buff.ReadFloat64() // read float64
-	target.RAMBytesRequestAverage = bb
+	target.RAMByteHours = bb
 
 
 	cc := buff.ReadFloat64() // read float64
 	cc := buff.ReadFloat64() // read float64
-	target.RAMBytesUsageAverage = cc
+	target.RAMBytesRequestAverage = cc
 
 
 	dd := buff.ReadFloat64() // read float64
 	dd := buff.ReadFloat64() // read float64
-	target.RAMCost = dd
+	target.RAMBytesUsageAverage = dd
 
 
 	ee := buff.ReadFloat64() // read float64
 	ee := buff.ReadFloat64() // read float64
-	target.SharedCost = ee
+	target.RAMCost = ee
 
 
 	ff := buff.ReadFloat64() // read float64
 	ff := buff.ReadFloat64() // read float64
-	target.ExternalCost = ff
+	target.SharedCost = ff
+
+	gg := buff.ReadFloat64() // read float64
+	target.ExternalCost = gg
 
 
 	return nil
 	return nil
 }
 }