Skip to content

Commit

Permalink
Added perf client (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Mar 9, 2023
1 parent 86a7eda commit b5ee039
Show file tree
Hide file tree
Showing 10 changed files with 457 additions and 153 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ This project comprises JDK language compatible modules for the [Oxia][oxia] serv
the following capabilities:

- [Client](client/) for the Oxia service
- [Testcontainer](testcontainers/) for local integration testing with an Oxia service.
- [OpenTelemetry Metrics](client-metrics-opentelemetry/) integration with the client
- [Testcontainer](testcontainers/) for integration testing with a local Oxia service
- [Performance Test Tool](perf/) for performance testing with an Oxia service.

## Build

Expand Down
15 changes: 0 additions & 15 deletions client-metrics-opentelemetry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@
<artifactId>oxia-client-metrics-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
48 changes: 6 additions & 42 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<name>Oxia Client</name>

<properties>
<awaitility.version>3.0.0</awaitility.version>
<caffeine.version>3.1.4</caffeine.version>
<grpc.version>1.51.0</grpc.version>
<grpc-test.version>1.2.2</grpc-test.version>
Expand Down Expand Up @@ -96,15 +95,6 @@
<artifactId>zero-allocation-hashing</artifactId>
<version>${zah.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
Expand All @@ -117,42 +107,16 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility-proxy</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
35 changes: 35 additions & 0 deletions perf/README.md
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
```

93 changes: 93 additions & 0 deletions perf/pom.xml
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>
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();
}
Loading

0 comments on commit b5ee039

Please sign in to comment.