reset cgrouptotals without destroying working set
smbaker [Tue, 18 Dec 2012 06:24:06 +0000 (22:24 -0800)]
apps/gacks/gackswatcher.py

index 20958a5..cda1a27 100755 (executable)
@@ -242,6 +242,9 @@ class CgroupTotals:
         self.cgroups = {}
         self.working_cgroups = {}
 
+    def reset(self):
+        self.cgroups = {}
+
     def get_unreserved_cores(self):
         # We need to get the list of default cpus from somewhere.
         # If we're using vservers, then the nodemanager will put the default
@@ -421,7 +424,7 @@ def monitor(opts):
 
             # We've written the totals, so start over with a new 'cgroups'
             # to hold new totals.
-            cgroups = CgroupTotals()
+            cgroups.reset()
             last_hour = hour
 
         time.sleep(opts.delay)