Browse Source

convert usage to megabytes

Alexander Belanger 4 years ago
parent
commit
13c8ca0814
2 changed files with 7 additions and 10 deletions
  1. 6 9
      api/types/usage.go
  2. 1 1
      internal/usage/usage.go

+ 6 - 9
api/types/usage.go

@@ -26,25 +26,22 @@ type ProjectUsage struct {
 }
 
 var BasicPlan = ProjectUsage{
-	ResourceCPU: 10,
-	// 20 GB converted to Mebibytes
-	ResourceMemory: 19074,
+	ResourceCPU:    10,
+	ResourceMemory: 20000,
 	Clusters:       1,
 	Users:          1,
 }
 
 var TeamPlan = ProjectUsage{
-	ResourceCPU: 20,
-	// 40 GB converted to Mebibytes
-	ResourceMemory: 38148,
+	ResourceCPU:    20,
+	ResourceMemory: 40000,
 	Clusters:       3,
 	Users:          3,
 }
 
 var GrowthPlan = ProjectUsage{
-	ResourceCPU: 80,
-	// 160 GB converted to Mebibytes
-	ResourceMemory: 152592,
+	ResourceCPU:    80,
+	ResourceMemory: 160000,
 	Clusters:       0,
 	Users:          5,
 }

+ 1 - 1
internal/usage/usage.go

@@ -125,5 +125,5 @@ func getResourceUsage(opts *GetUsageOpts, clusters []*models.Cluster) (uint, uin
 		totMem += totAlloc.Memory
 	}
 
-	return totCPU / 1000, totMem / (1024 * 1024), nil
+	return totCPU / 1000, totMem / (1000 * 1000), nil
 }