Page 1 of 1

Saving composed profiling session from 2 different session

Posted: Mon Apr 08, 2013 3:22 pm
by JuergenKlopf
For a detailed analysis in the stand alone tool I need to saving a profiling session that is created in 2 different sessions.

Code: Select all

using (var savedSession = app.LoadSession(PathToPrimarySnapshot))
{
    var saveHeaders = savedSession.SessionFile.GetSnapshotHeaders();
    using (var activeSession = app.CreateSession(GetStartInfo()))
    {
        StartSessionAndCollectSnapshot(activeSession);
        var activeHeaders = activeSession.SessionFile.GetSnapshotHeaders();
        var comparison = activeSession.Comparison;
        comparison.CompareSnapshots(activeHeaders[0], saveHeaders[0]);

        var snapShotSaveSelections = new[]
            {
                new SnapShotSaveSelection(saveHeaders[0], "primary", true),
                new SnapShotSaveSelection(activeHeaders[0], "comparison", true)
            };

        var path = Path.Combine(WorkPath, _testCase + ".prfsession");
        activeSession.Save(path, snapShotSaveSelections, true, comparison);
    }
}
Depending on which session the save method is called either the primary or the comparison snapshot will only be saved. Is there a possibility to save the combined session?

Thanks in advanced!

Re: Saving composed profiling session from 2 different sessi

Posted: Wed Apr 10, 2013 9:17 pm
by Andreas Suurkuusk
No, it is not possible to save a session that contains snapshots from two different sessions. The snapshots provided to the Save method should all belong to the session on which Save is called.

However, you can compare snapshots from two different sessions (as you have done). The compared type information will then contain delta information between the two snapshots. You can also compare two snapshots in the user interface. For more information, see the online documentation. The functionality to compare snapshots from two sessions is currently a bit limited, and the user interface is a bit awkward. This is something we will improve in a future version of the profiler.