Update README with examples.
This commit is contained in:
parent
b95c5ca115
commit
c59fd3c216
44
README.md
44
README.md
|
@ -1,6 +1,6 @@
|
|||
# jPerf
|
||||
# jnetperf
|
||||
|
||||
Small utility to measure network performance between two hosts.
|
||||
Small utility to measure (single threaded) network performance between two hosts.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
@ -9,21 +9,39 @@ You need Java (JRE) version 8 or later to run jnetperf.
|
|||
## Usage Instructions
|
||||
|
||||
- Install the jnetperf package (*.deb*, *.rpm* or *.jar*) from [downloads](https://bitbucket.org/mnellemann/jnetperf/downloads/) or compile from source.
|
||||
- Run **/opt/jnetperf/bin/jperf**, if installed from package
|
||||
- Or as **java -jar /path/to/jnetperf.jar**
|
||||
- Run **/opt/jnetperf/bin/jperf**, if installed from package, or as **java -jar /path/to/jnetperf.jar**
|
||||
|
||||
```shell
|
||||
Usage: jnetperf [-hV] [-l=SIZE] [-n=NUM] [-p=PORT] (-c=HOST | -s)
|
||||
Network Performance Testing.
|
||||
-c, --connect=HOST Connect to remote server
|
||||
-h, --help Show this help message and exit.
|
||||
-l, --pkt-len=SIZE Datagram size in bytes, max 65507 [default: 65507]
|
||||
-n, --pkt-num=NUM Number of packets to send [default: 150000]
|
||||
-p, --port=PORT Network port [default: 4445]
|
||||
-s, --server Run server and wait for client
|
||||
-V, --version Print version information and exit.
|
||||
Usage: jnetperf [-hV] [-l=SIZE] [-n=NUM] [-p=PORT] (-c=SERVER | -s)
|
||||
For more information visit https://git.data.coop/nellemann/jnetperf
|
||||
-c, --connect=SERVER Connect to remote server.
|
||||
-h, --help Show this help message and exit.
|
||||
-l, --pkt-len=SIZE Datagram size in bytes, max 65507 [default: 65507].
|
||||
-n, --pkt-num=NUM Number of packets to send [default: 150000].
|
||||
-p, --port=PORT Network port [default: 4445].
|
||||
-s, --server Run server and wait for client.
|
||||
-V, --version Print version information and exit.
|
||||
```
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
On *host A* run jnetperf as a server waiting for a connection from a client:
|
||||
|
||||
```shell
|
||||
java -jar jnetperf-x.y.z-all.jar -s
|
||||
```
|
||||
|
||||
On *host B* run jnetperf as a client connecting to the server and sending data:
|
||||
|
||||
```shell
|
||||
java -jar jnetperf-x.y.z-all.jar -c server-ip
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Development Information
|
||||
|
||||
You need Java (JDK) version 8 or later to build jnetperf.
|
||||
|
|
|
@ -24,27 +24,29 @@ import java.net.SocketException;
|
|||
import java.util.concurrent.Callable;
|
||||
|
||||
|
||||
@Command(name = "jnetperf", mixinStandardHelpOptions = true, versionProvider = VersionProvider.class, description = "Network Performance Testing.")
|
||||
@Command(name = "jnetperf", mixinStandardHelpOptions = true,
|
||||
versionProvider = VersionProvider.class,
|
||||
description = "For more information visit https://git.data.coop/nellemann/jnetperf")
|
||||
public class Application implements Callable<Integer> {
|
||||
|
||||
@CommandLine.ArgGroup(exclusive = true, multiplicity = "1")
|
||||
RunMode runMode;
|
||||
|
||||
static class RunMode {
|
||||
@CommandLine.Option(names = { "-c", "--connect" }, required = true, description = "Connect to remote server", paramLabel = "HOST")
|
||||
@CommandLine.Option(names = { "-c", "--connect" }, required = true, description = "Connect to remote server.", paramLabel = "SERVER")
|
||||
String remoteServer;
|
||||
|
||||
@CommandLine.Option(names = { "-s", "--server" }, required = true, description = "Run server and wait for client")
|
||||
@CommandLine.Option(names = { "-s", "--server" }, required = true, description = "Run server and wait for client.")
|
||||
boolean runServer = false;
|
||||
}
|
||||
|
||||
@CommandLine.Option(names = { "-l", "--pkt-len" }, paramLabel = "SIZE", description = "Datagram size in bytes, max 65507 [default: ${DEFAULT-VALUE}]")
|
||||
@CommandLine.Option(names = { "-l", "--pkt-len" }, paramLabel = "SIZE", description = "Datagram size in bytes, max 65507 [default: ${DEFAULT-VALUE}].")
|
||||
int packetSize = 65507; // Min: 256 Max: 65507
|
||||
|
||||
@CommandLine.Option(names = { "-n", "--pkt-num" }, paramLabel = "NUM", description = "Number of packets to send [default: ${DEFAULT-VALUE}]")
|
||||
@CommandLine.Option(names = { "-n", "--pkt-num" }, paramLabel = "NUM", description = "Number of packets to send [default: ${DEFAULT-VALUE}].")
|
||||
int packetCount = 150_000;
|
||||
|
||||
@CommandLine.Option(names = { "-p", "--port" }, paramLabel = "PORT", description = "Network port [default: ${DEFAULT-VALUE}]")
|
||||
@CommandLine.Option(names = { "-p", "--port" }, paramLabel = "PORT", description = "Network port [default: ${DEFAULT-VALUE}].")
|
||||
int port = 4445;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue