Просмотр исходного кода

DisableAggregatedStores query option and Resolution for Assets

Niko Kovacevic 4 лет назад
Родитель
Сommit
ca1f8ce632
2 измененных файлов с 14 добавлено и 8 удалено
  1. 5 0
      pkg/kubecost/asset.go
  2. 9 8
      pkg/kubecost/query.go

+ 5 - 0
pkg/kubecost/asset.go

@@ -2712,6 +2712,11 @@ func (as *AssetSet) Map() map[string]Asset {
 	return as.Clone().assets
 }
 
+// Resolution returns the AssetSet's window duration
+func (as *AssetSet) Resolution() time.Duration {
+	return as.Window.Duration()
+}
+
 func (as *AssetSet) Set(asset Asset, aggregateBy []string) error {
 	if as.IsEmpty() {
 		as.Lock()

+ 9 - 8
pkg/kubecost/query.go

@@ -58,14 +58,15 @@ type AllocationQueryOptions struct {
 
 // AssetQueryOptions defines optional parameters for querying an Asset Store
 type AssetQueryOptions struct {
-	Accumulate         bool
-	AggregateBy        []string
-	Compute            bool
-	DisableAdjustments bool
-	FilterFuncs        []AssetMatchFunc
-	IncludeCloud       bool
-	SharedHourlyCosts  map[string]float64
-	Step               time.Duration
+	Accumulate              bool
+	AggregateBy             []string
+	Compute                 bool
+	DisableAdjustments      bool
+	DisableAggregatedStores bool
+	FilterFuncs             []AssetMatchFunc
+	IncludeCloud            bool
+	SharedHourlyCosts       map[string]float64
+	Step                    time.Duration
 }
 
 // CloudUsageQueryOptions define optional parameters for querying a Store