cpu-profile
Skill by ClickHouse
Profiles a ClickHouse query with the sampling query profiler and system.trace_log to find CPU hotspots. Built for users who want to know where a query spends its time or what bottlenecks it has.
Install cpu-profile
Built from the published package, never by AI.
git clone --depth 1 https://github.com/ClickHouse/ClickHouse /tmp/ClickHouse && mkdir -p ~/.claude/skills && cp -r /tmp/ClickHouse/.claude/skills/cpu-profile ~/.claude/skills/cpu-profileRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/ClickHouse/ClickHouse /tmp/ClickHouse && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/ClickHouse/.claude/skills/cpu-profile ~/.gemini/antigravity-cli/skills/cpu-profileAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The cpu-profile skill profiles a ClickHouse query using the built-in sampling query profiler and system.trace_log. It collects CPU stack traces at configurable intervals and analyzes them to find hotspots. The user can pass a query_id to analyze existing traces, or a SQL query to run with profiling enabled.
The skill runs three analyses: top functions by CPU samples, top full stack traces, and collapsed stacks for a flamegraph. The report adds a subsystem breakdown and drill-down options such as comparing CPU with real time. It is for ClickHouse users who need to find CPU hotspots or performance bottlenecks in a query.
Written from the project's SKILL.md and checked against it.
What it can do
- Top functions by CPU samplesLists the top 30 functions by CPU sample count and percentage for a query.
- Top stack tracesShows the top 15 full call paths from trace_log for a query.
- Collapsed stack exportSaves collapsed stacks to a file for flamegraph generation.
- Subsystem breakdownGroups hotspot functions into categories such as IO, Network and Compression.
- Recent slow queriesLists recent queries longer than 1 second from system.query_log.
- Drill-down optionsFilters by function, compares CPU and real time, or maps source file and line.
What you need
- clickhouse-client to run queries
- ClickHouse server or ClickHouse Cloud
- clickhouse-common-static-dbg package for symbol resolution
Try asking
- Profile this query: SELECT count() FROM lineitem WHERE l_shipdate > '1995-01-01'
- Analyze CPU hotspots for query_id a1b2c3d4-e5f6-7890-abcd-ef1234567890
- Show recent slow queries from query_log so I can pick one to profile
Good to know
- Requires allow_introspection_functions = 1 for symbol functions.
- Requires the clickhouse-common-static-dbg package for symbol resolution.
- Default sampling is 1 sample per second, so short queries need a smaller period.
- Flamegraph rendering needs flamegraph.pl, otherwise a speedscope link is suggested.
Security check
B- Allowed to use Bash without limitsIn
SKILL.md
Checked automatically: .claude/skills/cpu-profile/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: TaskBashReadGrepGlobAskUserQuestion
-
SKILL.md7 KB
Alternatives to cpu-profile
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
cpu-profile: common questions
What sampling rate does cpu-profile use?
The skill runs the query with a 100 microsecond sampling period, about 10,000 samples per second. The source suggests 1 millisecond for longer queries.
What is the difference between CPU and Real trace types?
trace_type 'CPU' counts CPU time, while trace_type 'Real' counts wall-clock time, which includes IO waits.
Does cpu-profile work on ClickHouse Cloud?
Yes. The source says to use clusterAllReplicas(default, system.trace_log) to collect traces from all nodes on ClickHouse Cloud.
How do I install cpu-profile?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is cpu-profile free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is cpu-profile safe to use?
It scores 86 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use bash without limits). Review the code before you install. How grades work.
What are alternatives to cpu-profile?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
