Suppoet for TCP #1
40
README.md
40
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
|
## Requirements
|
||||||
|
|
||||||
|
@ -8,26 +8,42 @@ You need Java (JRE) version 8 or later to run jnetperf.
|
||||||
|
|
||||||
## Usage Instructions
|
## Usage Instructions
|
||||||
|
|
||||||
- Install the jnetperf package (*.deb*, *.rpm* or *.jar*) from [downloads](https://bitbucket.org/mnellemann/jnetperf/downloads/) or compile from source.
|
- Install the jnetperf package (*.deb*, *.rpm* or *.jar*) from [Packages](https://git.data.coop/nellemann/jnetperf/packages) or compile from source.
|
||||||
- Run **/opt/jnetperf/bin/jperf**, if installed from package
|
- Run **/opt/jnetperf/bin/jperf**, if installed from package, or as **java -jar /path/to/jnetperf.jar**
|
||||||
- Or as **java -jar /path/to/jnetperf.jar**
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
Usage: jnetperf [-hV] [-l=SIZE] [-n=NUM] [-p=PORT] (-c=HOST | -s)
|
Usage: jnetperf [-hV] [-l=SIZE] [-n=NUM] [-p=PORT] (-c=SERVER | -s)
|
||||||
Network Performance Testing.
|
For more information visit https://git.data.coop/nellemann/jnetperf
|
||||||
-c, --connect=HOST Connect to remote server
|
-c, --connect=SERVER Connect to remote server.
|
||||||
-h, --help Show this help message and exit.
|
-h, --help Show this help message and exit.
|
||||||
-l, --pkt-len=SIZE Datagram size in bytes, max 65507 [default: 65507]
|
-l, --pkt-len=SIZE Datagram size in bytes, max 65507 [default: 65507].
|
||||||
-n, --pkt-num=NUM Number of packets to send [default: 150000]
|
-n, --pkt-num=NUM Number of packets to send [default: 150000].
|
||||||
-p, --port=PORT Network port [default: 4445]
|
-p, --port=PORT Network port [default: 4445].
|
||||||
-s, --server Run server and wait for client
|
-s, --server Run server and wait for client.
|
||||||
-V, --version Print version information and exit.
|
-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
|
## Development Information
|
||||||
|
|
||||||
You need Java (JDK) version 8 or later to build jnetperf.
|
You need Java (JDK) version 8 or later to build jnetperf.
|
||||||
|
|
||||||
|
|
||||||
### Build & Test
|
### Build & Test
|
||||||
|
|
||||||
Use the gradle build tool, which will download all required dependencies:
|
Use the gradle build tool, which will download all required dependencies:
|
||||||
|
|
|
@ -24,27 +24,29 @@ import java.net.SocketException;
|
||||||
import java.util.concurrent.Callable;
|
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> {
|
public class Application implements Callable<Integer> {
|
||||||
|
|
||||||
@CommandLine.ArgGroup(exclusive = true, multiplicity = "1")
|
@CommandLine.ArgGroup(exclusive = true, multiplicity = "1")
|
||||||
RunMode runMode;
|
RunMode runMode;
|
||||||
|
|
||||||
static class 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;
|
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;
|
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
|
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;
|
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;
|
int port = 4445;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue