Table of Contents

Getting started with the Performance Analyzer

In this tutorial, you will learn how to get started with the Performance Analyzer solution based on an example solution with a simulated performance issue.

Expected duration: 25 minutes.

Note

The content and screenshots for this tutorial have been created using DataMiner version 10.5.4.

Tip

See also: Kata #62: Introduction to Performance Analyzer on DataMiner Dojo Video

Prerequisites

For this tutorial, you will need a DataMiner System that meets the following requirements:

Tip

If you use a DaaS system, these DataMiner-related prerequisites are automatically met.

In addition, the following prerequisites are optional but highly recommended:

  • Visual Studio with DIS extension, connected to your DataMiner System (see DIS installation and configuration).
  • Git (this may be included with Visual Studio, depending on the version).

Overview

Step 1: Set up the example solution

To start this tutorial, you will need to follow the steps below to set up an example solution based on a GitHub repository that was specifically created for the tutorial.

Note

If you do not have Visual Studio, you can skip the steps below and instead deploy the example solution directly from the Catalog, by deploying the following package to a DMA connected to dataminer.services: Tutorial - Introduction to Performance Analyzer.

  1. Clone the GitHub repository:

    1. Open a command prompt in the location where you want to clone the repository.

    2. Execute the command git clone https://github.com/SkylineCommunications/SLC-GQIDS-Kata-PerformanceAnalyzerKataExercise.git.

      Performance Analyzer getting started clone the repository

  2. Open the solution in Visual Studio:

    1. Open the SLC-GQIDS-Kata-PerformanceAnalyzerKataExercise solution folder.

    2. Open the solution PerformanceAnalyzerKataExercise.sln.

  3. Publish the GQIDS:

    1. Open PerformanceAnalyzerKataExercise.xml.

      Performance Analyzer getting started open GQIDS XML

    2. Click Publish.

      Performance Analyzer getting started publish the GQIDS

Step 2: Create a low-code app

In this step, you will create a low-code app to visualize the performance issue that can then be analyzed with the Performance Analyzer.

  1. Go to the root page of your DataMiner System, for example by clicking the Home button for your DMS on the dataminer.services page.

  2. Create a new low-code app.

  3. Optionally, give the app a name of your choice, e.g. Employee Overview.

  4. Create a query using the new GQIDS:

    1. In the Data pane on the right, go to Queries and click the "+" icon to create a query.

      + icon to create query

    2. Optionally, specify a custom name for the query, e.g. Employees Table.

    3. Select Get ad hoc data and then Employees Table.

      Performance Analyzer getting started select a query

  5. Drag the new query to the page.

    Performance Analyzer getting started add a query to page

  6. Select a table visualization for the component.

    Performance Analyzer getting started visualize the query as table

  7. Optionally, drag the edges of the table component to adjust its size, until it looks like this:

    Performance Analyzer getting started final edit

  8. Publish the low-code app using the button in the top-right corner.

    Performance Analyzer getting started publish the LCA

At this point, you will be notice that the table takes a while to load, without any obvious reason. Trying to figure out the cause of this issue can be a daunting task, so this is where the Performance Analyzer will prove very helpful.

Step 3: Implement the Performance Analyzer in the solution

Note

If you do not have Visual Studio , you can skip the steps below and instead deploy the exercise_1 branch of the example solution, where the Performance Analyzer has been implemented:

  1. Go to Tutorial - Introduction to Performance Analyzer.
  2. Go to the Versions tab and click the Deploy button for the 1.0.1-exercise1 branch.
  1. Open the solution in the same way as in step 1.

  2. Install the Skyline.DataMiner.Utils.PerformanceAnalyzer NuGet.

    Tip

    For more details about the Performance Analyzer NuGet, see Performance Analyzer library.

  3. Implement the Performance Analyzer NuGet in the solution:

    1. Add a collector field of type PerformanceCollector and initialize it in the constructor of the DatabaseController class.

      Performance Analyzer getting started collector setup

    2. Wrap the bodies of all methods with using statement with the PerformanceTracker instance, using the collector from the previous step.

      Performance Analyzer getting started collector setup

  4. Publish the GQIDS in the same way as in step 1.

Step 4: Deploy the Performance Analyzer app

  1. Go to the Performance Analyzer package in the DataMiner Catalog.

  2. Deploy the Catalog item to your DataMiner Agent by clicking the Deploy button.

Tip

See also: Performance Analyzer app.

Step 5: Analyze the collected data

As the Performance Analyzer has now been implemented in the solution, you will now be able to use the Performance Analyzer app to find out why loading your app takes so long.

  1. Refresh the page in the low-code app from step 2.

  2. From the root page of your DataMiner System, open the Performance Analyzer low-code app.

    Performance Analyzer getting started collector setup

  3. Analyze the performance of your low-code app: By taking a look at the Metrics table, you can see that the biggest chunk of time is spent on the DatabaseController.Process method.

    Performance Analyzer getting started initial investigation

  4. Double click the DatabaseCollector.Process row.

    You will see that the processing is happening sequentially. This means that the performance of your app could be improved by processing employees in parallel instead.

    Performance Analyzer getting started sequential processing

Step 6: Improve the implementation of the Process method

Note

If you do not have Visual Studio, you can skip the steps below and instead deploy the exercise_2 branch of the example solution, where this improvement has been implemented:

  1. Go to Tutorial - Introduction to Performance Analyzer.
  2. Go to the Versions tab and click the Deploy button for the 1.0.1-exercise2 branch.
  1. Open the solution in the same way as in step 1.

  2. Update the DatabaseController.Process method:

    private List<Employee> Process(List<Employee> employees)
    {
       using (var tracker = new PerformanceTracker(collector))
       {
          var processedEmployees = new ConcurrentBag<Employee>();
    
          Parallel.ForEach(employees, employee =>
          {
             using (var threadTracker = new PerformanceTracker(tracker, nameof(MockExecution), nameof(MockExecution.Process)))
             {
                threadTracker
                   .AddMetadata("Thread Id", Convert.ToString(Thread.CurrentThread.ManagedThreadId))
                   .AddMetadata("Employee Id", employee.Id)
                   .AddMetadata("Employee Name", employee.Name);
    
                var processedEmployee = MockExecution.Process(employee);
    
                processedEmployees.Add(processedEmployee);
             }
          });
    
          return processedEmployees.ToList();
       }
    }
    
  3. Publish the GQIDS in the same way as in step 1.

Step 7: Analyze the collected data again

Follow the same steps as in step 5 to analyze the collected data again.

You will notice that the table loads significantly faster now, and in the Performance Analyzer app you will see that the execution time of the DatabaseController.Process method has been reduced from ~9 s to ~500 ms.

Congratulations, you have successfully identified and resolved the issue with the performance of your low-code app!

Step 8: Exercise for DevOps Points (optional)

In this step, you can do an optional exercise to earn DevOps Points.

  1. Update the solution to the exercise_3 branch:

    • If you have Visual Studio, pull branch exercise_3, and then publish the GQIDS like before.
    • Otherwise, deploy branch version 1.0.1-exercise3 of the tutorial package.
  2. Identify the user for which the processing causes performance issues.

  3. Send a screenshot to devops@skyline.be or upload it on the Kata page on Dojo.

Note

The Performance Analyzer NuGet is open source. If you want to contribute, you can do so by creating a pull request on the Skyline.DataMiner.Utils.PerformanceAnalyzer repository.