Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another attempt to loop through client/concurrent tasks #18

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f098bc4
Renamed python Logger file to logger
barshaul Sep 18, 2023
e08b7b5
Fixed Python documented type of BackoffStrategy
barshaul Sep 18, 2023
3fea238
Python - INCRBYFLOAT command
shohamazon Sep 19, 2023
dd30116
Python - adds config set/get support
shohamazon Sep 19, 2023
d8b0b77
Python - adds decr / decrby commands
shohamazon Sep 19, 2023
98d6e2f
Remove log directory before tests run.
shachlanAmazon Sep 19, 2023
08502e2
Filter traces from other crates.
shachlanAmazon Sep 19, 2023
b8faf86
Replace CMD with Standalone & CME with Cluster.
shachlanAmazon Sep 19, 2023
93a763a
Allow choosing port in benchmark.
shachlanAmazon Sep 18, 2023
18b9392
added mset and mget command in node.
Sep 20, 2023
dc639a6
Updates from redis-rs
barshaul Sep 20, 2023
6aef922
Move duplicated logic in benchmark JS scripts to a single file, and c…
avifenesh Sep 21, 2023
7342b18
Python - cluster commands return type
shohamazon Sep 21, 2023
1ed9d3c
added utilities folder to ts linter
avifenesh Sep 21, 2023
7b94e52
Fix Rust benchmark.
Yury-Fridlyand Sep 22, 2023
c272399
Remove `port` short arg option too.
Yury-Fridlyand Sep 22, 2023
a3358da
Add Jedis and Lettuce benchmarks
jonathanl-bq Sep 7, 2023
8065b5c
Start ignoring .gradle files
jonathanl-bq Sep 8, 2023
c6af8d0
Update gitignore and remove generated files from git
acarbonetto Sep 8, 2023
9ca27bc
Update gitignore and remove generated files from git
acarbonetto Sep 8, 2023
bd5186c
Update gitignore and remove generated files from git
acarbonetto Sep 8, 2023
a714733
Add benchmarks for GET non-existing
jonathanl-bq Sep 8, 2023
9a289f4
Revert "Update gitignore and remove generated files from git"
acarbonetto Sep 8, 2023
1294547
fix redis-rs submodules
acarbonetto Sep 8, 2023
365111b
Randomize commands in Java benchmarks
jonathanl-bq Sep 13, 2023
dcdd4ed
rename chooseAction to randomAction
jonathanl-bq Sep 14, 2023
042d32d
Add a Java benchmarking app (#7)
acarbonetto Sep 20, 2023
f540dbb
Add Readme and update install_and_test script to runJava
acarbonetto Sep 20, 2023
7863c1e
Add Readme and update install_and_test script to runJava
acarbonetto Sep 20, 2023
2b0beec
Combine java pipeline and java benchmarks (#8)
Yury-Fridlyand Sep 22, 2023
bdca891
Add sync and async clients both to tests. (#12)
Yury-Fridlyand Sep 25, 2023
c542597
Move duplicated logic in benchmark JS scripts to a single file, and c…
acarbonetto Sep 25, 2023
8764730
Add dataSize option to java benchmark. (#11)
Yury-Fridlyand Sep 26, 2023
884d97d
Add option to run tests on multiple clients in concurrency
Yury-Fridlyand Sep 26, 2023
ef41428
Add ALL clients option by default
acarbonetto Sep 26, 2023
0b7df6f
Add concurrent tasks and clients loop against iteration max tasks
acarbonetto Sep 27, 2023
acd1934
Add spotless apply
acarbonetto Sep 27, 2023
b3fc45d
Fix tls flag option
acarbonetto Sep 27, 2023
b6d9430
Measure async fetch performance with get/set
acarbonetto Oct 3, 2023
a783462
Clean up atomic increments
acarbonetto Oct 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/java-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Java client benchmarks

on:
workflow_dispatch:
inputs:
name:
required: false
type: string

run-name: ${{ inputs.name == '' && format('{0} @ {1}', github.ref_name, github.sha) || inputs.name }}

jobs:
java-benchmark:
strategy:
matrix:
java:
- 11
- 17
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: ${{ matrix.java }}

- name: Start Redis
run: docker run -p 6379:6379 -p 8001:8001 -d redis/redis-stack

- name: Run benchmarks
working-directory: java/jabushka
run: ./gradlew :benchmark:run

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: test-reports-${{ matrix.java }}
path: |
java/jabushka/benchmarks/build/reports/**
63 changes: 63 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: SQL Java CI

on:
pull_request:
push:
paths:
- "java/**"
- ".github/workflows/java.yml"

# Run only most latest job on a branch and cancel previous ones
concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build-and-test-java-client:
strategy:
# Run all jobs
fail-fast: false
matrix:
java:
- 11
- 17
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: ${{ matrix.java }}

- name: Install and run protoc (protobuf)
run: |
sudo apt update
sudo apt install -y protobuf-compiler
mkdir -p java/jabushka/jabushka/src/main/java/org/babushka/jabushka/generated
protoc -Iprotobuf=babushka-core/src/protobuf/ --java_out=java/jabushka/jabushka/src/main/java/org/babushka/jabushka/generated babushka-core/src/protobuf/*.proto

- name: Build rust part
working-directory: java
run: cargo build

- name: Start Redis
run: docker run -p 6379:6379 -p 8001:8001 -d redis/redis-stack

- name: Build java part
working-directory: java/jabushka
run: ./gradlew --continue build

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: test-reports-${{ matrix.java }}
path: |
java/jabushka/jabushka/build/reports/**
java/jabushka/integTest/build/reports/**
2 changes: 2 additions & 0 deletions .github/workflows/lint-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
paths:
- benchmarks/node/**
- node/**
- benchmarks/utilities/*
pull_request:
paths:
- benchmarks/node/**
- node/**
- benchmarks/utilities/*

env:
CARGO_TERM_COLOR: always
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
debug/
target/

# Git stuff
.worktrees

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
Expand All @@ -17,6 +20,14 @@ dump.rdb
.env
benchmarks/results

# IDE generaged files
.vs
.vscode
.idea

# MacOS metadata
.DS_Store

# lock files

yarn.lock
Expand Down
42 changes: 0 additions & 42 deletions .vscode/launch.json

This file was deleted.

37 changes: 0 additions & 37 deletions .vscode/settings.json

This file was deleted.

41 changes: 0 additions & 41 deletions .vscode/tasks.json

This file was deleted.

38 changes: 19 additions & 19 deletions babushka-core/src/client/mod.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use crate::connection_request::{
AddressInfo, AuthenticationInfo, ConnectionRequest, ReadFromReplicaStrategy, TlsMode,
};
pub use client_cmd::ClientCMD;
use futures::FutureExt;
use redis::cluster_async::ClusterConnection;
use redis::cluster_routing::{RoutingInfo, SingleNodeRoutingInfo};
use redis::{
aio::{ConnectionLike, ConnectionManager, MultiplexedConnection},
RedisResult,
};
pub use standalone_client::StandaloneClient;
use std::io;
use std::time::Duration;
mod client_cmd;
mod reconnecting_connection;
mod standalone_client;

pub const HEARTBEAT_SLEEP_DURATION: Duration = Duration::from_secs(1);

Expand Down Expand Up @@ -78,8 +78,8 @@ pub(super) fn get_connection_info(

#[derive(Clone)]
pub enum ClientWrapper {
CMD(ClientCMD),
CME {
Standalone(StandaloneClient),
Cluster {
client: ClusterConnection,
read_from_replicas: bool,
},
Expand Down Expand Up @@ -109,9 +109,9 @@ impl Client {
) -> redis::RedisFuture<'a, redis::Value> {
run_with_timeout(self.response_timeout, async {
match self.internal_client {
ClientWrapper::CMD(ref mut client) => client.send_packed_command(cmd).await,
ClientWrapper::Standalone(ref mut client) => client.send_packed_command(cmd).await,

ClientWrapper::CME {
ClientWrapper::Cluster {
ref mut client,
read_from_replicas,
} => {
Expand All @@ -133,11 +133,11 @@ impl Client {
) -> redis::RedisFuture<'a, Vec<redis::Value>> {
(async move {
match self.internal_client {
ClientWrapper::CMD(ref mut client) => {
ClientWrapper::Standalone(ref mut client) => {
client.send_packed_commands(cmd, offset, count).await
}

ClientWrapper::CME {
ClientWrapper::Cluster {
ref mut client,
read_from_replicas: _,
} => {
Expand Down Expand Up @@ -205,16 +205,16 @@ async fn create_cluster_client(

#[derive(thiserror::Error)]
pub enum ConnectionError {
CMD(client_cmd::ClientCMDConnectionError),
CME(redis::RedisError),
Standalone(standalone_client::StandaloneClientConnectionError),
Cluster(redis::RedisError),
Timeout,
}

impl std::fmt::Debug for ConnectionError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::CMD(arg0) => f.debug_tuple("CMD").field(arg0).finish(),
Self::CME(arg0) => f.debug_tuple("CME").field(arg0).finish(),
Self::Standalone(arg0) => f.debug_tuple("Standalone").field(arg0).finish(),
Self::Cluster(arg0) => f.debug_tuple("Cluster").field(arg0).finish(),
Self::Timeout => write!(f, "Timeout"),
}
}
Expand All @@ -223,8 +223,8 @@ impl std::fmt::Debug for ConnectionError {
impl std::fmt::Display for ConnectionError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
ConnectionError::CMD(err) => write!(f, "{err:?}"),
ConnectionError::CME(err) => write!(f, "{err}"),
ConnectionError::Standalone(err) => write!(f, "{err:?}"),
ConnectionError::Cluster(err) => write!(f, "{err}"),
ConnectionError::Timeout => f.write_str("connection attempt timed out"),
}
}
Expand All @@ -243,16 +243,16 @@ impl Client {
let internal_client = if request.cluster_mode_enabled {
let (client, read_from_replicas) = create_cluster_client(request)
.await
.map_err(ConnectionError::CME)?;
ClientWrapper::CME {
.map_err(ConnectionError::Cluster)?;
ClientWrapper::Cluster {
client,
read_from_replicas,
}
} else {
ClientWrapper::CMD(
ClientCMD::create_client(request)
ClientWrapper::Standalone(
StandaloneClient::create_client(request)
.await
.map_err(ConnectionError::CMD)?,
.map_err(ConnectionError::Standalone)?,
)
};

Expand Down
Loading