• Curl命令查看请求响应时间


    1、vim curl

     
           time_namelookup: %{time_namelookup} time_connect: %{time_connect} time_appconnect: %{time_appconnect} time_pretransfer: %{time_pretransfer} time_redirect: %{time_redirect} time_starttransfer: %{time_starttransfer} ---------- time_total: %{time_total}
    time_namelookup:DNS解析域名时间,把域名--->ipd的时间
    time_connect:TCP连接的时间,三次握手的时间
    time_appconnect:SSL|SSH等上层连接建立的时间
    time_pretransfer:从请求开始到到响应开始传输的时间
    time_redirect:从开始到最后一个请求事务的时间
    time_starttransfer:从请求开始到第一个字节将要传输的时间
    time_total:总时间

    2、eg

      curl -w "@curl" -o /dev/null -s -d "username=aaa&password=bbb" https://xxx.xxx.com/webapp/xxx/login

     -w:从文件中读取信息打印格式

     -o:输出的全部信息

     -s:不打印进度条

     -d:参数

    3、简单的方式

    curl -o /dev/null -s -w '%{time_connect}:%{time_starttransfer}:%{time_total} ' 'http://www.baidu.com'

    忽略ssl认证  并输出结果

    curl -k -XPOST -w ' %{time_connect}:%{time_starttransfer}:%{time_total} ' www.baidu.com

    4、当Content-Type:application/json,requestBody:{id: 93, status: 2}

     curl -w "@curl" -H "Content-Type:application/json" -X PUT --data '{id: 93, status: 2}' http:/xxxxxxxxxxx/changeStatus

  • 相关阅读:
    计算机开机启动原理
    行业术语缩写参照表
    Ghost 克隆工具使用教程
    Windows 系统常用快捷键
    MindMaster使用技巧
    工作打印机型号驱动汇总
    Android手机免ROOT卸载系统内置应用
    RTX腾讯通聊天消息备份
    Work TEL
    成功实施ITSM SLA的5个步骤
  • 原文地址:https://www.cnblogs.com/kaishi/p/7942937.html
Copyright © 2020-2023  润新知