Exemple #1
0
        void ShowDiffOfOpenSnapshots()
        {
            if (m_UIState.diffMode != null)
            {
                SwitchSnapshotMode(UIState.ViewMode.ShowDiff);
            }
            else if (First != null && Second != null)
            {
                try
                {
                    MemoryProfilerAnalytics.StartEvent <MemoryProfilerAnalytics.DiffedSnapshotEvent>();

                    m_UIState.DiffLastAndCurrentSnapshot(First.GuiData.UtcDateTime.CompareTo(Second.GuiData.UtcDateTime) < 0);

                    MemoryProfilerAnalytics.EndEvent(new MemoryProfilerAnalytics.DiffedSnapshotEvent());
                }
                catch (Exception)
                {
                    throw;
                }
            }
            else
            {
                Debug.LogError("No second snapshot opened to diff to!");
            }
        }
Exemple #2
0
        void SwitchSnapshotMode(UIState.ViewMode mode)
        {
            if (m_UIState.CurrentViewMode == mode)
            {
                return;
            }

            var currentViewName = "Unknown";

            if (currentViewPane is UI.TreeMapPane)
            {
                currentViewName = "TreeMap";
            }
            else if (currentViewPane is UI.MemoryMapPane)
            {
                currentViewName = "MemoryMap";
            }
            else if (currentViewPane is UI.SpreadsheetPane)
            {
                currentViewName = (currentViewPane as UI.SpreadsheetPane).TableDisplayName;
            }
            MemoryProfilerAnalytics.StartEvent <MemoryProfilerAnalytics.DiffToggledEvent>();

            var oldMode = m_UIState.CurrentViewMode;

            m_UIState.CurrentViewMode = mode;

            MemoryProfilerAnalytics.EndEvent(new MemoryProfilerAnalytics.DiffToggledEvent()
            {
                show     = (int)ConvertUIModeToAnalyticsDiffToggleEventData(m_UIState.CurrentViewMode),
                shown    = (int)ConvertUIModeToAnalyticsDiffToggleEventData(oldMode),
                viewName = currentViewName
            });
        }
Exemple #3
0
        void ShowDiffOfOpenSnapshots()
        {
            if (m_UIState.diffMode != null)
            {
                SwitchSnapshotMode(UIState.ViewMode.ShowDiff);
            }
            else if (First != null && Second != null)
            {
                try
                {
                    using (new Service <IDebugContextService> .ScopeService(new DebugContextService()))
                    {
                        MemoryProfilerAnalytics.StartEvent <MemoryProfilerAnalytics.DiffedSnapshotEvent>();

                        m_UIState.DiffLastAndCurrentSnapshot(First.GuiData.UtcDateTime.CompareTo(Second.GuiData.UtcDateTime) < 0);

                        MemoryProfilerAnalytics.EndEvent(new MemoryProfilerAnalytics.DiffedSnapshotEvent());
                    }
                }
                catch (ExitGUIException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    throw new Exception(DebugUtility.GetExceptionHelpMessage(e));
                }
            }
            else
            {
                Debug.LogError("No second snapshot opened to diff to!");
            }
        }