性能分析器Skill performance-profiler

性能分析器是一款专业的应用程序性能剖析工具,专注于CPU分析、内存分析、火焰图生成和瓶颈识别。它能够深入分析代码执行热点、内存使用情况,并生成直观的火焰图,帮助开发者快速定位性能瓶颈,优化应用程序运行效率。支持与主流APM工具(如DataDog、New Relic)集成,适用于Node.js事件循环分析和垃圾回收优化。关键词:性能分析、CPU分析、内存分析、火焰图、瓶颈识别、APM工具、Node.js优化、代码优化、性能监控、热点分析。

DevOps 0 次安装 0 次浏览 更新于 2/26/2026

name: performance-profiler description: 分析应用程序性能,包括CPU、内存和火焰图生成 allowed-tools:

  • Bash
  • Read
  • Write
  • Glob

性能分析器技能

概述

分析应用程序性能,包括CPU分析、内存分析、火焰图生成、瓶颈识别和APM工具集成。

能力

  • CPU分析
  • 内存分析和堆快照
  • 火焰图生成
  • 瓶颈识别
  • 热点路径分析
  • 与APM工具集成(DataDog、New Relic)
  • 事件循环分析(Node.js)
  • 垃圾回收分析

目标流程

  • 性能优化

输入模式

{
  "type": "object",
  "required": ["target"],
  "properties": {
    "target": {
      "type": "string",
      "description": "目标进程、脚本或端点"
    },
    "mode": {
      "type": "string",
      "enum": ["cpu", "memory", "heap", "all"],
      "default": "cpu"
    },
    "duration": {
      "type": "number",
      "default": 30,
      "description": "分析持续时间(秒)"
    },
    "options": {
      "type": "object",
      "properties": {
        "samplingInterval": {
          "type": "number",
          "default": 1000,
          "description": "采样间隔(微秒)"
        },
        "generateFlameGraph": {
          "type": "boolean",
          "default": true
        },
        "outputFormat": {
          "type": "string",
          "enum": ["json", "html", "svg"],
          "default": "html"
        }
      }
    }
  }
}

输出模式

{
  "type": "object",
  "properties": {
    "profile": {
      "type": "object",
      "properties": {
        "duration": { "type": "number" },
        "samples": { "type": "number" }
      }
    },
    "hotspots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "function": { "type": "string" },
          "selfTime": { "type": "number" },
          "totalTime": { "type": "number" },
          "percentage": { "type": "number" }
        }
      }
    },
    "flameGraphPath": {
      "type": "string"
    },
    "memoryStats": {
      "type": "object",
      "properties": {
        "heapUsed": { "type": "number" },
        "heapTotal": { "type": "number" },
        "external": { "type": "number" }
      }
    },
    "recommendations": {
      "type": "array",
      "items": { "type": "string" }
    }
  }
}

使用示例

{
  kind: 'skill',
  skill: {
    name: 'performance-profiler',
    context: {
      target: 'npm run start',
      mode: 'cpu',
      duration: 30,
      options: {
        generateFlameGraph: true,
        outputFormat: 'html'
      }
    }
  }
}