Explorar o código

Add comments to exported function

Sean Holcomb %!s(int64=5) %!d(string=hai) anos
pai
achega
c0a2c00e36
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      pkg/kubecost/allocation.go

+ 7 - 1
pkg/kubecost/allocation.go

@@ -329,27 +329,32 @@ func (a *Allocation) Equal(that *Allocation) bool {
 	return true
 	return true
 }
 }
 
 
-// TotalCost is the total cost of the Allocation
+// TotalCost is the total cost of the Allocation including adjustments
 func (a *Allocation) TotalCost() float64 {
 func (a *Allocation) TotalCost() float64 {
 	return a.CPUTotalCost() + a.GPUTotalCost() + a.RAMTotalCost() + a.PVTotalCost() + a.NetworkCost + a.SharedCost + a.ExternalCost + a.LoadBalancerCost
 	return a.CPUTotalCost() + a.GPUTotalCost() + a.RAMTotalCost() + a.PVTotalCost() + a.NetworkCost + a.SharedCost + a.ExternalCost + a.LoadBalancerCost
 }
 }
 
 
+// CPUTotalCost calculates total CPU cost of Allocation including adjustment
 func (a *Allocation) CPUTotalCost() float64 {
 func (a *Allocation) CPUTotalCost() float64 {
 	return a.CPUCost + a.CPUCostAdjustment
 	return a.CPUCost + a.CPUCostAdjustment
 }
 }
 
 
+// GPUTotalCost calculates total GPU cost of Allocation including adjustment
 func (a *Allocation) GPUTotalCost() float64 {
 func (a *Allocation) GPUTotalCost() float64 {
 	return a.GPUCost + a.GPUCostAdjustment
 	return a.GPUCost + a.GPUCostAdjustment
 }
 }
 
 
+// RAMTotalCost calculates total RAM cost of Allocation including adjustment
 func (a *Allocation) RAMTotalCost() float64 {
 func (a *Allocation) RAMTotalCost() float64 {
 	return a.RAMCost + a.RAMCostAdjustment
 	return a.RAMCost + a.RAMCostAdjustment
 }
 }
 
 
+// PVTotalCost calculates total PV cost of Allocation including adjustment
 func (a *Allocation) PVTotalCost() float64 {
 func (a *Allocation) PVTotalCost() float64 {
 	return a.PVCost() + a.PVCostAdjustment
 	return a.PVCost() + a.PVCostAdjustment
 }
 }
 
 
+// PVCost calculate cumulative cost of all PVs that Allocation is attached to
 func (a *Allocation) PVCost() float64 {
 func (a *Allocation) PVCost() float64 {
 	cost := 0.0
 	cost := 0.0
 	for _, pv := range a.PVs {
 	for _, pv := range a.PVs {
@@ -358,6 +363,7 @@ func (a *Allocation) PVCost() float64 {
 	return cost
 	return cost
 }
 }
 
 
+// PVByteHours calculate cumulative ByteHours of all PVs that Allocation is attached to
 func (a *Allocation) PVByteHours() float64 {
 func (a *Allocation) PVByteHours() float64 {
 	byteHours := 0.0
 	byteHours := 0.0
 	for _, pv := range a.PVs {
 	for _, pv := range a.PVs {