zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    URL解析模式(伪静态)
    PHP各环境下的伪静态配置
    亚马逊-购书(电子)
    前端路由-JS实现
    SpringBoot 2.3.0.RELEASE版本后自定义404页面,SpringBoot 404错误兼容Ajax请求
    不设置DIV宽度水平居中,div不设置宽度居中
    js 保留两位小数,Js四舍五入,JavaScript Math四舍五入
    Laravel 自定义公共函数的引入
    EF Core3.1 CodeFirst动态自动添加表和字段的描述信息
    Android 高德地图API INVALID_USER_SCODE 错误
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/12591016.html
Copyright © 2011-2022 走看看