Profile HTTP requests with timing, memory, and query breakdowns. Use when debugging slow routes, analyzing queries, inspecting middleware, or optimizing.
A thorough utility toolkit for profiling HTTP request execution. Track runs, analyze performance, generate reports, compare results, and export data — all from the command line with local storage.
Commands
All commands accept optional <input> arguments. Without arguments, they display recent entries from their log.
Command
Description
INLINECODE1
Run a profiling task and log the result
INLINECODE2
Check an endpoint, middleware, or configuration |
| web-profiler-bundle convert <input> | Convert profiling data between formats |
| web-profiler-bundle analyze <input> | Analyze request timing, memory usage, or query breakdowns |
| web-profiler-bundle generate <input> | Generate profiling configs, reports, or templates |
| web-profiler-bundle preview <input> | Preview profiling output before committing |
| web-profiler-bundle batch <input> | Batch process multiple profiling operations |
| web-profiler-bundle compare <input> | Compare two profiling results side by side |
| web-profiler-bundle export <input> | Log an export operation |
| web-profiler-bundle config <input> | Log or update configuration entries |
| web-profiler-bundle status <input> | Log a status check result |
| web-profiler-bundle report <input> | Generate or log a report entry |
| web-profiler-bundle stats | Show summary statistics across all log files |
| web-profiler-bundle export json\|csv\|txt | Export all data in JSON, CSV, or plain text format |
| web-profiler-bundle search <term> | Search across all log entries for a keyword |
| web-profiler-bundle recent | Show the 20 most recent activity entries |
| web-profiler-bundle help | Show all available commands |
| web-profiler-bundle version | Print version (v2.0.0) |
Data Storage
All data is stored locally in ~/.local/share/web-profiler-bundle/. Each command maintains its own .log file with timestamped entries in YYYY-MM-DD HH:MM|value format. A unified history.log tracks all operations across commands.
Export formats supported:
- JSON — Array of objects with type, time, and value fields
CSV — Standard comma-separated with type,time,value header
TXT — Human-readable grouped by command type
Requirements
- Bash 4.0+ with set -euo pipefail (strict mode)
Standard Unix utilities: date, wc, du, grep, tail, sed, INLINECODE34
No external dependencies — runs on any POSIX-compliant system
When to Use
1. Debugging slow HTTP routes — Log profiling runs with timing data and review trends over time
Analyzing query performance — Record database query breakdowns and compare before/after optimization
Inspecting middleware execution — Track middleware timing and memory consumption per request
Generating performance reports — Export accumulated profiling data to JSON/CSV for dashboards or CI pipelines
Batch profiling multiple endpoints — Profile a set of routes in one session and review aggregated statistics
Examples
CODEBLOCK0
How It Works
Web Profiler Bundle stores all data locally in ~/.local/share/web-profiler-bundle/. Each command creates a dedicated log file (e.g., run.log, analyze.log, report.log). Every entry is timestamped and appended, providing a full audit trail of all profiling activity. The history.log file aggregates operations across all commands for unified tracking.
When called without arguments, each command displays its most recent 20 entries, making it easy to review past profiling work without manually inspecting log files.
Output
All output goes to stdout. Redirect to a file with:
CODEBLOCK1
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
web-profiler-bundle run POST /api/orders — 580ms, 24MB, 47 queries
分析查询分解
web-profiler-bundle analyze 检测到N+1: users.orders — 34 queries, 210ms total
比较优化前后
web-profiler-bundle compare 缓存预热: 120ms vs 冷启动: 890ms
检查中间件栈
web-profiler-bundle check 认证中间件 — 12ms开销
将所有性能分析数据导出为JSON
web-profiler-bundle export json
搜索与内存相关的条目
web-profiler-bundle search memory
查看汇总统计信息
web-profiler-bundle stats
工作原理
Web Profiler Bundle将所有数据本地存储在~/.local/share/web-profiler-bundle/目录下。每个命令创建专用的日志文件(例如run.log、analyze.log、report.log)。每条记录都带有时间戳并追加写入,提供完整的性能分析活动审计追踪。history.log文件汇总所有命令的操作,实现统一追踪。