From 91133aa93e2d2eea2460d759742203aea8c51b2b Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Fri, 5 Jun 2020 12:18:53 +0800 Subject: [PATCH 1/4] Update Key Visualizer doc --- TOC.md | 1 - .../key-visualizer-monitoring-tool.md | 70 +++++++++++++------ 2 files changed, 47 insertions(+), 24 deletions(-) rename key-visualizer-monitoring-tool.md => dashboard/key-visualizer-monitoring-tool.md (76%) diff --git a/TOC.md b/TOC.md index 623e5248fcb2a..2528e964c57ba 100644 --- a/TOC.md +++ b/TOC.md @@ -76,7 +76,6 @@ + Monitor - [Overview](/tidb-monitoring-framework.md) - [Monitor a TiDB Cluster](/monitor-a-tidb-cluster.md) - - [Monitor Traffic Using Key Visualizer](/key-visualizer-monitoring-tool.md) + Migrate - [Migration Tools User Guide](/ecosystem-tool-user-guide.md) + Migrate from MySQL diff --git a/key-visualizer-monitoring-tool.md b/dashboard/key-visualizer-monitoring-tool.md similarity index 76% rename from key-visualizer-monitoring-tool.md rename to dashboard/key-visualizer-monitoring-tool.md index 107b1ca428bce..c973b0b973bc4 100644 --- a/key-visualizer-monitoring-tool.md +++ b/dashboard/key-visualizer-monitoring-tool.md @@ -1,34 +1,33 @@ --- -title: Key Visualizer -summary: Learn how to monitor traffic using the Key Visualizer tool. +title: Key Visualizer Page +summary: Learn how to monitor traffic using the Key Visualizer page. category: how-to +aliases: ['/docs-cn/dev/key-visualizer-monitoring-tool/'] --- -# Key Visualizer +# Key Visualizer Page -Key Visualizer is a feature for analyzing the usage of TiDB and troubleshooting the traffic hotspot. The feature generates a visual report of the metrics of the TiDB cluster over a period of time. With this visual report, you can quickly and intuitively observe the overall cluster hotspot and traffic distribution. +The Key Visualizer page of TiDB Dashboard is used to analyze the usage of TiDB and troubleshooting the traffic hotspot. This page visually shows the traffic of the TiDB cluster over a period of time. -## Access Key Visualizer +## Access Key Visualizer page -As one of the offerings of TiDB Dashboard, Key Visualizer is directly integrated into PD instances and does not require a separate deployment. You can access TiDB Dashboard on any PD instance via your browser by using the following address: +You can use one of the following two methods to access the Key Visualizer page: -{{< copyable "" >}} +* After logging into TiDB Dashboard, click **Key Visualizer** on the left navigation menu: -``` -http://PDAddress:PDPort/dashboard -``` +![Access Key Visualizer](/media/dashboard/dashboard-keyviz-access.png) + +* Visit in your browser. Replace `127.0.0.1:2379` with the actual PD instance address and port. > **Note:** > -> + If multiple PD instances exist, you can use any PD instance address to access TiDB Dashboard. -> + By default, `PDPort` is `2379`. If you have modified the corresponding PD parameter during deployment, use the modified PD port. -> + You need to use the `root` account of TiDB to log into TiDB Dashboard. +> The Key Visualizer feature is disabled by default. If you use this feature for the first time, You need to manually enable it. Follow the interface guide to enable this feature, or see the [Settings](#settings) section of this document. ## Interface demonstration -The following image is a demonstration of the Key Visualizer interface: +The following image is a demonstration of the Key Visualizer page: -![Key Visualizer Interface](/media/dashboard/keyvisualizer/overview.png) +![Key Visualizer page](/media/dashboard/dashboard-keyviz-overview.png) From the interface above, you can see the following objects: @@ -57,7 +56,7 @@ For more details about hotspot, refer to [Highly Concurrent Write Best Practices ### Heatmap -The heatmap is the core part of Key Visualizer, which shows the change of a metric over time. The X-axis of the heatmap indicates the time. The Y-axis of the heatmap indicates the consecutive Regions based on key ranges that cover all schemas and tables of the TiDB cluster. +The heatmap is the core part of Key Visualizer, which shows the change of a metric over time. The X-axis of the heatmap indicates the time. The Y-axis of the heatmap indicates the consecutive Regions based on key ranges that cover all schemas and tables of the TiDB cluster. Colder colors in the heatmap indicate lower read and write traffic of Regions in that period of time. Hotter (brighter) colors indicate higher traffic. @@ -69,7 +68,25 @@ A TiDB cluster might have up to hundreds of thousands of Regions. It is difficul This section introduces how to use Key Visualizer. -![Toolbar](/media/dashboard/keyvisualizer/toolbar.png) +### Settings + +To use the Key Visualizer page for the first time, you need to manually enable this feature on the **Settings** page. Follow the page guide and click **Open Settings** to open the settings page: + +![Feature disabled](/media/dashboard/dashboard-keyviz-not-enabled.png) + +After this feature is enabled, you can open the settings page by clicking the **Settings** icon at the upper right corner: + +![Settings icon](/media/dashboard/dashboard-keyviz-settings-button.png) + +The settings page is shown as follows: + +![Settings page](/media/dashboard/dashboard-keyviz-settings.png) + +Set whether to start the data collection through the switch, and click **Save** to take effect. After enabling the feature, you can see that the toolbar is available: + +![Toolbar](/media/dashboard/dashboard-keyviz-toolbar.png) + +After this feature is enabled, data collection is going on at the backend. You can see the heatmap shortly. ### Observe a certain period of time or Region range @@ -78,9 +95,14 @@ When you open Key Visualizer, the heatmap of the entire database over the recent 1. Scroll up or down in the heatmap. 2. Click and drag one of the following buttons to select the range. + Click the **Select & Zoom** button. Then click and drag this button to select the area to zoom in. + + ![Selection box](/media/dashboard/dashboard-keyviz-select-zoom.gif) + + Click the **Reset** button to reset the Region range to the entire database. + Click the **time selection box** (at the position of `6 hours` on the interface above) and select the observation time period again. + ![Select time](/media/dashboard/dashboard-keyviz-select-time.png) + > **Note:** > > If you follow step 2 in the instruction above, the heatmap is redrawn, which might be very different from the original heatmap. This difference is normal because if you observe in more detail, the granularity of the Region compression has changed, or the basis of `hot` in a specific range has changed. @@ -95,6 +117,8 @@ The heatmap uses colors of different brightnesses to indicate the Bucket traffic ### Select metrics +![Select metrics](/media/dashboard/dashboard-keyviz-select-type.png) + You can view a metric you are interested in by selecting this metric in the **metrics selection box** (at the `Write (bytes)` position in the interface above): * `Read (bytes)`: Read traffic. @@ -115,11 +139,11 @@ To regain a heatmap based on the current time, click the **Refresh** button. If You can hover your mouse over the Bucket you are interested in to view the detailed information of this Region range. The image below is an example of this information: -![Bucket details](/media/dashboard/keyvisualizer/tooltip.png) +![Bucket details](/media/dashboard/dashboard-keyviz-tooltip.png) If you want to copy this information, click a Bucket. Then, the page with relevant details is temporarily pinned. Click on the information, and you have copied it to the clipboard. -![Copy Bucket details](/media/dashboard/keyvisualizer/tooltip-copy.png) +![Copy Bucket details](/media/dashboard/dashboard-keyviz-tooltip-copy.png) ## Common heatmap types @@ -127,19 +151,19 @@ This section shows and interprets four common types of heatmap in Key Visualizer ### Evenly distributed workload -![Balanced ](/media/dashboard/keyvisualizer/well_dist.png) +![Balanced ](/media/dashboard/dashboard-keyviz-well-dist.png) In the heatmap above, bright and dark colors are a fine-grained mix. This indicates that reads or writes are evenly distributed over time and among key ranges. The workload is evenly distributed to all nodes, which is ideal for a distributed database. ### Periodically reads and writes -![Periodically](/media/dashboard/keyvisualizer/period.png) +![Periodically](/media/dashboard/dashboard-keyviz-period.png) In the heatmap above, there is an alternating brightness and darkness along the X-axis (time) but the brightness is relatively even along the Y-axis (Region). This indicates that the reads and writes change periodically, which might occur in scenarios of periodically scheduled tasks. For example, the big data platform periodically extracts data from TiDB every day. In this kind of scenarios, pay attention to whether the resources are sufficient during peak usage. ## Concentrated reads or writes -![Concentrated](/media/dashboard/keyvisualizer/continue.png) +![Concentrated](/media/dashboard/dashboard-keyviz-continue.png) In the heatmap above, you can see several bright lines. Along the Y-axis, the fringes around the bright lines are dark, which indicates that the Regions corresponding to bright lines have high read and write traffic. You can observe whether the traffic distribution is expected by your application. For example, when all services are associated with the user table, the overall traffic of the user table can be high, so it is reasonable to show bright lines in the heatmap. @@ -147,7 +171,7 @@ In addition, the height of the bright lines (the thickness along the Y-axis) is ### Sequential reads or writes -![Sequential](/media/dashboard/keyvisualizer/sequential.png) +![Sequential](/media/dashboard/dashboard-keyviz-sequential.png) In the heatmap above, you can see a bright line. This means that the data reads or writes are sequential. Typical scenarios of sequential data reads or writes are importing data or scanning tables and indexes. For example, you continuously write data to tables with auto-increment IDs. From 7a7a5786c48eafb9fbbe242e0a7640c2fbb31728 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Fri, 5 Jun 2020 12:22:52 +0800 Subject: [PATCH 2/4] Update dashboard/key-visualizer-monitoring-tool.md --- dashboard/key-visualizer-monitoring-tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/key-visualizer-monitoring-tool.md b/dashboard/key-visualizer-monitoring-tool.md index c973b0b973bc4..116286f91bd5a 100644 --- a/dashboard/key-visualizer-monitoring-tool.md +++ b/dashboard/key-visualizer-monitoring-tool.md @@ -2,7 +2,7 @@ title: Key Visualizer Page summary: Learn how to monitor traffic using the Key Visualizer page. category: how-to -aliases: ['/docs-cn/dev/key-visualizer-monitoring-tool/'] +aliases: ['/docs/dev/key-visualizer-monitoring-tool/'] --- # Key Visualizer Page From 79697817deaed6b2feebdc2c92608727ae6b27b3 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Mon, 8 Jun 2020 17:42:36 +0800 Subject: [PATCH 3/4] address comments from cc Co-authored-by: Caitin <34535727+CaitinChen@users.noreply.github.com> --- dashboard/key-visualizer-monitoring-tool.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dashboard/key-visualizer-monitoring-tool.md b/dashboard/key-visualizer-monitoring-tool.md index 116286f91bd5a..74ada7800d509 100644 --- a/dashboard/key-visualizer-monitoring-tool.md +++ b/dashboard/key-visualizer-monitoring-tool.md @@ -1,13 +1,13 @@ --- title: Key Visualizer Page -summary: Learn how to monitor traffic using the Key Visualizer page. +summary: Learn how to use Key Visualizer to monitor traffic. category: how-to aliases: ['/docs/dev/key-visualizer-monitoring-tool/'] --- # Key Visualizer Page -The Key Visualizer page of TiDB Dashboard is used to analyze the usage of TiDB and troubleshooting the traffic hotspot. This page visually shows the traffic of the TiDB cluster over a period of time. +The Key Visualizer page of TiDB Dashboard is used to analyze the usage of TiDB and troubleshoot traffic hotspots. This page visually shows the traffic of the TiDB cluster over a period of time. ## Access Key Visualizer page @@ -21,7 +21,7 @@ You can use one of the following two methods to access the Key Visualizer page: > **Note:** > -> The Key Visualizer feature is disabled by default. If you use this feature for the first time, You need to manually enable it. Follow the interface guide to enable this feature, or see the [Settings](#settings) section of this document. +> The Key Visualizer feature is disabled by default. If you use this feature for the first time, You need to manually enable it. To enable this feature, follow the interface guide or see the [Settings](#settings) section of this document. ## Interface demonstration @@ -74,7 +74,7 @@ To use the Key Visualizer page for the first time, you need to manually enable t ![Feature disabled](/media/dashboard/dashboard-keyviz-not-enabled.png) -After this feature is enabled, you can open the settings page by clicking the **Settings** icon at the upper right corner: +After this feature is enabled, you can open the settings page by clicking the **Settings** icon in the upper right corner: ![Settings icon](/media/dashboard/dashboard-keyviz-settings-button.png) @@ -82,7 +82,7 @@ The settings page is shown as follows: ![Settings page](/media/dashboard/dashboard-keyviz-settings.png) -Set whether to start the data collection through the switch, and click **Save** to take effect. After enabling the feature, you can see that the toolbar is available: +Set whether to start data collection through the switch, and click **Save** to take effect. After enabling the feature, you can see that the toolbar is available: ![Toolbar](/media/dashboard/dashboard-keyviz-toolbar.png) From 3a2190669c5a45d2384f5f3ad351a7d7cc1f4e18 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Tue, 9 Jun 2020 10:35:28 +0800 Subject: [PATCH 4/4] address comments from HunDunDM --- ...lizer-monitoring-tool.md => dashboard-key-visualizer.md} | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) rename dashboard/{key-visualizer-monitoring-tool.md => dashboard-key-visualizer.md} (97%) diff --git a/dashboard/key-visualizer-monitoring-tool.md b/dashboard/dashboard-key-visualizer.md similarity index 97% rename from dashboard/key-visualizer-monitoring-tool.md rename to dashboard/dashboard-key-visualizer.md index 74ada7800d509..8f683860ae205 100644 --- a/dashboard/key-visualizer-monitoring-tool.md +++ b/dashboard/dashboard-key-visualizer.md @@ -19,10 +19,6 @@ You can use one of the following two methods to access the Key Visualizer page: * Visit in your browser. Replace `127.0.0.1:2379` with the actual PD instance address and port. -> **Note:** -> -> The Key Visualizer feature is disabled by default. If you use this feature for the first time, You need to manually enable it. To enable this feature, follow the interface guide or see the [Settings](#settings) section of this document. - ## Interface demonstration The following image is a demonstration of the Key Visualizer page: @@ -151,7 +147,7 @@ This section shows and interprets four common types of heatmap in Key Visualizer ### Evenly distributed workload -![Balanced ](/media/dashboard/dashboard-keyviz-well-dist.png) +![Balanced](/media/dashboard/dashboard-keyviz-well-dist.png) In the heatmap above, bright and dark colors are a fine-grained mix. This indicates that reads or writes are evenly distributed over time and among key ranges. The workload is evenly distributed to all nodes, which is ideal for a distributed database.