Code Monkey home page Code Monkey logo

hog's Introduction

Hog

Sending multiple HTTP requests ON GREEN thread like an hog. Runs on Python 2 / 3.

Using Hog as console script

Usage: hog [OPTIONS] URL

  Sending multiple `HTTP` requests `ON` `GREEN` thread

Options:
  -c, --concurrency INTEGER  Number of threads
  -n, --requests INTEGER     Number of requests
  -l, --limit INTEGER        Limit requests per second (0=unlimited)
  -t, --timeout INTEGER      Timeout limit in seconds
  -p, --params TEXT          Parameters (in key=value format)
  -f, --paramfile TEXT       File contains parameters (multiple key=value)
  -H, --headers TEXT         Custom headers (in key=value format)
  -F, --headerfile TEXT      File contains custom headers (multiple key=value)
  -m, --method [GET|POST]    Method to be used (GET,POST)
  --help                     Show this message and exit.

Using Hog via module

import hog

r = hog.run("http://somewhere.in.universe/")

if r.ok:
    print("Looking good.")

Sample result

$ hog -c 250 -n 1000 -t 5 http://somewhere.in.universe/
-------------------------------------------------------------------------------
Hog is running with 250 threads, 1000 requests and timeout in 5 second(s).
-------------------------------------------------------------------------------
  [======================================================================] 100%
-------------------------------------------------------------------------------
STATUS  COUNT   AVERAGE
-------------------------------------------------------------------------------
   200    360   2161.32ms
   502    427    450.02ms
   503    113    632.74ms
-------------------------------------------------------------------------------
Response time distribution of succeed requests
          50%   2214.45ms
          66%   2337.06ms
          75%   2420.22ms
          80%   2489.50ms
          90%   2635.47ms
          95%   2709.51ms
          98%   2753.71ms
          99%   2785.34ms
         100%   2839.30ms
-------------------------------------------------------------------------------
>>> 100 request(s) just failed
total time elapsed 9.9918s

Install

pip install hog

Author

Park Hyunwoo(@lqez)

License

hog is distributed under MIT license.

hog's People

Contributors

lqez avatar parkayun avatar

Watchers

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.