Added a RAM sensor for used memory.
authormoel.mich
Thu, 26 Jul 2012 06:51:19 +0000
changeset 3776022d558ef7d
parent 376 df64b56ece65
child 378 64d3ddf8d73b
Added a RAM sensor for used memory.
Hardware/RAM/GenericRAM.cs
Properties/AssemblyVersion.cs
     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      }
     2.1 --- a/Properties/AssemblyVersion.cs	Thu Jul 26 06:50:56 2012 +0000
     2.2 +++ b/Properties/AssemblyVersion.cs	Thu Jul 26 06:51:19 2012 +0000
     2.3 @@ -10,5 +10,5 @@
     2.4  
     2.5  using System.Reflection;
     2.6  
     2.7 -[assembly: AssemblyVersion("0.5.0.0")]
     2.8 -[assembly: AssemblyInformationalVersion("0.5.0 Beta")]
     2.9 \ No newline at end of file
    2.10 +[assembly: AssemblyVersion("0.5.1.0")]
    2.11 +[assembly: AssemblyInformationalVersion("0.5.1 Beta")]
    2.12 \ No newline at end of file