When monitoring application performance, you can use the maximum categories feature of the flow chart to set limits on the data you track and analyze for website traffic. This includes metrics such as visit count, visit sources, and visit duration. By focusing on specific types of log data, you can reduce the load on dashboard queries and displays, which improves the performance and response speed.
Prerequisites
Log data is collected. For more information, see Collect text logs from servers.
Indexes are created. For more information, see Create indexes.
Step 1: Query and analyze data
Log on to the Simple Log Service console. In the Projects section, click the project you want.
In the left-side navigation pane, click Log Storage. In the Logstores list, click the logstore you want.
Enter the query and analysis statement, and set the time range for your query and analysis, such as Last 15 Minutes.
Example:
* | select __time__,count(0) as pv group by request_method,__time__
Step 2: Add a chart
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, click Add > Add Chart.
On the General Configurations tab, click
in the Chart Types section. On the Search & Analysis tab, select Logstore (SQL) and choose the logstore you want, and enter the query statement. Select a time range, such as Last 15 Minutes, and click OK > Save.
: Set Axis X Field to__time__
, and Axis Y Field topv
.
In the chart, the X axis __time__ is in Unix format. Enable Time Series Mode and set the Format to
YYYY-MM-DD hh:mm:ss
. For more information, see Time series mode.
Step 3: Set the maximum number of categories
Choose Data Configuration > Maximum Categories to set the maximum number of categories for the request_method
field, such as 20.