module: ‘function.py’

gwa.eperf.function.helpEperf()[source]

This function allow to display the Eperf Help.

usage

eperf -s [option]
eperf [-net <host>] [-UDP|-TCP] [-upload|-download] [option]
eperf [-h|--help] 

Server specific ( ‘eperf -s’ )

-s Run in server mode (mandatory)

-p Server port to listen on (default TCP : 5000 / UDP : 5001)(optional)

Client specific

-net <host>          Run in client mode, connecting to <host> (mandatory)

-UDP                 Client mode UDP connecting to <host> (mandatory)

-TCP                 Client mode TCP connecting to <host> (mandatory)

[-upload|-download]  Client mode upload or download or both (one is mandatory)

-p                   Server port to connect to (default TCP : 5000 / UDP : 5001)(optional)

-i <interval>        Seconds between periodic bandwidth reports (default 1 secs)(optional)

-d <duration>        Time in seconds to transmit for (default 5 secs)(optional)

-c <connection>      For TCP mode, the number of connection simultanouse (default 3 connection)(optional)

-bw <bandwidth>      For UDP, bandwidth to send at in bits/sec (default 50 Mbits/s)(optional)
gwa.eperf.function.strNbData(nbBytes)[source]

This function convert and return a string with the rigth unit of the data.

Argument :
nbBytes (type float)

This argument represents the number of bytes.

nbsec (type float)

This argument represents the number of second.

Return :

A String with the bandwidth.

example

>>> strbandwidth(800,1)
'6.250 Kbits/s'
>>> strbandwidth(100000,5)
'156.250 Kbits/s'
gwa.eperf.function.strbandwidth(nbBytes, nbsec)[source]

This function calculate and return a string with the rigth unit of the bandwidth.

Argument :
nbBytes (type float)

This argument represents the number of bytes.

nbsec (type float)

This argument represents the number of second.

Return :

A String with the bandwidth.

example

>>> strbandwidth(800,1)
'6.250 Kbits/s'
>>> strbandwidth(100000,5)
'156.250 Kbits/s'
gwa.eperf.function.getIpAddr()[source]

This function allow to read the IP Address on all network interfaces.

Return :
A tuples list with name of interface and this IP Address.

[ (‘name_of_interface’, ‘IP_address’),(‘lo’, ‘127.0.0.1’)]

example

>>> IP=getIpAddr()
>>> IP
[('eth0', '192.168.1.37'), ('lo', '127.0.0.1'), ('wlan0', '192.168.1.22')]
class gwa.eperf.function.Timer[source]

This function, we allow to create a timer reference.

get_value()[source]

This function, we allow to give a timer.

restart()[source]

This function, we allow to reset a timer reference.

Previous topic

module: ‘server_udp.py’

This Page