示例#1
0
 public void StartProfiling(StartProfilingInfo profilingInfo)
 {
     if (profilingInfo is StartProfilingProcessInfo)
     {
         var options = OpenOptionsDialog();
         CurrentSession = KrofilerSession.CreateFromProcess(((StartProfilingProcessInfo)profilingInfo).ExePath, ((StartProfilingProcessInfo)profilingInfo).Args, options);
         Settings.Instance.RecentlyRecordedFiles.Remove(CurrentSession.MlpdPath);
         Settings.Instance.RecentlyRecordedFiles.Insert(0, CurrentSession.MlpdPath);
         Settings.Instance.Save();
     }
     else if (profilingInfo is StartProfilingFromFileInfo)
     {
         CurrentSession = KrofilerSession.CreateFromFile(((StartProfilingFromFileInfo)profilingInfo).MlpdFilePath);
     }
     else
     {
         throw new NotSupportedException($"{profilingInfo.GetType().FullName} is not supported.");
     }
     CurrentSession.NewHeapshot               += HandleNewHeapshot;
     CurrentSession.AllocationsPerSecond      += AllocationsPerSecond;
     CurrentSession.CountersDescriptionsAdded += CountersDescriptionsAdded;
     CurrentSession.CounterSamplesAdded       += CounterSamplesAdded;
     CurrentSession.UserError += UserError;
     CurrentSession.StartParsing();
 }
示例#2
0
        public void StartProfiling(StartProfilingInfo profilingInfo)
        {
            var homeTab = new HomeTab();

            InsertTab(homeTab, null);
            homeTab.StartProfiling(profilingInfo);
        }
示例#3
0
        void StartProfiling(StartProfilingInfo startProfInfo)
        {
            var profilingInProgressPage = new ProfilingPage();
            var tabPage = new TabPage(profilingInProgressPage)
            {
                Text = "Profiling"
            };

            ((TabControl)Parent.Parent).Pages.Add(tabPage);
            ((TabControl)Parent.Parent).SelectedPage = tabPage;
            profilingInProgressPage.StartProfiling(startProfInfo);
        }
示例#4
0
 public void StartProfiling(StartProfilingInfo profilingInfo)
 {
     if (profilingInfo is StartProfilingProcessInfo)
     {
         CurrentSession = KrofilerSession.CreateFromProcess(((StartProfilingProcessInfo)profilingInfo).ExePath);
     }
     else if (profilingInfo is StartProfilingFromFileInfo)
     {
         CurrentSession = KrofilerSession.CreateFromFile(((StartProfilingFromFileInfo)profilingInfo).MlpdFilePath);
     }
     else
     {
         throw new NotSupportedException($"{profilingInfo.GetType().FullName} is not supported.");
     }
     CurrentSession.NewHeapshot += HandleNewHeapshot;
     CurrentSession.StartParsing();
 }