public static void Initialize()
		{
			if (_initialized) return;

			_serverRamCounter = new MemoryCounter();
			_serverRamCounter.Disable();

			_serverCpuCounter = new CpuCounter();
			_serverCpuCounter.Disable();

			ProcessHandler.ServerStarted += StartServerChecks;
			ProcessHandler.ServerStopped += StopServerChecks;

			_initialized = true;
		}
		private static void StartServerChecks()
		{
			_serverRamCounter = new MemoryCounter(ProcessHandler.ServerProcess.Id);
			_serverRamCounter.UpdateStats();
			_serverCpuCounter = new CpuCounter(ProcessHandler.ServerProcess.Id);
			_serverCpuCounter.UpdateStats();
		}
Ejemplo n.º 3
0
		private static string ConstructCpuLabelText(CpuCounter counter)
		{
			return counter.CpuUsage + "%";
		}