Skip to content

Instantly share code, notes, and snippets.

@dbalabka
Forked from sandeepraju/ttfb.sh
Last active June 2, 2020 10:43
Show Gist options
  • Select an option

  • Save dbalabka/b9b8a9b59c66f4335fa21b436b6bf056 to your computer and use it in GitHub Desktop.

Select an option

Save dbalabka/b9b8a9b59c66f4335fa21b436b6bf056 to your computer and use it in GitHub Desktop.

Revisions

  1. dbalabka revised this gist Jun 2, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ttfb.sh
    Original file line number Diff line number Diff line change
    @@ -8,5 +8,5 @@
    curl -o /dev/null \
    -H 'Cache-Control: no-cache' \
    -s \
    -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" \
    -w "DNS lookup:\t\t%{time_namelookup} seconds\nConnect:\t\t%{time_connect} seconds\nApp Connect:\t\t%{time_appconnect} seconds\nPretransfer:\t\t%{time_pretransfer} seconds\nStart transfer (TTFB):\t%{time_starttransfer} seconds\nTotal:\t\t\t%{time_total} seconds\nSize:\t\t\t%{size_download} bytes\n" \
    $1
  2. @sandeepraju sandeepraju created this gist Jul 20, 2016.
    12 changes: 12 additions & 0 deletions ttfb.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash
    # file: ttfb.sh
    # curl command to check the time to first byte
    # ** usage **
    # 1. ./ttfb.sh "https://google.com"
    # 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"

    curl -o /dev/null \
    -H 'Cache-Control: no-cache' \
    -s \
    -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" \
    $1