-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
457 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Performance Test Tool | ||
|
||
## Usage | ||
|
||
```commandline | ||
Usage: oxia-java perf [options] | ||
Options: | ||
--batch-linger-ms | ||
Batch linger time | ||
Default: 5 | ||
-h, --help | ||
Help message | ||
-k, --keys-cardinality | ||
Number of unique keys | ||
Default: 1000 | ||
--max-requests-per-batch | ||
Maximum requests per batch | ||
Default: 1000 | ||
-r, --rate | ||
Request rate, ops/s | ||
Default: 100.0 | ||
-p, --read-write-percent | ||
Percentage of read requests, compared to total requests | ||
Default: 80.0 | ||
--request-timeout-ms | ||
Requests timeout | ||
Default: 30000 | ||
-a, --service-addr | ||
Oxia Service Address | ||
Default: localhost:6648 | ||
-s, --value-size | ||
Size of the values to write | ||
Default: 128 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright © 2022-2023 StreamNative Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.streamnative.oxia</groupId> | ||
<artifactId>oxia-java</artifactId> | ||
<version>0.0.6-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>oxia-perf</artifactId> | ||
<name>Oxia Perf Client</name> | ||
|
||
<properties> | ||
<hdr-histogram.version>2.1.9</hdr-histogram.version> | ||
<jcommander.version>1.82</jcommander.version> | ||
<maven.shade.plugin.version>3.4.1</maven.shade.plugin.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.beust</groupId> | ||
<artifactId>jcommander</artifactId> | ||
<version>${jcommander.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.streamnative.oxia</groupId> | ||
<artifactId>oxia-client</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hdrhistogram</groupId> | ||
<artifactId>HdrHistogram</artifactId> | ||
<version>${hdr-histogram.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<version>${slf4j.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>${maven.shade.plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<phase>package</phase> | ||
<configuration> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>module-info.class</exclude> | ||
<exclude>META-INF/MANIFEST.MF</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/> | ||
</transformers> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
71 changes: 71 additions & 0 deletions
71
perf/src/main/java/io/streamnative/oxia/client/perf/PerfArguments.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright © 2022-2023 StreamNative Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.streamnative.oxia.client.perf; | ||
|
||
|
||
import com.beust.jcommander.Parameter; | ||
import com.beust.jcommander.Parameters; | ||
import io.streamnative.oxia.client.OxiaClientBuilder; | ||
|
||
@Parameters(commandDescription = "Test Oxia Java client performance.") | ||
public class PerfArguments { | ||
|
||
@Parameter( | ||
names = {"-h", "--help"}, | ||
description = "Help message", | ||
help = true) | ||
boolean help; | ||
|
||
@Parameter( | ||
names = {"-a", "--service-addr"}, | ||
description = "Oxia Service Address") | ||
String serviceAddr = "localhost:6648"; | ||
|
||
@Parameter( | ||
names = {"-r", "--rate"}, | ||
description = "Request rate, ops/s") | ||
double requestsRate = 100.0; | ||
|
||
@Parameter( | ||
names = {"-p", "--read-write-percent"}, | ||
description = "Percentage of read requests, compared to total requests") | ||
double readPercentage = 80.0; | ||
|
||
@Parameter( | ||
names = {"-k", "--keys-cardinality"}, | ||
description = "Number of unique keys") | ||
int keysCardinality = 1_000; | ||
|
||
@Parameter( | ||
names = {"-s", "--value-size"}, | ||
description = "Size of the values to write") | ||
int valueSize = 128; | ||
|
||
@Parameter( | ||
names = {"--batch-linger-ms"}, | ||
description = "Batch linger time") | ||
long batchLingerMs = OxiaClientBuilder.DefaultBatchLinger.toMillis(); | ||
|
||
@Parameter( | ||
names = {"--max-requests-per-batch"}, | ||
description = "Maximum requests per batch") | ||
int maxRequestsPerBatch = OxiaClientBuilder.DefaultMaxRequestsPerBatch; | ||
|
||
@Parameter( | ||
names = {"--request-timeout-ms"}, | ||
description = "Requests timeout") | ||
long requestTimeoutMs = OxiaClientBuilder.DefaultRequestTimeout.toMillis(); | ||
} |
Oops, something went wrong.