Add a progress bar to a table

Updated at:
Copy as MD

To track the progress of data import or export in a dashboard, use a progress bar in a table.

Prerequisites

Overview

In a dashboard chart, run the query statement * | select split_part(request_url,'?',1) as path, count(1) as pv group by split_part(request_url,'?',1) order by pv desc limit 10 to count page views (PVs) per request path. In the field configuration panel, configure the pv field: set Maximum Value to 500, select gradient progress bar for cell display mode, and select threshold for the color scheme. Then set multiple thresholds: green (default), red (greater than 300), yellow (greater than 400), and blue (greater than 450).

  1. Query and analysis: Query and analyze logs in the console.

  2. Add a chart: Add a chart to a dashboard. Each chart runs one or more query statements.

  3. Add a progress bar: Use a progress bar to visualize the number of data import requests.

Step 1: Query and analyze data

  1. Log on to the Simple Log Service console. In the Projects section, click the project you want.

    image

  2. On the Log Storage > Logstores tab, click the logstore you want.

    image

  3. Enter a query statement, and then click Last 15 Minutes to set the query time range.

    For example, to view the paths and number of imported files, use the following query statement:

    * | select split_part(request_uri,'?',1) as path, count(1) as count group by split_part(request_uri,'?',1) order by count desc limit 10

Step 2: Add a chart

  1. In the left-side navigation pane, choose Dashboard > Dashboards. In the Dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, choose Add > Add Chart.

    image

  2. In the General Configurations section, select the image icon for Chart Type. On the Query and Analysis tab, select your data source (in this case, LogStore (SQL)), select the target Logstore, and enter a query statement.

    In the upper-right corner, select a time range such as Last 15 Minutes and click Apply.

    Set Chart Type to Table. An example query: * | select *.

Step 3: Add a progress bar

Progress bar

  • Field/Column Settings > Maximum Value: Set the value for 100% progress.

  • Standard Configurations > Color Scheme > Threshold: Sets the progress bar color based on specified thresholds.

  • Field/Column Settings > Cell Display Mode > Progress Bar: Displays the count field as a progress bar.

  • Threshold > Threshold: Set the data threshold for the count field to 400. The progress bar is red for count values below 400 and green for count values of 400 or greater.

LCD progress bar

  • Field/Column Settings > Maximum Value: Set the value for 100% progress.

  • Standard Configurations > Color Scheme > Threshold: Sets the progress bar color based on specified thresholds.

  • Field/Column Settings > Cell Display Mode > LCD Progress Bar: Displays the count field as an LCD progress bar.

  • Threshold > Threshold: Set the data threshold for the count field to 400. The progress bar is red for count values below 400 and green for count values of 400 or greater.

Gradient progress bar

  • Field/Column Settings > Maximum Value: Set the value for 100% progress.

  • Standard Configurations > Color Scheme > Threshold: Sets the progress bar color based on specified thresholds.

  • Field/Column Settings > Cell Display Mode > Gradient Progress Bar: Displays the count field as a gradient progress bar.

  • Threshold > Threshold: Set multiple data thresholds for the count field. The progress bar turns red if the count value is greater than 300, yellow if the count value is greater than 400, and blue if the count value is greater than 450.