Esempio n. 1
0
        void IncomingSnapshot(PackedMemorySnapshot snapshot)
        {
            _snapshot = snapshot;

            _packedCrawled = new Crawler().Crawl(_snapshot);
            Unpack();
        }
 private static void DispatchSnapshot(PackedMemorySnapshot snapshot)
 {
   System.Action<PackedMemorySnapshot> snapshotReceived = MemorySnapshot.OnSnapshotReceived;
   if (snapshotReceived == null)
     return;
   snapshotReceived(snapshot);
 }
 private static void DispatchSnapshot(PackedMemorySnapshot snapshot)
 {
     Action<PackedMemorySnapshot> onSnapshotReceived = OnSnapshotReceived;
     if (onSnapshotReceived != null)
     {
         onSnapshotReceived(snapshot);
     }
 }
        void IncomingSnapshot(PackedMemorySnapshot snapshot)
        {
            m_nodeView.ClearNodeView();
            m_Status  = "Unpacking snapshot.... OK.";
            _snapshot = snapshot;

            _packedCrawled = new Crawler().Crawl(_snapshot);
            Unpack();
        }
        void IncomingSnapshot(PackedMemorySnapshot snapshot)
        {
            SetPrevSnapshot(_snapshot);

            _snapshot  = snapshot;
            _snap_time = DateTime.Now.ToString("H:mm:ss");

            _packedCrawled = new Crawler().Crawl(_snapshot);
            Unpack();
        }
 void IncomingSnapshot(PackedMemorySnapshot snapshot)
 {
     m_nodeView.ClearNodeView();
     _snapshot                = snapshot;
     _packedCrawled           = null;
     _unpackedCrawl           = null;
     _packedCrawlGenerating   = false;
     _unpackedCrawlGenerating = false;
     m_Status = "Incoming s_unpackedCrawlGenerated = false;napshot.... OK.";
 }
        void SetPrevSnapshot(PackedMemorySnapshot snapshot)
        {
            if (snapshot == null)
            {
                return;
            }

            _snap_prev_time     = _snap_time;
            _snapshot_prev      = snapshot;
            _packedCrewled_prev = new Crawler().Crawl(_snapshot_prev);
            _unpackedCrawl_prev = CrawlDataUnpacker.Unpack(_packedCrewled_prev);
        }
        void IncomingSnapshot(PackedMemorySnapshot snapshot)
        {
            if (_isRequestingCompBegin)
            {
                OnSnapshotBeginComparing(snapshot);
            }

            _snapshot = snapshot;

            _packedCrawled = new Crawler().Crawl(_snapshot);
            Unpack();
        }
        void OnSnapshotReceived(PackedMemorySnapshot snapshot)
        {
            _snapshot = snapshot;
            var snapshotInfo = new MemSnapshotInfo();

            snapshotInfo.setSnapShotTime(Time.realtimeSinceStartup);
            snapshotInfo.setSnapshotPacked(_snapshot);

            _SnapshotOptions.Add(_SnapshotChunks.Count.ToString());
            _SnapshotChunks.Add(snapshotInfo);

            _selectedSnapshot = _SnapshotChunks.Count - 1;
            showSnapshotInfo();
        }
Esempio n. 10
0
        void IncomingSnapshot(PackedMemorySnapshot snapshot)
        {
            _snapshot = snapshot;

            UnityEditor.EditorUtility.DisplayProgressBar("Take Snapshot", "Crawling Snapshot...", 0.33f);

            _packedCrawled = new Crawler().Crawl(_snapshot);

            UnityEditor.EditorUtility.DisplayProgressBar("Take Snapshot", "Unpacking Snapshot...", 0.67f);

            Unpack();

            UnityEditor.EditorUtility.ClearProgressBar();
        }
Esempio n. 11
0
        void _IncomingSnapshot(PackedMemorySnapshot snapshot)
        {
            _snapshot = snapshot;

            MemUtil.LoadSnapshotProgress(0.01f, "creating Crawler");

            _packedCrawled = new Crawler().Crawl(_snapshot);
            MemUtil.LoadSnapshotProgress(0.7f, "unpacking");

            _unpackedCrawl = CrawlDataUnpacker.Unpack(_packedCrawled);
            MemUtil.LoadSnapshotProgress(0.8f, "creating Inspector");

            _inspector = new Inspector(this, _unpackedCrawl, _snapshot);
            MemUtil.LoadSnapshotProgress(0.9f, "refreshing view");

            RefreshCurrentView();
            MemUtil.LoadSnapshotProgress(1.0f, "done");
        }
        private static void SnapshotFinished(string path, bool result)
        {
            if (result)
            {
                Profiling.Memory.Experimental.PackedMemorySnapshot snapshot = Profiling.Memory.Experimental.PackedMemorySnapshot.Load(path);

                var oldSnapshot = new PackedMemorySnapshot(snapshot);
                snapshot.Dispose();
                File.Delete(path);

                OnSnapshotReceived(oldSnapshot);
            }
            else
            {
                if (File.Exists(path))
                {
                    File.Delete(path);
                }

                OnSnapshotReceived(null);
            }
        }
 public void SetCompareTarget(UnityEditor.MemoryProfiler.PackedMemorySnapshot snapshot)
 {
     _snapshot      = snapshot;
     _packedCrawled = new Crawler().Crawl(_snapshot);
     _unpackedCrawl = CrawlDataUnpacker.Unpack(_packedCrawled);
 }
        void TopToolBar(Rect rect)
        {
            GUILayout.BeginArea(rect);
            using (new EditorGUILayout.HorizontalScope()) {
                var style = "miniButton";
                if (GUILayout.Button("Take Snapshot", style))
                {
                    m_Status = "Taking snapshot.....";
                    UnityEditor.MemoryProfiler.MemorySnapshot.RequestNewSnapshot();
                }

                if (GUILayout.Button("Load Snapshot", style))
                {
                    m_Status = "Loading snapshot.....";
                    PackedMemorySnapshot packedSnapshot = PackedMemorySnapshotUtility.LoadFromFile();
                    if (packedSnapshot != null)
                    {
                        IncomingSnapshot(packedSnapshot);
                    }
                }

                if (_snapshot != null)
                {
                    if (GUILayout.Button("Save Snapshot", style))
                    {
                        m_Status = "Saving snapshot.....";
                        PackedMemorySnapshotUtility.SaveToFile(_snapshot);
                    }
                }

                if (GUILayout.Button("Load CrawlerData", style))
                {
                    m_Status       = "Loading CrawlerData.....";
                    _packedCrawled = PackedMemorySnapshotUtility.LoadCrawlerDataFromFile();
                    if (null != _packedCrawled)
                    {
                        m_nodeView.ClearNodeView();
                        _snapshot                = _packedCrawled.packedMemorySnapshot;
                        _unpackedCrawl           = null;
                        _packedCrawlGenerating   = true;
                        _unpackedCrawlGenerating = false;
                    }
                }

                if (_packedCrawled != null)
                {
                    if (GUILayout.Button("Save CrawlerData", style))
                    {
                        m_Status = "Saving CrawlerData.....";
                        PackedMemorySnapshotUtility.SaveCrawlerDataToFile(_packedCrawled);
                    }
                }

                if (_unpackedCrawl != null)
                {
                    if (GUILayout.Button("Show Heap Usage", style))
                    {
                        bshowPlainData = false;
                        m_nodeView.ClearNodeView();
                        m_nodeView.CreateTreelessView(_unpackedCrawl);
                    }

                    if (GUILayout.Button("Show Plain Data", style))
                    {
                        bshowPlainData = true;
                    }
                }
            }
            GUILayout.EndArea();
        }
Esempio n. 15
0
 void IncomingSnapshot(PackedMemorySnapshot snapshot)
 {
     m_snapshot = snapshot;
 }
 void OnSnapshotReceived(PackedMemorySnapshot snapshot)
 {
     _snapshot = snapshot;
     addNewSnapshot();
     showSnapshotInfo();
 }