clinic 简单使用
主要是学习clinic的使用,使用的官方demo
环境准备
- 安装
npm install -g clinic
- 命令
clinic --help
Clinic - v5.0.0
Getting started
As a first step, run the clinic doctor:
clinic doctor -- node server.js
Then benchmark your server with wrk or autocannon:
wrk http://localhost:3000
autocannon http://localhost:3000
Finally shut down your server (Ctrl+C). Once the server process has shutdown
clinic doctor will analyse the collected data and detect what type of issue
you are having. Based on the issue type, it will provide a recommendation for
you.
For example, to debug I/O issues, use clinic bubbleprof:
clinic bubbleprof -- node server.js
Then benchmark your server again, just like you did with clinic doctor.
Report an issue
If you encounter any issue, feel free to send us an issue report at:
https://github.com/nearform/node-clinic/issues
When creating an issue, it will be a huge help for us if you upload your
data to the Clinic.js cloud. To do this, use clinic upload:
clinic upload 1000.clinic-doctor
Utilities
When using Clinic.js a bunch you have fill up your directory with data folders and files.
You can clean these easily using clinic clean.
More information
For information on the Clinic.js sub-commands, use the --help option:
clinic doctor --help
clinic bubbleprof --help
clinic upload --help
clinic clean --help
clinic flame --help
Flags
-h | --help Display Help
-v | --version Display Version
demo 使用
- clone 代码
git clone https://github.com/nearform/node-clinic-doctor-examples.git
- 运行
cd node-clinic-doctor-examples
yarn
clinic doctor --autocannon [ / ] -- node ./slow-io
- 性能报表
从图上可以看出,有io问题,同时也包含了一些推荐的一些分析方法
分析方法
- 火焰图
clinic flame -- node ./slow-io
试压效果
ab -n 2000 -c 20 http://localhost:3000/
说明
clinic功能上还真是比较强大,支持的分析模式也比较多,是一款很不错的nodejs应用内性能分析工具
参考资料
https://clinicjs.org/documentation/
https://github.com/nearform/node-clinic
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2019-03-29 windows openssh server 安装试用