Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard add slow query analyst #2048

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The cluster diagnostics feature in Dashboard Enterprise Edition is to locate and

1. In the top navigation bar of the Dashboard Enterprise Edition page, click **Cluster Management**.
2. On the right side of the target cluster, click **Detail**.
3. In the left navigation bar, click **Information**->**Cluster Diagnostics**.
3. In the left navigation bar, click **Analysis**->**Cluster Diagnostics**.

## Create diagnostic reports

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Slow query analyst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analysis?


In the daily work of DBAs, they need to analyze and govern the execution of query statements of the cluster. NebulaGraph Dashboard supports viewing the slow queries, including statements, duration, categories, execution plans, etc.
whitewum marked this conversation as resolved.
Show resolved Hide resolved

## Features

- Display the information about current slow queries. Users can filter slow queries by keywords and graph space.
- Display the history of slow queries. Users can filter the records according to keywords, graph space, category, and time range.

## Prerequisites

`enable_record_slow_query`=`true` is set in the graph service configuration of NebulaGraph. For details, see [Graph service configuration](../../../5.configurations-and-logs/1.configurations/3.graph-config.md).

## Entry

1. In the top navigation bar of the Dashboard Enterprise Edition page, click **Cluster Management**.
2. On the right side of the target cluster, click **Detail**.
3. In the left navigation bar, click **Analysis**->**Slow Query Analyst**.

## View current slow queries

Clicking the **Running** tab will display the current slow queries. The parameters are described as follows.

|Parameter|Description|
|:--|:--|
|Query|The statement of the slow query.|
|Duration(μs)|The duration that the slow query has been executed.|
|Start Time|The time that the slow query starts executing.|
|Status|The status of the slow query, including `running` and `killing`.|
|User|The user name to execute the query. |
|Host|The address and port of the server that the user connected to.|
|Action| Supports killing the slow query.|

## View slow query history

Clicking the **History** tab will display the slow query history. The parameters are described as follows.

|Parameter|Description|
|:--|:--|
|nGQL|The statement of the slow query.|
|Duration(μs)|The duration of the slow query.|
|Category|The type of the slow query statement, including `DDL`, `DQL`, `DML`, `DCL`, `UTIL` and `UNKNOWN`.|
|Space|The name of the graph space where the slow query was executed.|
|Record Time|The time to record the statement into memory as a slow query.|
|Action|Supports viewing the execution plan, making it easy for the DBA to optimize slow query statements based on the execution plan.|

!!! note

Turning off the slow query analyst function **will not** clear the slow query history.
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,11 @@ nav:
- Cluster overview: nebula-dashboard-ent/4.cluster-operator/1.overview.md
- Cluster monitoring: nebula-dashboard-ent/4.cluster-operator/2.monitor.md
- Notification: nebula-dashboard-ent/4.cluster-operator/9.notification.md
- Analysis:
- Slow query analyst: nebula-dashboard-ent/4.cluster-operator/analysis-diagnosis/slow-query-analyst.md
- Cluster diagnostics: nebula-dashboard-ent/4.cluster-operator/analysis-diagnosis/cluster-diagnosis.md
- Information:
- Information overview: nebula-dashboard-ent/4.cluster-operator/cluster-information/overview-info.md
- Cluster diagnostics: nebula-dashboard-ent/4.cluster-operator/cluster-information/cluster-diagnosis.md
- Job management: nebula-dashboard-ent/4.cluster-operator/cluster-information/job-management.md
- Audit log: nebula-dashboard-ent/4.cluster-operator/cluster-information/audit-log.md
- Runtime log: nebula-dashboard-ent/4.cluster-operator/cluster-information/runtime-log.md
Expand Down