コード例 #1
0
 private static void StartServerChecks()
 {
     _serverRamCounter = new MemoryCounter(ProcessHandler.ServerProcess.Id);
     _serverRamCounter.UpdateStats();
     _serverCpuCounter = new CpuCounter(ProcessHandler.ServerProcess.Id);
     _serverCpuCounter.UpdateStats();
 }
コード例 #2
0
        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;
        }
コード例 #3
0
		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;
		}
コード例 #4
0
		private static void StartServerChecks()
		{
			_serverRamCounter = new MemoryCounter(ProcessHandler.ServerProcess.Id);
			_serverRamCounter.UpdateStats();
			_serverCpuCounter = new CpuCounter(ProcessHandler.ServerProcess.Id);
			_serverCpuCounter.UpdateStats();
		}
コード例 #5
0
		private static string ConstructRamLabelText(MemoryCounter counter)
		{
			return counter.MemoryUsageMb + "Mb (" +
			       counter.MemoryUsagePct.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0') +
			       "%)";
		}