Пример #1
0
        private void CreateControls()
        {
            _topMethods = new TopMethodsView
            {
                Margin = new Thickness(4),
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Header    = "Top Methods",
                Inclusive = false
            };

            _callTree = new CallTreeView
            {
                Margin = new Thickness(4),
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Header    = "Call Tree",
                Inclusive = true
            };

            _hotPathes = new HotPathView1
            {
                Margin = new Thickness(4),
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Header    = "Hot Paths",
                Inclusive = false
            };
        }
Пример #2
0
        public void SetTopMethodsData()
        {
            var row = 0;
            var topMethodsByMemory = _activeSession.SessionModel.GetTopMethodsByMemory();

            if (topMethodsByMemory.Methods.Count > 0)
            {
                ListsGrid.RowDefinitions.Add(new RowDefinition
                {
                    Height = new GridLength(1, GridUnitType.Star)
                });
                var x = new TopMethodsView()
                {
                    Margin = new Thickness(4),
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Stretch,
                    Header     = "Top Methods by Memory",
                    Inclusive  = false,
                    FilterType = StatisticsType.Memory
                };
                x.SetInputSource(topMethodsByMemory);
                ListsGrid.Children.Add(x);
                Grid.SetRow(x, row++);
                Grid.SetColumn(x, 0);
            }

            var topMethodsByTime = _activeSession.SessionModel.GetTopMethodsByTime();

            if (topMethodsByTime.Methods.Count > 0)
            {
                ListsGrid.RowDefinitions.Add(new RowDefinition
                {
                    Height = new GridLength(1, GridUnitType.Star)
                });
                var x = new TopMethodsView()
                {
                    Margin = new Thickness(4),
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Stretch,
                    Header     = "Top Methods by Time",
                    Inclusive  = false,
                    FilterType = StatisticsType.Time
                };
                x.SetInputSource(topMethodsByTime);
                ListsGrid.Children.Add(x);
                Grid.SetRow(x, row++);
                Grid.SetColumn(x, 0);
            }

            var topLinesBySamples = _activeSession.SessionModel.GetTopLinesBySamples();

            if (topLinesBySamples.Lines.Count > 0)
            {
                ListsGrid.RowDefinitions.Add(new RowDefinition
                {
                    Height = new GridLength(1, GridUnitType.Star)
                });
                var x = new TopLinesView()
                {
                    Margin = new Thickness(4),
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Stretch,
                    Header     = "Top Lines",
                    Inclusive  = true,
                    FilterType = StatisticsType.Sample,
                };
                x.SetItemsSource(topLinesBySamples);
                x.MouseDoubleClick += TopLines_MouseDoubleClick;
                ListsGrid.Children.Add(x);
                Grid.SetRow(x, row++);
                Grid.SetColumn(x, 0);
            }

            var topLinesByMemory = _activeSession.SessionModel.GetTopLinesByMemory();

            if (topLinesByMemory.Lines.Count > 0)
            {
                ListsGrid.RowDefinitions.Add(new RowDefinition
                {
                    Height = new GridLength(1, GridUnitType.Star)
                });
                var x = new TopLinesView()
                {
                    Margin = new Thickness(4),
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Stretch,
                    Header     = "Top Lines By Memory",
                    Inclusive  = true,
                    FilterType = StatisticsType.Sample
                };
                x.SetItemsSource(topLinesByMemory);
                x.MouseDoubleClick += TopLinesyMem_MouseDoubleClick;
                ListsGrid.Children.Add(x);
                Grid.SetRow(x, row);
                Grid.SetColumn(x, 0);
            }
        }