mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 06:15:08 +00:00
Added a RAM sensor for used memory.
This commit is contained in:
@@ -14,6 +14,7 @@ namespace OpenHardwareMonitor.Hardware.RAM {
|
||||
internal class GenericRAM : Hardware {
|
||||
|
||||
private Sensor loadSensor;
|
||||
private Sensor usedMemory;
|
||||
private Sensor availableMemory;
|
||||
|
||||
public GenericRAM(string name, ISettings settings)
|
||||
@@ -22,7 +23,11 @@ namespace OpenHardwareMonitor.Hardware.RAM {
|
||||
loadSensor = new Sensor("Memory", 0, SensorType.Load, this, settings);
|
||||
ActivateSensor(loadSensor);
|
||||
|
||||
availableMemory = new Sensor("Available Memory", 0, SensorType.Data, this,
|
||||
usedMemory = new Sensor("Used Memory", 0, SensorType.Data, this,
|
||||
settings);
|
||||
ActivateSensor(usedMemory);
|
||||
|
||||
availableMemory = new Sensor("Available Memory", 1, SensorType.Data, this,
|
||||
settings);
|
||||
ActivateSensor(availableMemory);
|
||||
}
|
||||
@@ -45,6 +50,9 @@ namespace OpenHardwareMonitor.Hardware.RAM {
|
||||
(100.0f * status.AvailablePhysicalMemory) /
|
||||
status.TotalPhysicalMemory;
|
||||
|
||||
usedMemory.Value = (float)(status.TotalPhysicalMemory
|
||||
- status.AvailablePhysicalMemory) / (1024 * 1024 * 1024);
|
||||
|
||||
availableMemory.Value = (float)status.AvailablePhysicalMemory /
|
||||
(1024 * 1024 * 1024);
|
||||
}
|
||||
|
@@ -10,5 +10,5 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.5.0.0")]
|
||||
[assembly: AssemblyInformationalVersion("0.5.0 Beta")]
|
||||
[assembly: AssemblyVersion("0.5.1.0")]
|
||||
[assembly: AssemblyInformationalVersion("0.5.1 Beta")]
|
Reference in New Issue
Block a user