hurl, 轻量的高性能 C++ HTTP库和实用工具

分享于 

7分钟阅读

GitHub

  繁體 雙語
Lightweight, performant C++ HTTP library and utilities.
  • 源代码名称:hurl
  • 源代码网址:http://www.github.com/VerizonDigital/hurl
  • hurl源代码文档
  • hurl源代码下载
  • Git URL:
    git://www.github.com/VerizonDigital/hurl.git
    Git Clone代码到本地:
    git clone http://www.github.com/VerizonDigital/hurl
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/VerizonDigital/hurl
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    抛出:C+ + 中的HTTP服务器负载测试

    他们是什么

    一些用于测试和从http服务器卷卷的实用工具。

    hurl HTTP服务器负载测试器

    是一个与支持 tls。http2.多线程。并行性和url范围的http服务器负载测试器类似的http服务器加载测试器。 hurl主要用于测试http服务器应用程序。

    • 对url范围 一点: 在url扩展中支持范围扩展,这对于测试服务器在许多文件中的服务能力很有用。 在 wildcards hurl将扩展通配符中指定的范围,并在用户可以配置命令( ( 查看"--mode"帮助中的选项) ) 中执行。 " http://127.0.0.1 :8089/[1-100]/my_[1-9]_file.html":。
    一个例子
    
    
    
    
    hurl "http://127.0.0.1/index.html" --num_calls=100 -p100 -f100000 -c
    
    
    
    
    命令行选项
    
    
    
    
    Usage: hurl [http[s]://]hostname[:port]/path [options]
    
    
    Options are:
    
    
     -h, --help Display this help and exit.
    
    
     -V, --version Display the version number and exit.
    
    
    
    Run Options:
    
    
     -w, --no_wildcards Don't wildcard the url.
    
    
     -M, --mode Request mode -if multipath [random(default) | sequential].
    
    
     -d, --data HTTP body data -supports curl style @ file specifier
    
    
     -p, --parallel Num parallel. Default: 100.
    
    
     -f, --fetches Num fetches.
    
    
     -N, --calls Number of requests per connection (or stream if H2)
    
    
     -t, --threads Number of parallel threads. Default: 1
    
    
     -H, --header Request headers -can add multiple ie -H<> -H<>...
    
    
     -X, --verb Request command -HTTP verb to use -GET/PUT/etc. Default GET
    
    
     -l, --seconds Run for <N> seconds. 
    
    
     -A, --rate Max Request Rate -per sec.
    
    
     -T, --timeout Timeout (seconds).
    
    
     -x, --no_stats Don't collect stats -faster.
    
    
     -I, --addr_seq Sequence over local address range.
    
    
    
    Display Options:
    
    
     -v, --verbose Verbose logging
    
    
     -c, --no_color Turn off colors
    
    
     -C, --responses Display http(s) response codes instead of request statistics
    
    
     -L, --responses_per Display http(s) response codes per interval instead of request statistics
    
    
     -U, --update Update output every N ms. Default 500ms.
    
    
    
    Results Options:
    
    
     -j, --json Display results in json
    
    
     -o, --output Output results to file <FILE> -default to stdout
    
    
    
    Debug Options:
    
    
     -r, --trace Turn on tracing (error/warn/debug/verbose/all)
    
    
    
    Note: If running long jobs consider enabling tcp_tw_reuse -eg:
    
    
    echo 1 >/proc/sys/net/ipv4/tcp_tw_reuse
    
    
    
    

    phurl

    phurl 是一个并行curl实用程序,用于从许多不同主机提取单个 url。 phurl 支持从 stdin。shell 命令字符串或者文件读取行分隔的主机。

    一个例子
    
    
    
    
    printf "www.google.comnwww.yahoo.comnwww.reddit.comn" | phurl -p2 -t3 -u"https://bloop.com/" -s -c -T5
    
    
    
    
    命令行选项
    
    
    
    
    Usage: phurl -u [http[s]://]hostname[:port]/path [options]
    
    
    Options are:
    
    
     -h, --help Display this help and exit.
    
    
     -V, --version Display the version number and exit.
    
    
    
    URL Options -or without parameter
    
    
     -u, --url URL -REQUIRED (unless running cli: see --cli option).
    
    
     -d, --data HTTP body data -supports curl style @ file specifier
    
    
    
    Hostname Input Options -also STDIN:
    
    
     -f, --host_file Host name file.
    
    
     -J, --host_json Host listing json format.
    
    
     -x, --execute Script to execute to get host names.
    
    
    
    Settings:
    
    
     -p, --parallel Num parallel.
    
    
     -t, --threads Number of parallel threads.
    
    
     -H, --header Request headers -can add multiple ie -H<> -H<>...
    
    
     -X, --verb Request command -HTTP verb to use -GET/PUT/etc
    
    
     -T, --timeout Timeout (seconds).
    
    
     -n, --no_async_dns Use getaddrinfo to resolve.
    
    
     -k, --no_cache Don't use addr info cache.
    
    
     -A, --ai_cache Path to Address Info Cache (DNS lookup cache).
    
    
     -C, --connect_only Only connect -do not send request.
    
    
     -Q, --complete_time Cancel requests after N seconds.
    
    
     -W, --complete_ratio Cancel requests after % complete (0.0-->100.0).
    
    
     
    
    
    TLS Settings:
    
    
     -y, --cipher Cipher --see"openssl ciphers" for list.
    
    
     -O, --tls_options SSL Options string.
    
    
     -K, --tls_verify Verify server certificate.
    
    
     -N, --tls_sni Use SSL SNI.
    
    
     -B, --tls_self_ok Allow self-signed certificates.
    
    
     -M, --tls_no_host Skip host name checking.
    
    
     -F, --tls_ca_file SSL CA File.
    
    
     -L, --tls_ca_path SSL CA Path.
    
    
     
    
    
    Print Options:
    
    
     -v, --verbose Verbose logging
    
    
     -c, --no_color Turn off colors
    
    
     -m, --show_summary Show summary output
    
    
     
    
    
    Output Options: -defaults to line delimited
    
    
     -o, --output File to write output to. Defaults to stdout
    
    
     -l, --line_delimited Output <HOST> <RESPONSE BODY> per line
    
    
     -j, --json JSON { <HOST>:"body": <RESPONSE>.. .
    
    
     -P, --pretty Pretty output
    
    
     
    
    
     
    
    
    Note: If running large jobs consider enabling tcp_tw_reuse -eg:
    
    
    echo 1>/proc/sys/net/ipv4/tcp_tw_reuse
    
    
    
    

    建筑

    命令行操作系统要求:

    linux/OS X ( kqueue支持即将推出)

    插件安装依赖项:

    库要求:

    • libssl/libcrypto ( OpenSSL )

    OS X 构建需求( brew )

    
    
    
    
    brew install cmake
    
    
    brew install openssl
    
    
    
    

    构建工具

    
    
    
    
    ./build_simple.sh
    
    
    
    

    并可以选择安装

    
    
    
    
    cd./build
    
    
    sudo make install
    
    
    
    

    HTTP  Light  UTIL  PERF  UTI  Utilities  
    相关文章