Fix last commit
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using CMS_CORE_Library.Models;
|
||||
using Step.Config;
|
||||
using Step.Core;
|
||||
using Step.Model.DTOModels;
|
||||
using Step.Model.DTOModels.AlarmModels;
|
||||
@@ -722,9 +723,19 @@ public static class ThreadsFunctions
|
||||
float SumRec, SumSen;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
DTONetworkMonitor Monitor = new DTONetworkMonitor();
|
||||
int CardId = ServerConfig.ServerStartupConfig.NetworkCardId - 1;
|
||||
|
||||
PerformanceCounterCategory performanceCounterCategory = new PerformanceCounterCategory("Network Interface");
|
||||
Monitor.Name = performanceCounterCategory.GetInstanceNames()[0]; // 1st NIC !
|
||||
|
||||
if(CardId<0 || CardId > performanceCounterCategory.GetInstanceNames().Length )
|
||||
{
|
||||
Monitor.Name = "No card to monitor";
|
||||
MessageServices.Current.Publish(NETWORK_USAGE, null, Monitor);
|
||||
return;
|
||||
}
|
||||
|
||||
Monitor.Name = performanceCounterCategory.GetInstanceNames()[0];
|
||||
|
||||
|
||||
PerformanceCounter PC_Bandwith = new PerformanceCounter("Network Interface", "Current Bandwidth", Monitor.Name);
|
||||
PerformanceCounter PC_RecievedBytes = new PerformanceCounter("Network Interface", "Bytes Received/sec", Monitor.Name);
|
||||
|
||||
Reference in New Issue
Block a user