public override void RunTask() { double cpu = GetCPU(); double memory = GetMemory(); if (telemetry != null) { telemetry.Collect(new HardwareUsage(cpu, memory, coreServer.CurrentThreadsCount())); } }
public void ReleaseMemory() { int retrieves = 0; while (coreServer.CurrentThreadsCount() > 0 && retrieves < 3) { Thread.Sleep(1000); retrieves += 1; } GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); }
public int CurrentThreadsCount() { return(realServer.CurrentThreadsCount()); }