소스 검색

Improve CPU/mem efficiency by avoiding tracking multiple values

By default, LibreHardwareMonitor will track 24 hours worth of values,
this does not bode well for CPU (which needs to manage the in memory
list) as well as memory usage.

This commit improves the efficiency by not tracking existing values (as
this is for the the downstream metric store).
Nick Babcock 1 년 전
부모
커밋
bdf9c2d1f9
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      OhmGraphite/SensorCollector.cs

+ 2 - 0
OhmGraphite/SensorCollector.cs

@@ -4,6 +4,7 @@ using System.Linq;
 using NLog;
 using LibreHardwareMonitor.Hardware;
 using LibreHardwareMonitor.Hardware.Storage;
+using System;
 
 namespace OhmGraphite
 {
@@ -111,6 +112,7 @@ namespace OhmGraphite
 
         private void SensorAdded(ISensor sensor)
         {
+            sensor.ValuesTimeWindow = TimeSpan.Zero;
             var added = _ids.TryAdd(sensor.Identifier, sensor);
             var msg = added ? "Sensor added: {0} \"{1}\"" : "Sensor previously added: {0} \"{1}\"";
             Logger.Info(msg, sensor.Identifier, SensorName(sensor));