예제 #1
0
        public static String toStringReport(systemStatusData input)
        {
            builderForText sb = new builderForText();

            sb.AppendLine("Starting time: " + input.startedDateTime.ToShortTimeString());
            sb.AppendLine("Running time: " +
                          String.Format("{0}:{1}:{2}", input.timeRunningTimeSpan.Hours,
                                        input.timeRunningTimeSpan.Minutes, input.timeRunningTimeSpan.Seconds));
            sb.AppendLine("Memory usage: " + input.memoryUsage);
            sb.AppendLine("Threads count: " + input.threads);
            sb.AppendLine("Process list: ");
            foreach (Process p in input.ps)
            {
                try
                {
                    sb.AppendLine(p.ProcessName + " [" + p.Id + "] " + p.MainModule.FileName);
                }
                catch (Exception ex)
                {
                    sb.AppendLine(p.ProcessName + " [" + p.Id + "] not accessible :: " + ex.Message);
                }
            }
            sb.prevTabLevel();
            return(sb.ToString());
        }
예제 #2
0
        public static systemStatusData getSystemStatusData()
        {
            systemStatusData output = new systemStatusData();

            output.startedDateTime     = Process.GetCurrentProcess().StartTime;
            output.timeRunningTimeSpan = DateTime.UtcNow - output.startedDateTime;

            output.memoryUsage = getMemory();

            output.ps = getProcessList("", true, output.startedDateTime, true);

            output.threads = getThreads();

            return(output);
        }
예제 #3
0
        public static String getSystemStatusReport()
        {
            systemStatusData rep = getSystemStatusData();

            return(toStringReport(rep));
        }