Skip to content

Commit

Permalink
Add a few line breaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
wddevries committed Mar 8, 2025
1 parent 499409a commit b005846
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions workloadrepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ SET GLOBAL tidb_workload_repository_dest = '';
## Data Collection

The Workload Repository stores data in tables under the `WORKLOAD_SCHEMA` database. It collects data via two different methods:

* The Snapshot process, which runs at configurable intervals, typically hourly, and can be triggered manually.
* The Time-based process, which runs at shorter intervals, typically every 5 seconds.

## Snapshot Sampling Process (Hourly by default)

The snapshot sampling process, which runs every 15 minutes to 2 hours, samples data from various monitoring tables. Snapshots are initiated from one of the TiDB nodes at the specified intervals, and process is as follows:

1. From the initiating node a row is inserted into HIST_SNAPSHOTS, capturing the snapshot’s ID, start and end timestamps, and server version details.

Check failure on line 35 in workloadrepo.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.ZhPunctuation] Don't use Chinese punctuation (’) in English text. Raw Output: {"message": "[PingCAP.ZhPunctuation] Don't use Chinese punctuation (’) in English text.", "location": {"path": "workloadrepo.md", "range": {"start": {"line": 35, "column": 91}}}, "severity": "ERROR"}
Expand All @@ -46,6 +48,7 @@ Data is sampled from the following tables:
| CLIENT_ERRORS_SUMMARY_GLOBAL | HIST_CLIENT_ERRORS_SUMMARY_GLOBAL | Client error summaries by global |

The snapshot sampling interval may be controlled with [`tidb_workload_repository_snapshot_interval`](/system-variables.md#tidb_workload_repository_snapshot_interval):

```sql
SET GLOBAL tidb_workload_repository_snapshot_interval = 900; -- set interval to 15 minutes
```
Expand All @@ -59,6 +62,7 @@ ADMIN WORKLOAD REPOSITORY TAKE SNAPSHOT;
```

## Time-based Sampling Process (Every 5 seconds by default)

The time-based sampling process, which runs every 1 to 600 seconds, samples data from various monitoring tables.

When the time-base sampling process runs all rows from the source tables are copied to the corresponding history tables with the 'HIST_' prefix. The copied data includes the original columns from the source tables plus additional columns for the timestamp and instance ID.
Expand All @@ -79,6 +83,7 @@ Data is sampled from the following tables:
| DEADLOCKS | HIST_DEADLOCKS | Deadlock information |

The time-based sampling interval may be controlled with [tidb_workload_repository_active_sampling_interval](/system-variables.md#tidb_workload_repository_active_sampling_interval):

```sql
SET GLOBAL tidb_workload_repository_active_sampling_interval = 20; -- set interval to 20 seconds
```
Expand Down

0 comments on commit b005846

Please sign in to comment.