Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch RAM to an AutoFetcher, return a used-wired-active total.

  • Loading branch information...
commit c951026d6a62a70dec12265f2b2fc6faef7d1128 1 parent 00792b5
@markfickett authored
Showing with 17 additions and 6 deletions.
  1. +17 −0 RamFetcher.py
  2. +0 −6 RamValues.py
View
17 RamFetcher.py
@@ -0,0 +1,17 @@
+from Manifest import psutil, AutoFetcher
+
+class RamFetcher(AutoFetcher.AutoFetcher):
+ """
+ Get the decimal fraction in [0.0, 1.0] of used physical memory.
+ """
+ def _update(self):
+ with self._lockGuard():
+ self.__fraction = (psutil.used_phymem()
+ / float(psutil.TOTAL_PHYMEM))
+ self._callChangeCallback()
+
+ def getFraction(self):
+ with self._lockGuard():
+ return self.__fraction
+
+
View
6 RamValues.py
@@ -1,6 +0,0 @@
-from Manifest import psutil
-
-def GetRamUsedFraction():
- """Get the decimal fraction in [0.0, 1.0] of used physical memory."""
- return psutil.used_phymem() / float(psutil.TOTAL_PHYMEM)
-
Please sign in to comment.
Something went wrong with that request. Please try again.