Hardware/RAM/GenericRAM.cs
changeset 377 6022d558ef7d
parent 372 2de3a3e5f0b5
     1.1 --- a/Hardware/RAM/GenericRAM.cs	Thu Jul 26 06:50:56 2012 +0000
     1.2 +++ b/Hardware/RAM/GenericRAM.cs	Thu Jul 26 06:51:19 2012 +0000
     1.3 @@ -14,6 +14,7 @@
     1.4    internal class GenericRAM : Hardware {
     1.5  
     1.6      private Sensor loadSensor;
     1.7 +    private Sensor usedMemory;
     1.8      private Sensor availableMemory;
     1.9  
    1.10      public GenericRAM(string name, ISettings settings)
    1.11 @@ -22,7 +23,11 @@
    1.12        loadSensor = new Sensor("Memory", 0, SensorType.Load, this, settings);
    1.13        ActivateSensor(loadSensor);
    1.14  
    1.15 -      availableMemory = new Sensor("Available Memory", 0, SensorType.Data, this, 
    1.16 +      usedMemory = new Sensor("Used Memory", 0, SensorType.Data, this,
    1.17 +        settings);
    1.18 +      ActivateSensor(usedMemory);
    1.19 +
    1.20 +      availableMemory = new Sensor("Available Memory", 1, SensorType.Data, this, 
    1.21          settings);
    1.22        ActivateSensor(availableMemory);
    1.23      }
    1.24 @@ -45,6 +50,9 @@
    1.25          (100.0f * status.AvailablePhysicalMemory) /
    1.26          status.TotalPhysicalMemory;
    1.27  
    1.28 +      usedMemory.Value = (float)(status.TotalPhysicalMemory 
    1.29 +        - status.AvailablePhysicalMemory) / (1024 * 1024 * 1024);
    1.30 +
    1.31        availableMemory.Value = (float)status.AvailablePhysicalMemory /
    1.32          (1024 * 1024 * 1024);
    1.33      }