From eb1f798a7f62978aae36be19a95d6ec1c2f09e21 Mon Sep 17 00:00:00 2001 From: peusterm Date: Sun, 17 Apr 2016 09:30:37 -0700 Subject: [PATCH] Revert "improved resource model logging" --- src/emuvim/dcemulator/resourcemodel/upb/simple.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/emuvim/dcemulator/resourcemodel/upb/simple.py b/src/emuvim/dcemulator/resourcemodel/upb/simple.py index 6cc1687..9d5df06 100644 --- a/src/emuvim/dcemulator/resourcemodel/upb/simple.py +++ b/src/emuvim/dcemulator/resourcemodel/upb/simple.py @@ -33,8 +33,6 @@ class UpbSimpleCloudDcRM(BaseResourceModel): self.dc_alloc_mu = 0 self.deactivate_cpu_limit = deactivate_cpu_limit self.deactivate_mem_limit = deactivate_mem_limit - self.single_cu = 0 # current value for a single cu - self.single_mu = 0 # current value for a single mu super(self.__class__, self).__init__() def allocate(self, d): @@ -127,9 +125,9 @@ class UpbSimpleCloudDcRM(BaseResourceModel): # get cpu time fraction for entire emulation e_cpu = self.registrar.e_cpu # calculate cpu time fraction of a single compute unit - self.single_cu = float(e_cpu) / sum([rm.dc_max_cu for rm in list(self.registrar.resource_models)]) + single_cu = float(e_cpu) / sum([rm.dc_max_cu for rm in list(self.registrar.resource_models)]) # calculate cpu time fraction for container with given flavor - cpu_time_percentage = self.single_cu * number_cu + cpu_time_percentage = single_cu * number_cu # calculate cpu period and quota for CFS # (see: https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) # Attention minimum cpu_quota is 1ms (micro) @@ -155,9 +153,9 @@ class UpbSimpleCloudDcRM(BaseResourceModel): # get memory amount for entire emulation e_mem = self.registrar.e_mem # calculate amount of memory for a single mu - self.single_mu = float(e_mem) / sum([rm.dc_max_mu for rm in list(self.registrar.resource_models)]) + single_mu = float(e_mem) / sum([rm.dc_max_mu for rm in list(self.registrar.resource_models)]) # calculate mem for given flavor - mem_limit = self.single_mu * number_mu + mem_limit = single_mu * number_mu # ATTENTION minimum mem_limit per container is 4MB if mem_limit < 4: mem_limit = 4 @@ -193,8 +191,6 @@ class UpbSimpleCloudDcRM(BaseResourceModel): r["dc_max_mu"] = self.dc_max_mu r["dc_alloc_cu"] = self.dc_alloc_cu r["dc_alloc_mu"] = self.dc_alloc_mu - r["single_cu_percentage"] = self.single_cu - r["single_mu_percentage"] = self.single_mu r["allocation_state"] = allocation_state return r -- 2.25.1