Giter Club home page Giter Club logo

py3iperf3's Introduction

Build Status Coverage Status

Py3iPerf3 - A native Python iPerf3 client

Py3iPerf3 is a clone of iPerf3 network performance measurement tool implemented in pure Python. The client is network-protocol compatible with the original iPerf3 maintained by ESnet and written in C. Py3iPerf3 can be used as a stand-alone application, or as a library in your application.

N.B.

This is work in progress. At the moment, the client supports working as a client (i.e. not server) and can send and receive data using TCP and UDP.

Running as a stand-alone application

As with iPerf3, py3iPerf3 can work as a stand-alone command-line application. It is configured by passing command line parameters. You can get the whole list of supported parameters by invoking py3iPerf3 with a "-h" option: python3 iperf.py -h.

Additionally, all supported options are listed here as well:

--server-address <IP Address/Hostname> # IP address or hostname of the server
--server-port <Port>                   # Port of the server. Defaults to 5201
--client-port <Port>                   # Bind client to the given port. Defaults to ephemeral port.
--ip-version <4|6>                     # Connect using the indicated IP version
--test-duration <Sec>                  # How long to run the test. Default is 10 seconds
--debug                                # Enable debug output
--log-filename <Path>                  # Log to the indicated file
--parallel <N>                         # Send data on this number of parallel streams
--blockcount <N>                       # Number of blocks to send
--reverse                              # Reverse data direction (server sends data)
--protocol <TCP|UDP>                   # Data transport protocol. Defaults to TCP
--no-delay                             # Disable Nagle's algorithm
--title <Text>                         # Add free text to the results
--get-server-output                    # Get results from the server
--window <Size>                        # Set the data socket buffer size in Bytes

Running as a library

The following example shows how to run the client as a library:

import asyncio

from py3iperf3.iperf3_client import Iperf3Client
from py3iperf3.test_settings import TestSettings

loop = asyncio.get_event_loop()
params = TestSettings() 

# Do any changes to the defaults as required
params.server_address = '127.0.0.1'
params.test_duration = 60

iperf3_client = Iperf3Client(loop=loop)
iperf3_test = iperf3_client.create_test(test_parameters=params)

try:
   loop.call_soon(iperf3_client.run_all_tests)
   loop.run_forever()
except KeyboardInterrupt:
   pass

iperf3_client.stop_all_tests()
loop.close()

Performance

Py3iPerf3 is based on asyncio library and its performance is only as good as the performance of the event loop implementation. Furthermore, even if using parallel connections, the application is single-threaded and all parallel connections are run on a single thread. In the (near?) future, the code will be updated to support running data connections in their own dedicated processes.

License and contributing

The code of py3iPerf3 is released under the MIT license. Contributions are encouraged via GitHub.

py3iperf3's People

Contributors

justas- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

py3iperf3's Issues

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.