Sfoglia il codice sorgente

add comment describing AccumulateBy

Alejandro 4 anni fa
parent
commit
b3030e16da
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      pkg/kubecost/allocation.go

+ 3 - 0
pkg/kubecost/allocation.go

@@ -2260,6 +2260,9 @@ func (asr *AllocationSetRange) Accumulate() (*AllocationSet, error) {
 	return allocSet, nil
 }
 
+// AccumulateBy sums AllocationSets based on the resolution given. The resolution given is subject to the scale used for the AllocationSets.
+// If the requested resolution is smaller than the window of an AllocationSet then the resolution will default to the duration of a set.
+// Resolutions larger than the duration of the entire AllocationSetRange will default to the duration of the range.
 func (asr *AllocationSetRange) AccumulateBy(resolution time.Duration) (*AllocationSetRange, error) {
 	allocSetRange := &AllocationSetRange{allocations: []*AllocationSet{}}
 	var allocSet *AllocationSet