Giter VIP home page Giter VIP logo

salvo's Introduction

Salvo

http://coveralls.io/repos/github/tarekziade/salvo/badge.svg?branch=master http://travis-ci.org/tarekziade/salvo.svg?branch=master

This is the replacement for https://github.com/tarekziade/boom

Salvo is a simple command line tool to send some load to an HTTP(S) endpoint.

Salvo is a script you can use to quickly smoke-test your web app deployment. If you need a more complex tool, I'd suggest looking at Molotov

Salvo was specifically written to replace my Apache Bench (ab) usage. Salvo is based on Molotov, which uses Python 3 asyncio & aiohttp.

Installation

Salvo requires Python 3.6+ and Molotov, which gets installed as a dependency.

Just do:

$ pip install salvo

Basic usage

Basic usage example: 100 queries with a maximum concurrency of 10 users:

% salvo http://localhost:80 -c 10 -n 100
-------- Server info --------

Server Software: nginx/1.18.0
Host: localhost

-------- Running 100 queries - concurrency 10 --------

[================================================================>.] 99%

-------- Results --------

Successful calls                    1000
Total time                          16.0587 s
Average                             0.0161 s
Fastest                             0.0036 s
Slowest                             0.2524 s
Amplitude                           0.2488 s
Standard deviation                  0.011326
Requests Per Second                 62.27
Requests Per Minute                 3736.29

-------- Status codes --------
Code 200                    1000 times.

You can also use --duration if you want to run for a given amount of time.

For a full list of features, run salvo --help

Contribute

Salvo is very simple and anyone familiar with Python can contribute.

If you are interested in this project, you are welcome to join the fun at https://github.com/tarekziade/salvo

Make sure to add yourself to the contributors list if your PR gets merged. And make sure it's in alphabetical order!

salvo's People

Contributors

tarekziade avatar

Stargazers

Hanif Ali Ramdani avatar Alessandro Gambin da Silva avatar Nithin avatar  avatar Ademaro avatar Vipul Vaidya avatar Andrew Linzie avatar Brad Knowles avatar  avatar sy3c4ll avatar Dener Carvalho avatar Khairul Iman avatar Andreas Motl avatar Marcelo Zlotnik avatar Demetrio Carrara avatar  avatar daddyw01f avatar geduardcatalindev avatar Ano Rebel avatar Santiago Lator avatar Di avatar Marcin W. Dąbrowski avatar Mirco Babini avatar ddelange avatar Matteo Boffo aka stempelo avatar Mariano Ruiz avatar M_dev_pro avatar Ruizhe Wang avatar  avatar Fabrice Boyer avatar François Magimel avatar Web&Sundry avatar 佐野 彰 / SANO Akira avatar Krzysztof Wilczyński avatar Mohamed Al Salti avatar Mathieu Dupuy avatar Nir Zilberman avatar  avatar Anonimbus avatar Jonathan Marshall avatar Josh Purcell avatar  avatar  avatar  avatar 巴拉巴拉小魔仙 avatar  avatar Daler Rustamov avatar Armin Berres avatar FSSlc avatar  avatar acontreras_mp avatar Peter Simpson avatar Lukasz Cieslak avatar Emre Sevinç avatar Imaginary Stargazer avatar Michael Hirschler avatar Jeremiah Tabb avatar Kishorekumar Neelamegam avatar Tim Cappalli avatar Sagar Giri avatar Igor Leahu avatar Nathaniel Sabanski avatar Michael LaMuerte avatar Chanshik Lim avatar Peerachai  Deesongkram avatar Joe Passanante avatar Sergey Maranchuk avatar Felipe Gonzalez avatar Camilo Nova avatar Jayaseelan Yezhuaralai avatar Joseph Laurendi avatar Alejandro Ospina avatar Kai.Ke avatar Miguel Ángel Cárdenas avatar  avatar Matias Anoniz avatar Ramesh Pradhan avatar Adam Harpur avatar Ricardo Avila avatar  avatar Delsere avatar Stefan Hagen avatar Adylzhan Khashtamov avatar Valentin Ivanov avatar Ole Vik avatar Laurentiu Ilie avatar Nikolas Evers avatar Kate Beard avatar  avatar Sandro avatar Akbar Rifai avatar Matteo Baiguini avatar Igor Balagurov avatar  avatar  avatar Jeronimo Martinez Sanchez avatar Oleksandr Vodolazskyi avatar Thomas Jaskiewicz avatar  avatar Marc Aubé avatar

Watchers

Noam  Vergain avatar  avatar James Cloos avatar Isaías avatar Thiago Carreira A. Nascimento avatar Danil Dubovyk avatar  avatar Ningú avatar

salvo's Issues

set user agent

Set user agent header with Salvo version and Molotov version

got an unexpected keyword argument 'loop'

Hi:

I want to use salvo on my project, install it with pipenv and run against my apache server and got this error:

-------- Server info --------

Server Software: Apache/2.4.41 (Ubuntu)

-------- Running 100 queries - concurrency 10 --------


Traceback (most recent call last):
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/bin/salvo", line 8, in <module>
    sys.exit(console_main())
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/salvo/run.py", line 221, in console_main
    main()
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/salvo/run.py", line 200, in main
    res, molotov_res = load(args.url, args)
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/salvo/run.py", line 44, in load
    molotov_res = run_test(url, res, args)
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/salvo/scenario.py", line 139, in run_test
    res = run(args, stream=stream)
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/molotov/run.py", line 301, in run
    res = Runner(args)()
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/molotov/runner.py", line 73, in __call__
    return self._launch_processes()
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/molotov/runner.py", line 119, in _launch_processes
    self._process()
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/molotov/runner.py", line 199, in _process
    display = self.gather(update, display)
  File "/home/nomar/.local/share/virtualenvs/fastapi_blueprint_01-Z-nbJPAX/lib/python3.10/site-packages/molotov/runner.py", line 57, in gather
    return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
TypeError: gather() got an unexpected keyword argument 'loop'

Any advice?

Thanks in advance
Nomar Mora

TypeError: run() got an unexpected keyword argument 'stream'

I tried both salvo from pypi, and a -e install from the current master (that is as well 0.1, as I discovered ;-)

--- ~ » salvo -c 10 -n 100 https://bnzk.ch                            
-------- Server info --------

Server Software: nginx

-------- Running 100 queries - concurrency 10 --------


Traceback (most recent call last):
  File "/home/benzkji/.local/bin/salvo", line 11, in <module>
    load_entry_point('salvo', 'console_scripts', 'salvo')()
  File "/home/benzkji/src/salvo/salvo/run.py", line 203, in main
    res, molotov_res = load(url, args)
  File "/home/benzkji/src/salvo/salvo/run.py", line 41, in load
    molotov_res = run_test(url, res, args)
  File "/home/benzkji/src/salvo/salvo/scenario.py", line 114, in run_test
    res = run(args, stream=stream)
TypeError: run() got an unexpected keyword argument 'stream'

[feature request] Semi-dynamic url

First of all I really like what you have created, for load testing it's awesome tool. Simple and functional. Sorry for putting this into a ticket but I had no idea how to reach you other way. ;-)

Do you reckon feature that will allow make calls on many different urls would be something that should not be a part of this library. The easiest solution could be to use some sort of random variable or even simpler instead of providing one url, provide list of urls in form of config or coma separated list.

Our use case is testing api server's load and forcing it to rotate cache.

i am getting this error when trying to run on windows with Python 3.10.8 miniconda

i am getting this error when trying to run on windows with Python 3.10.8 miniconda

PS C:\Users\isaque.neves> salvo "http://192.168.66.123:3350/api/v1/protocolo/processos?limit=12&offset=0&search=10&orderDir=desc" -c 10 -n 100 -m GET --content-type "application/json" --header "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImFub19leGVyY2ljaW8iOiIyMDIzIiwiYW5vX2V4ZXJjaWNpb19zZXRvciI6IjIwMDMiLCJjb2RfZGVwYXJ0YW1lbnRvIjoyLCJjb2Rfb3JnYW8iOjIsImNvZF9zZXRvciI6MSwiY29kX3VuaWRhZGUiOjg5LCJjcGYiOm51bGwsIm5vbV9jZ20iOiJJc2FxdWUgTmV2ZXMgU2FudCdhbmEiLCJudW1jZ20iOjE0MDA1MCwidXNlcm5hbWUiOiJpc2FxdWUuc2FudGFuYSJ9LCJleHAiOjE2OTA0OTQxNTksImlhdCI6MTY5MDQ2MTc1OSwiaXNzIjoibmV3c2FsaS5yaW9kYXNvc3RyYXMucmouZ292LmJyIiwibmJmIjoxNjkwNDYxNzU5fQ.0BvLPlghuRtMkceOQHhjFfYZMvYx9wgRFiv_q4khKh0"
-------- Server info --------

Server Software: Angel3
Authorization:  Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImFub19leGVyY2ljaW8iOiIyMDIzIiwiYW5vX2V4ZXJjaWNpb19zZXRvciI6IjIwMDMiLCJjb2RfZGVwYXJ0YW1lbnRvIjoyLCJjb2Rfb3JnYW8iOjIsImNvZF9zZXRvciI6MSwiY29kX3VuaWRhZGUiOjg5LCJjcGYiOm51bGwsIm5vbV9jZ20iOiJJc2FxdWUgTmV2ZXMgU2FudCdhbmEiLCJudW1jZ20iOjE0MDA1MCwidXNlcm5hbWUiOiJpc2FxdWUuc2FudGFuYSJ9LCJleHAiOjE2OTA0OTQxNTksImlhdCI6MTY5MDQ2MTc1OSwiaXNzIjoibmV3c2FsaS5yaW9kYXNvc3RyYXMucmouZ292LmJyIiwibmJmIjoxNjkwNDYxNzU5fQ.0BvLPlghuRtMkceOQHhjFfYZMvYx9wgRFiv_q4khKh0

-------- Running 100 queries - concurrency 10 --------


Traceback (most recent call last):
  File "C:\miniconda3\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\miniconda3\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\Scripts\salvo.exe\__main__.py", line 7, in <module>
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\site-packages\salvo\run.py", line 221, in console_main
    main()
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\site-packages\salvo\run.py", line 200, in main
    res, molotov_res = load(args.url, args)
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\site-packages\salvo\run.py", line 44, in load
    molotov_res = run_test(url, res, args)
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\site-packages\salvo\scenario.py", line 139, in run_test
    res = run(args, stream=stream)
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\site-packages\molotov\run.py", line 306, in run
    res = Runner(args)()
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\site-packages\molotov\runner.py", line 74, in __call__
    return self._launch_processes()
  File "C:\Users\isaque.neves\AppData\Roaming\Python\Python310\site-packages\molotov\runner.py", line 88, in _launch_processes
    self.loop.add_signal_handler(signal.SIGTERM, self._shutdown)
  File "C:\miniconda3\lib\asyncio\events.py", line 553, in add_signal_handler
    raise NotImplementedError
NotImplementedError
PS C:\Users\isaque.neves>

current state

just a quick bumper...how is it going here? love boom1, but it seems broken on modern python versions?

UUID or Random

How can we send post data with UUID for example
'{"user":"UUID", "query":"hello"}'

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.