Code Monkey home page Code Monkey logo

url-timings's Introduction

url-timings

url-timings records the average request times for a set of urls, broken down to dns lookup time, tcp connection time, ssl handshake time, processing time and transfer time. Upload and download sizes for all requests are also recorded.

Requirements

Python and pip.

Installation

git clone [email protected]:kajic/url-timings.git
cd url-timings
pip install -r requirements.txt

Usage

 python timings.py -u example-urls.txt

Usage details

Given example-urls.txt with the following urls:

https://google.com
https://twitter.com
https://tumblr.com
https://facebook.com
https://wordpress.com

Running python timings.py --urls example-urls.txt -c 20 --parallel will produce the average times based on 20 requests for each url:

$ python timings.py -u example-urls.txt
.....
+-----------------------+---------+---------+-------+-----------+-----------+--------+---------+---------+
| url                   |   sizeu |   sized |   dns |   tcp_con |   ssl_con |   calc |   trans |   total |
+=======================+=========+=========+=======+===========+===========+========+=========+=========+
| https://google.com    |     141 |     572 | 0.027 |     0.038 |     0.118 |  0.076 |   0     |   0.259 |
+-----------------------+---------+---------+-------+-----------+-----------+--------+---------+---------+
| https://twitter.com   |     142 |   50704 | 0.049 |     0.137 |     0.302 |  0.216 |   0.404 |   1.108 |
+-----------------------+---------+---------+-------+-----------+-----------+--------+---------+---------+
| https://tumblr.com    |     141 |     163 | 0.06  |     0.118 |     0.273 |  0.12  |   0     |   0.571 |
+-----------------------+---------+---------+-------+-----------+-----------+--------+---------+---------+
| https://facebook.com  |     143 |     249 | 0.365 |     0.133 |     0.295 |  0.241 |   0     |   1.034 |
+-----------------------+---------+---------+-------+-----------+-----------+--------+---------+---------+
| https://wordpress.com |     144 |    8963 | 0.359 |     0.129 |     0.273 |  0.138 |   0     |   0.899 |
+-----------------------+---------+---------+-------+-----------+-----------+--------+---------+---------+

timings.py uses curl to make requests and generate timings. The following description of table columns is an adaptation of curl's --write-out option.

  • sizeu - The total amount of bytes that were uploaded.
  • sized - The total amount of bytes that were downloaded.
  • dns - The time, in seconds, it took for name resolving to complete.
  • tcp_con - The time, in seconds, it took for the TCP connection to the remote host (or proxy) to be established.
  • ssl_con - The time, in seconds, it took for the SSL/SSH/etc connect/handshake to the remote host to be completed.
  • calc - The time, in seconds, it took for the server to process the request.
  • trans - The time, in seconds, it took for the response to be transfered.
  • total - The total time for the request, in seconds.

Options

Usage:
  timings.py [--urls=URLS] [--fetch-count=COUNT] [--parallel]
  timings.py --version

Options:
  -h --help               show this help message and exit
  -v --version            show version and exit
  -u --urls=URLS          path to urls file
  -c --fetch-count=COUNT  number of times to fetch each url, for averaging purposes [default: 1]
  -p --parallel           when -c > 1, do requests in parallel [default: False]

url-timings's People

Contributors

kajic avatar

Watchers

Julien Dubreuil avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.