ns-cpu-spike-analysis

Diagnoses Node.js CPU spikes using N|Solid CPU profiles, runtime code, and workspace diffs.

6|7|Updated Jun 4, 2026
One-click install
npx skills add https://github.com/nodesource/nsolid-plugin --skill ns-cpu-spike-analysis-nodesource
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ns-cpu-spike-analysis
Source: https://github.com/nodesource/nsolid-plugin/tree/main/skills/ns-cpu-spike-analysis
Command: npx skills add https://github.com/nodesource/nsolid-plugin --skill ns-cpu-spike-analysis-nodesource

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Node.js applications suffering from CPU spikes, slow endpoints, or event loop blocking are hard to diagnose without deep profiling. This Skill automates the full investigation: it locates the hottest agent, captures a 30-second CPU profile via N|Solid, extracts the responsible runtime code, compares it against your local workspace, and produces a structured root-cause report with fix recommendations. ## Core Features & Use Cases - Evidence-first analysis: Reuses supplied asset IDs, local .cpuprofile files, or telemetry alerts before capturing anything new, avoiding redundant profiling. - Automated profile capture and download: Identifies the hottest connected agent in the target app, captures a 30-second CPU profile, waits reliably, and saves the .cpuprofile to .nsolid/assets/ via bundled scripts. - Runtime code extraction and workspace delta: Pulls the hot function's source from the running process and diffs it against your local workspace to detect drift between deployed and local code. - Use Case: You receive an alert "CPU spike 121.1% in app payments-api". The Skill profiles the hottest agent in that app, identifies the hot function, shows the exact runtime code, diffs it against your repo, and delivers a report with root cause and optimization advice. ## Quick Start Ask the assistant to diagnose the CPU spike in your Node.js app using N|Solid, for example by saying "analyze the CPU spike in app payments-api and find the hot function".

Frequently Asked Questions about ns-cpu-spike-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose a CPU spike in a Node.js application?▼

Provide the app name or a telemetry alert, and the Skill identifies the hottest connected agent via N|Solid metrics, captures a 30-second CPU profile, summarizes it, and reports the hot function with root cause and fix recommendations.

How to analyze an existing .cpuprofile file without capturing a new one?▼

Supply the local .cpuprofile path or an N|Solid asset ID in your prompt. The Skill resolves it through the asset index and analyzes it via asset-summary instead of capturing a new profile, and it never loads the raw profile into context.

Does this work with Dockerized Node.js applications?▼

Yes. When runtime paths carry Docker prefixes like /app or /usr/src/app, the Skill retries runtime-code extraction with stripped path segments, and the workspace-delta helper maps runtime paths to local files using known container prefixes.

Why does asset-summary say my CPU profile is not ready?▼

The profile needs time to finish capturing and uploading. The Skill waits with the bundled wait.cjs script for 35 seconds after a 30-second capture, then retries asset-summary up to two more short waits before reporting the asset as unavailable.

What happens if the bottleneck is in a dependency or Node internals?▼

The Skill reports the dependency or internal cost as evidence, then walks the call path to the nearest user-owned caller. It never extracts dependency source and recommends changes to call patterns, batching, caching, or library choice instead.