Example #1
0
        /// <summary>
        /// Performs the data collection and the subsequent analysis.
        /// </summary>
        static void Collect(string processName)
        {
            var pcm = HarvestProcess.FromBinary("pcm-win", "pcm.exe", Resources.pcm_win);
            var os  = HarvestProcess.FromBinary("os-win", "PerfMonitor.exe", Resources.os_win);

            pcm.Run("1");
            os.Run(" -KernelEvents:ContextSwitch start");

            Console.WriteLine("Press any key to stop data collection...");
            Console.ReadKey();

            pcm.Stop();
            os.Run("stop");

            Console.WriteLine("Waiting for data collection to stop...");
            os.WaitForExit();
            pcm.WaitForExit();


            // Analyze
            var experiment = new HarvestExperimentWin();

            Console.WriteLine("Copying and merging to the experiment folder...");
            experiment.Merge(processName, pcm, os);
        }