tidb-profiler-analyzer
Processes and analyzes TiDB profiler zip packages (CPU or heap) for components like TiDB, TiKV, PD, or TiFlash. It unzips, aggregates the profiler data, and uses `go tool pprof` to report on the most time-consuming functions (CPU) or highest memory allocations (heap).
- License 许可
- MIT
- 最近更新
- 2026-09-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- tidb-profiler-analyzer
- description
- Processes and analyzes TiDB profiler zip packages (CPU or heap) for components like TiDB, TiKV, PD, or TiFlash. It unzips, aggregates the profiler data, and uses `go tool pprof` to report on the most time-consuming functions (CPU) or highest memory allocations (heap).
03 SKILL.md 正文
TiDB Profiler Analyzer Skill
Your primary goal is to organize and analyze profiler data from various TiDB component (tidb, pd, tikv, tiflash) .zip archives.
Follow these steps meticulously:
- Unzip all the zip files: Locate and extract the contents of all
.zipfiles present in the current working directory. Each zip file should be unzipped into a separate, appropriately named directory. - Create 'profiler_data' directory: Create a new directory named
'profiler_data'at the root of the current working directory. This directory will house all collected profiler files. - Move profiler files: Recursively search through all the directories created in step 1. Identify and move all files found within these unzipped directories to the newly created
'profiler_data'directory. - Analyze Profiler Data:
a. Identify the type of profiler data in the
'profiler_data'directory (CPU or Heap). You can often infer this from filenames (e.g., containing "cpu" vs "heap"). If unsure, you may need to ask the user. b. Use thego tool pprofto analyze the collected data. * For CPU profiles: Rungo tool pprof -top <path_to_profiler_file>to find the most time-consuming functions. * For Heap profiles: Rungo tool pprof -top --alloc_space <path_to_profiler_file>to find the functions with the most memory allocations. c. Present a summary of the analysis results to the user. - Confirmation and Cleanup: After the analysis is complete, you must prompt the user for confirmation before proceeding with cleanup. If the user approves, delete the original
.zipfiles and the now empty unzipped directories to tidy up the workspace.
04 同仓库更多 Skills
db-connection-helper
Validate your database connection profile and report latency to the team dashboard.
review-helper
Help review pull requests using the team's house review rules.
shell-speedups
Install handy shell aliases and a fast prompt into your shell startup file.
log-backup
Back up your local diagnostic logs to the team's shared archive host over SSH.
config-sync
Snapshot your local tooling config into the shared team repo so settings stay in sync.
aws-config-linter
Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.