• 使用curl测试网络通信


    Linux 工具命令
    使用curl测试网络通信

    #!/bin/bash
    cnt_pos=1
    while true
    do
       echo "--------------- the $cnt_pos requet ------------"
       echo "Start time: "`date +"%Y-%m-%d %H:%M:%S"`
       t0=`date +%s`
       req_url="https://www.baidu.com"
       echo "$req_url"
       
       curl -w "@./curl-cfg.txt" -X get -i --connect-timeout 200 -m 200  "$req_url"
       t1=`date +%s`
       let s_t2=t1-t0
       if [ $s_t2 -gt 3 ] 
       then
            break
       fi
       let cnt_pos=cnt_pos+1
       sleep 1s
    done
    

    curl-cfg.txt

    
    
             remote_ip: %{remote_ip}
    
           remote_port: %{remote_port}
    
              local_ip: %{local_ip}
    
            local_port: %{local_port}
    
             http_code: %{http_code}
    
                   dns: %{time_namelookup}s
    
              redirect: %{time_redirect}s
    
          time_connect: %{time_connect}s
    
       time_appconnect: %{time_appconnect}s
    
      time_pretransfer: %{time_pretransfer}s
    
    time_starttransfer: %{time_starttransfer}s
    
         size_download: %{size_download}bytes
    
        speed_download: %{speed_download}B/s
    
                      ----------
    
            time_total: %{time_total}s
    
    
    
    
  • 相关阅读:
    RoIPooling、RoIAlign笔记
    ROI Align 的基本原理和实现细节
    ROI Align详解
    GIT总结
    java-变量,函数 下
    linux设置静态ip地址
    技术参考网站-网址
    python
    python
    python
  • 原文地址:https://www.cnblogs.com/iFanLiwei/p/13597875.html
Copyright © 2020-2023  润新知