예제 #1
0
        private static double GetProcessStatistic_MemoryUsage(object source, string arguments)
        {
            double          statistic = double.NaN;
            ProcessLauncher launcher  = source as ProcessLauncher;

            if ((object)launcher != null && !launcher.m_disposed && !launcher.m_process.HasExited)
            {
                statistic = launcher.m_process.WorkingSet64 / (double)SI2.Mega;
            }

            return(statistic);
        }
예제 #2
0
        private static double GetProcessStatistic_UpTime(object source, string arguments)
        {
            double          statistic = double.NaN;
            ProcessLauncher launcher  = source as ProcessLauncher;

            if ((object)launcher != null && !launcher.m_disposed && !launcher.m_process.HasExited)
            {
                statistic = (DateTime.Now - launcher.m_process.StartTime).TotalSeconds;
            }

            return(statistic);
        }
예제 #3
0
        // Static Methods

        // ReSharper disable UnusedMember.Local
        // ReSharper disable UnusedParameter.Local
        private static double GetProcessStatistic_CPUUsage(object source, string arguments)
        {
            double          statistic = double.NaN;
            ProcessLauncher launcher  = source as ProcessLauncher;

            if ((object)launcher != null && !launcher.m_disposed && launcher.m_processUtilizationCalculator.UpdateInterval > 0)
            {
                statistic = launcher.m_processUtilizationCalculator.Utilization;
            }

            return(statistic);
        }