Viewing test results data in Grafana

After you install and configure HCL OneTest Server Results Data plugin in Grafana, you can retrieve the test log data that is generated in HCL OneTest Server and view the test results data in Grafana. You can use queries to display graphs, statistics, or tables. You can also view the details in a Grafana dashboard.

Before you begin

You must have completed the following tasks:
  • Ran tests to get test logs results in HCL OneTest Server. For more information about the procedure, refer to Test logs.
  • Installed the HCL OneTest Server Results Data plug-in and created an instance of data source for HCL OneTest Server Results Data. See Installing and configuring HCL OneTest Server Results Data.
  • Opened Grafana with one of these ports: http://localhost:3000 or http://localhost:8080.

Procedure

  1. Click Explore in the Toggle menu in Grafana.

    The Data query page with the default data source is displayed.

  2. Select HCL OneTest Server Results Data from the list of data sources.
  3. Select the type of query by performing any of the following actions when you want to view statistics, events, or activities from the test data:
    To view Actions
    The variation of a metric over time. Perform the following steps:
    1. Click the time-series statistics tab icon Image of the time-series statistics icon..
    2. Go to Step 4.
    The values of the metric computed over the entire time range. Perform the following steps:
    1. Click the overall statistics tab icon Image of the overall statistics icon..
    2. Go to Step 4.
    The events recorded in the test log. Perform the following steps:
    1. Click the Events tab.
    2. Go to Step 4.
    The activities recorded for all events in the test log. Perform the following steps:
    1. Click the Activities tab.
    2. Go to Step 4.
  4. Define the scope for the query by performing the actions indicated in the following table:
    Options Actions
    If you want to use the data from the team space
    Note: You can select the team space as the scope for your query only if you want to view the time-series statistics or overall statistics.
    Perform the following steps:
    1. Select the Team Space option.
    2. Select the team space from the list of team spaces that are listed.
    3. Select either Service, if you want to use Resource Monitoring data or Stubs, if you want to use the virtual service data in the query.
    4. Go to Step 5.
    If you want to use the data from your project
    Note: You can select the project as the scope for your query if you want to view any of the supported query types.
    Perform the following steps:
    1. Select the Project option.
    2. Select the project from the list of projects that are listed.
    3. Select the Result option.
    4. Select the result from the list of results that are displayed. Alternatively, you can also enter text for the name or ID of the result in the Search field, and then select the result from the listed items.
    5. Go to Step 5, if you selected the query type as time-series statistics or overall statistics, or go to Step 6, if you selected the query type as Events or Activities.
  5. Perform the following steps to select metrics for your query:
    1. Select a metric from the list of metrics in the row of the Metrics option.
    2. Assign a name for the metric that helps you identify it, by entering text in the Metric field.
    3. Select the aggregation factor for the metric. For example, select Sum to add all values of the metric.
    4. Optionally, click the icon to add a separator.

      With separators, you can view details of a specific project or test result in comparison with the values of the metric across projects or results in the team space or project.

    5. Optionally, click the Cumulated toggle-button if the values for the metric must be added cumulatively over time. The default option is set to be non-cumulative.
    6. Add another metric by clicking the Add metric icon Imge of the add metic icon..
      Note: If you added multiple metrics and you want to remove a metric, you can click the Remove metric icon Imge of the remove metic icon. of the metric.
    7. Go to Step 7.
  6. Perform the following steps for the Events or Activities query type:
    1. Enter the Query Filters.
    2. Enter the Timing value and Value.
      The timing values are sorted in ascending order. The value must be numeric so that it can be used in a graph.
      Tip: To find all the information needed on the Explore page of HCL OneTest Server Results Data, perform any of the following actions:
      • Select a result on the Queries page in HCL OneTest Server and copy the result number, query filters for the events or the activities, query filters, and timing values. You can find the project number in the URL of the Queries page.
      • Click Copy curl command on the Queries page in HCL OneTest Server and paste the curl command in a text editor. You can find all the information you need in the following command. The curl command contains a query filter for the event
  7. Click Add query if you want to combine queries from different projects, results ids, or with different properties in the query filters.
  8. Click Run query.

Results

You configured a query to get the test log data from HCL OneTest Server, and you can view and analyze the log data displayed for your query.

What to do next

You can build a dashboard including graphs, charts, gauges, tables to get customized visual representations of your test result data and select options to display the test result values. See Dashboard overview for more details about dashboards in Grafana.