Skip to main content

Clickzetta 系统技能工具集 - 包含性能分析、诊断等专业工具

Project description

Clickzetta Skills

Clickzetta 系统技能工具集 - 包含性能分析、诊断等专业工具的 Python 包。

包含的技能

1. Job Performance Analyzer (作业性能分析器)

自动诊断 Clickzetta Job 性能问题的工具,分析执行计划(plan.json)和运行概况(job_profile.json),识别瓶颈并给出参数优化建议。

命令: cz-analyze-job

支持场景:

  • 增量计算(REFRESH)
  • AP模式
  • GP模式
  • Compaction
  • 各类SQL场景

已实现规则:

  • Stage/Operator 级别优化 (7条规则)
  • 状态表优化 (6条规则)

2. SQL History Expert (SQL历史专家)

分析 SQL 执行历史,识别性能趋势和异常。

命令: cz-sql-history

3. Table Stats Expert (表统计专家)

分析表统计信息,提供优化建议。

命令: cz-table-stats

安装

使用 Makefile(推荐)

# 进入项目目录
cd cz_skills

# 安装
make install

# 开发模式安装(可编辑)
make install-dev

# 卸载
make uninstall

手动安装

# 构建
python3 -m build

# 安装
pip3 install dist/clickzetta_skills-*.whl

使用

Job Performance Analyzer

# 分析性能问题
cz-analyze-job plan.json job_profile.json ./output

# 查看帮助
cz-analyze-job

SQL History Expert

# 分析 SQL 历史
cz-sql-history <options>

Table Stats Expert

# 分析表统计
cz-table-stats <options>

列出所有技能

make list-skills

开发

添加新技能

  1. 在根目录下创建新的技能目录(使用连字符命名)
  2. 实现技能逻辑
  3. pyproject.toml[project.scripts] 中添加命令入口
  4. [tool.hatch.build.targets.wheel] 中添加包名和映射

示例结构:

cz_skills/
├── pyproject.toml
├── Makefile
├── README.md
├── job-performance-analyzer/      # 目录名用连字符
│   ├── __init__.py
│   ├── __main__.py               # 包含 main() 函数
│   └── ...
├── sql-history-expert/
│   ├── __init__.py
│   ├── __main__.py
│   └── ...
└── your-new-skill/               # 新技能
    ├── __init__.py
    ├── __main__.py
    └── ...

pyproject.toml 中添加:

[project.scripts]
cz-your-skill = "your_skill.__main__:main"

# Map the directory name (with hyphens) to the package name (with underscores)
[tool.hatch.build.targets.wheel.force-include]
"job-performance-analyzer" = "job_performance_analyzer"
"sql-history-expert" = "sql_history_expert"
"table-stats-expert" = "table_stats_expert"
"your-new-skill" = "your_skill"

重要:

  • 目录名使用连字符 (your-new-skill/)
  • Python 包名使用下划线 (your_skill)
  • 通过 force-include 映射目录名到包名

运行测试

make test

构建发布

# 构建
make build

# 上传到 PyPI(需要配置 twine)
make upload

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clickzetta_skills-1.0.4.tar.gz (58.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clickzetta_skills-1.0.4-py3-none-any.whl (83.2 kB view details)

Uploaded Python 3

File details

Details for the file clickzetta_skills-1.0.4.tar.gz.

File metadata

  • Download URL: clickzetta_skills-1.0.4.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for clickzetta_skills-1.0.4.tar.gz
Algorithm Hash digest
SHA256 0e798ac75933dab0f0ade713f463cac13ecf6ad17531fee1d00018e3a8fec698
MD5 73b0844b2dcab8d59d9678bae01200b8
BLAKE2b-256 a486a516471d6eec86d94102605f5455a3575dada9b3319347689dff7b2314cc

See more details on using hashes here.

File details

Details for the file clickzetta_skills-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for clickzetta_skills-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8fa428b5e79c64a2da140d878b453e31cfbd8885c1f9d28336203742c2ed7bcf
MD5 951352e45dfb85d6046c466fad528580
BLAKE2b-256 235e5a366db99f11c8e3d31222a58cfead8f1fb0b9b090f2453ece278bf4c0bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page