mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-23 09:16:37 -06:00
Merge branch 'nosqlbench:main' into main
This commit is contained in:
commit
e128d2867a
15
.github/workflows/blocking_issues.yml
vendored
15
.github/workflows/blocking_issues.yml
vendored
@ -1,15 +0,0 @@
|
|||||||
name: Blocking Issues
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [closed]
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened, edited]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
blocking_issues:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Checks for blocking issues
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: Levi-Lesches/blocking-issues@v1.1
|
|
@ -2,7 +2,7 @@
|
|||||||
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags=block:schema connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags=block:schema connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||||
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags=block:rampup cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags=block:rampup cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||||
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags='block:main-.*' cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags='block:main-.*' cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||||
min_version: "4.17.30"
|
min_version: "4.17.31"
|
||||||
|
|
||||||
description: |
|
description: |
|
||||||
This workload is analogous to the cql-keyvalue2 workload, just implemented for MongoDB.
|
This workload is analogous to the cql-keyvalue2 workload, just implemented for MongoDB.
|
||||||
@ -52,13 +52,17 @@ blocks:
|
|||||||
key: {
|
key: {
|
||||||
bsonType: "string",
|
bsonType: "string",
|
||||||
description: "'key' must be a string and is required"
|
description: "'key' must be a string and is required"
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
bsonType: "string",
|
||||||
|
description: "'value' must be a string and is optional but, recommended"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
validationLevel: "strict",
|
validationLevel: "strict",
|
||||||
validationAction: "error",
|
validationAction: "error",
|
||||||
comment: "keyvalue collection creation with strict types and required 'key' field."
|
comment: "keyvalue collection creation with strict types and a required 'key' field."
|
||||||
}
|
}
|
||||||
create-key-index: |
|
create-key-index: |
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags=block:schema connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags=block:schema connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||||
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags=block:rampup cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags=block:rampup cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||||
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags='block:main.*' cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags='block:main.*' cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||||
min_version: "4.17.30"
|
min_version: "4.17.31"
|
||||||
|
|
||||||
description: |
|
description: |
|
||||||
This workload is analogous to the cql-tabular2 workload, just implemented for MongoDB.
|
This workload is analogous to the cql-tabular2 workload, just implemented for MongoDB.
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# https://www.mongodb.com/community/forums/t/how-to-store-a-uuid-with-binary-subtype-0x04-using-the-mongodb-java-driver/13184
|
# https://www.mongodb.com/community/forums/t/how-to-store-a-uuid-with-binary-subtype-0x04-using-the-mongodb-java-driver/13184
|
||||||
# https://www.mongodb.com/community/forums/t/problem-inserting-uuid-field-with-binary-subtype-via-atlas-web-ui/1071/4
|
# https://www.mongodb.com/community/forums/t/problem-inserting-uuid-field-with-binary-subtype-via-atlas-web-ui/1071/4
|
||||||
# https://www.mongodb.com/community/forums/t/timeseries-last-x-documents/186574/5
|
# https://www.mongodb.com/community/forums/t/timeseries-last-x-documents/186574/5
|
||||||
min_version: "4.17.30"
|
min_version: "4.17.31"
|
||||||
|
|
||||||
description: |
|
description: |
|
||||||
This workload is analogous to the cql-timeseries2 workload, just implemented for MongoDB.
|
This workload is analogous to the cql-timeseries2 workload, just implemented for MongoDB.
|
||||||
|
@ -63,17 +63,21 @@ The process of loading a workload definition occurs in several discrete steps du
|
|||||||
session:
|
session:
|
||||||
|
|
||||||
1. The workload file is loaded.
|
1. The workload file is loaded.
|
||||||
2. Template variables are interposed.
|
2. Template variables from the activity parameters are interposed into the raw contents of the
|
||||||
|
file.
|
||||||
3. The file is deserialized from its native form into a raw data structure.
|
3. The file is deserialized from its native form into a raw data structure.
|
||||||
4. The raw data structure is transformed into a normalized data structure according to the Op
|
4. The raw data structure is transformed into a normalized data structure according to the Op
|
||||||
Template normalization rules.
|
Template normalization rules.
|
||||||
5. The data is provided to the ParsedOp API for use by the developer.
|
5. Each op template is then denormalized as a self-contained data
|
||||||
6. The DriverAdapter is loaded which understands the op fields provided in the op template.
|
structure, containing all the provided bindings, params, and tags from the upper layers of the
|
||||||
7. The DriverAdapter uses its documented rules to determine which types of native driver operations
|
doc structure.
|
||||||
|
6. The data is provided to the ParsedOp API for use by the developer.
|
||||||
|
7. The DriverAdapter is loaded which understands the op fields provided in the op template.
|
||||||
|
8. The DriverAdapter uses its documented rules to determine which types of native driver operations
|
||||||
each op template is intended to represent. This is called **Op Mapping**.
|
each op template is intended to represent. This is called **Op Mapping**.
|
||||||
8. The DriverAdapter uses the identified types to create dispensers of native driver operations.
|
9. The DriverAdapter (via the selected Op Mapper) uses the identified types to create dispensers of
|
||||||
This is called **Op Dispensing**.
|
native driver operations. This is called **Op Dispensing**.
|
||||||
9. The op dispensers are arranged into an indexed bank of op sources according to the specified
|
10. The op dispensers are arranged into an indexed bank of op sources according to the specified
|
||||||
ratios and or sequencing strategy. From this point on, NoSQLBench has the ability to
|
ratios and or sequencing strategy. From this point on, NoSQLBench has the ability to
|
||||||
construct an operation for any given cycle at high speed.
|
construct an operation for any given cycle at high speed.
|
||||||
|
|
||||||
|
@ -50,22 +50,22 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-server</artifactId>
|
<artifactId>jetty-server</artifactId>
|
||||||
<version>11.0.11</version>
|
<version>11.0.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-servlets</artifactId>
|
<artifactId>jetty-servlets</artifactId>
|
||||||
<version>11.0.11</version>
|
<version>11.0.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-servlet</artifactId>
|
<artifactId>jetty-servlet</artifactId>
|
||||||
<version>11.0.11</version>
|
<version>11.0.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-rewrite</artifactId>
|
<artifactId>jetty-rewrite</artifactId>
|
||||||
<version>11.0.11</version>
|
<version>11.0.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger.core.v3</groupId>
|
<groupId>io.swagger.core.v3</groupId>
|
||||||
<artifactId>swagger-models</artifactId>
|
<artifactId>swagger-models</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>2.2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<mvel2.version>2.4.14.Final</mvel2.version>
|
<mvel2.version>2.4.14.Final</mvel2.version>
|
||||||
<number.to.words.version>1.0.0</number.to.words.version>
|
<number.to.words.version>1.0.0</number.to.words.version>
|
||||||
<!-- <slf4j.version>1.7.29</slf4j.version>-->
|
<!-- <slf4j.version>1.7.29</slf4j.version>-->
|
||||||
<snakeyaml.version>1.32</snakeyaml.version>
|
<snakeyaml.version>1.33</snakeyaml.version>
|
||||||
<snappy.version>1.1.2.6</snappy.version>
|
<snappy.version>1.1.2.6</snappy.version>
|
||||||
|
|
||||||
<!-- plugin versions -->
|
<!-- plugin versions -->
|
||||||
@ -141,7 +141,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.dropwizard.metrics</groupId>
|
<groupId>io.dropwizard.metrics</groupId>
|
||||||
<artifactId>metrics-core</artifactId>
|
<artifactId>metrics-core</artifactId>
|
||||||
<version>4.2.10</version>
|
<version>4.2.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -189,7 +189,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-handler</artifactId>
|
<artifactId>netty-handler</artifactId>
|
||||||
<version>4.1.81.Final</version>
|
<version>4.1.82.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -271,7 +271,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.9.0</version>
|
<version>2.9.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -301,7 +301,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>joda-time</groupId>
|
||||||
<artifactId>joda-time</artifactId>
|
<artifactId>joda-time</artifactId>
|
||||||
<version>2.11.1</version>
|
<version>2.11.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.amazonaws</groupId>
|
<groupId>com.amazonaws</groupId>
|
||||||
<artifactId>aws-java-sdk-s3</artifactId>
|
<artifactId>aws-java-sdk-s3</artifactId>
|
||||||
<version>1.12.325</version>
|
<version>1.12.330</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -18,16 +18,15 @@ activitydef = {
|
|||||||
"alias" : "testhistostatslogger",
|
"alias" : "testhistostatslogger",
|
||||||
"driver" : "diag",
|
"driver" : "diag",
|
||||||
"cycles" : "50000",
|
"cycles" : "50000",
|
||||||
"threads" : "20",
|
"threads" : "5",
|
||||||
"interval" : "2000",
|
"rate" : "100.0",
|
||||||
"targetrate" : "10000.0",
|
|
||||||
"op" : "noop"
|
"op" : "noop"
|
||||||
};
|
};
|
||||||
|
|
||||||
histostatslogger.logHistoStats("testing extention histostatslogger", ".*", "logs/histostats.csv", "0.5s");
|
histostatslogger.logHistoStats("testing extention histostatslogger", ".*", "logs/histostats.csv", "0.5s");
|
||||||
print("started logging to logs/histostats.csv for all metrics at 1/2" +
|
print("started logging to logs/histostats.csv for all metrics at 1/2" +
|
||||||
" second intervals.");
|
" second intervals.");
|
||||||
|
|
||||||
scenario.start(activitydef);
|
scenario.start(activitydef);
|
||||||
scenario.waitMillis(2000);
|
scenario.waitMillis(4000);
|
||||||
scenario.stop(activitydef);
|
scenario.stop(activitydef);
|
||||||
|
|
||||||
|
@ -19,18 +19,18 @@ package io.nosqlbench.cli.testing;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
public class ExitStatusIntegrationTests {
|
class ExitStatusIntegrationTests {
|
||||||
|
|
||||||
private final String java = Optional.ofNullable(System.getenv(
|
private final String java = Optional.ofNullable(System.getenv(
|
||||||
"JAVA_HOME")).map(v -> v + "/bin/java").orElse("java");
|
"JAVA_HOME")).map(v -> v + "/bin/java").orElse("java");
|
||||||
|
|
||||||
private final static String JARNAME = "target/nbr.jar";
|
private final static String JARNAME = "target/nbr.jar";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExitStatusOnBadParam() {
|
void testExitStatusOnBadParam() {
|
||||||
ProcessInvoker invoker = new ProcessInvoker();
|
ProcessInvoker invoker = new ProcessInvoker();
|
||||||
invoker.setLogDir("logs/test");
|
invoker.setLogDir("logs/test");
|
||||||
ProcessResult result = invoker.run("exitstatus_badparam", 15,
|
ProcessResult result = invoker.run("exitstatus_badparam", 15,
|
||||||
@ -38,13 +38,13 @@ public class ExitStatusIntegrationTests {
|
|||||||
"badparam"
|
"badparam"
|
||||||
);
|
);
|
||||||
assertThat(result.exception).isNull();
|
assertThat(result.exception).isNull();
|
||||||
String stderr = result.getStderrData().stream().collect(Collectors.joining("\n"));
|
String stderr = String.join("\n", result.getStderrData());
|
||||||
assertThat(stderr).contains("Scenario stopped due to error");
|
assertThat(stderr).contains("Scenario stopped due to error");
|
||||||
assertThat(result.exitStatus).isEqualTo(2);
|
assertThat(result.exitStatus).isEqualTo(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExitStatusOnActivityInitException() {
|
void testExitStatusOnActivityInitException() {
|
||||||
ProcessInvoker invoker = new ProcessInvoker();
|
ProcessInvoker invoker = new ProcessInvoker();
|
||||||
invoker.setLogDir("logs/test");
|
invoker.setLogDir("logs/test");
|
||||||
ProcessResult result = invoker.run("exitstatus_initexception", 15,
|
ProcessResult result = invoker.run("exitstatus_initexception", 15,
|
||||||
@ -52,7 +52,7 @@ public class ExitStatusIntegrationTests {
|
|||||||
"driver=diag", "op=initdelay:initdelay=notanumber"
|
"driver=diag", "op=initdelay:initdelay=notanumber"
|
||||||
);
|
);
|
||||||
assertThat(result.exception).isNull();
|
assertThat(result.exception).isNull();
|
||||||
String stderr = result.getStdoutData().stream().collect(Collectors.joining("\n"));
|
String stderr = String.join("\n", result.getStdoutData());
|
||||||
assertThat(stderr).contains("For input string: \"notanumber\"");
|
assertThat(stderr).contains("For input string: \"notanumber\"");
|
||||||
assertThat(result.exitStatus).isEqualTo(2);
|
assertThat(result.exitStatus).isEqualTo(2);
|
||||||
}
|
}
|
||||||
@ -73,19 +73,18 @@ public class ExitStatusIntegrationTests {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExitStatusOnActivityOpException() {
|
void testExitStatusOnActivityOpException() {
|
||||||
ProcessInvoker invoker = new ProcessInvoker();
|
ProcessInvoker invoker = new ProcessInvoker();
|
||||||
invoker.setLogDir("logs/test");
|
invoker.setLogDir("logs/test");
|
||||||
ProcessResult result = invoker.run("exitstatus_asyncstoprequest", 30,
|
ProcessResult result = invoker.run("exitstatus_asyncstoprequest", 30,
|
||||||
java, "-jar", JARNAME, "--logs-dir", "logs/test/asyncstop", "run",
|
java, "-jar", JARNAME, "--logs-dir", "logs/test/asyncstop", "run",
|
||||||
"driver=diag", "cyclerate=5", "op=erroroncycle:erroroncycle=10", "cycles=2000", "-vvv"
|
"driver=diag", "cyclerate=1", "op=erroroncycle:erroroncycle=10", "cycles=2000", "-vvv"
|
||||||
);
|
);
|
||||||
assertThat(result.exception).isNull();
|
assertThat(result.exception).isNull();
|
||||||
String stdout = result.getStdoutData().stream().collect(Collectors.joining("\n"));
|
String stdout = String.join("\n", result.getStdoutData());
|
||||||
assertThat(stdout).contains("Diag was requested to stop on cycle 10");
|
assertThat(stdout).contains("Diag was requested to stop on cycle 10");
|
||||||
assertThat(result.exitStatus).isEqualTo(2);
|
assertThat(result.exitStatus).isEqualTo(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022 nosqlbench
|
||||||
|
*
|
||||||
|
* 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.nosqlbench.virtdata.library.basics.shared.from_bytebuffer.to_string;
|
||||||
|
|
||||||
|
import com.amazonaws.util.Base64;
|
||||||
|
import io.nosqlbench.virtdata.api.annotations.Categories;
|
||||||
|
import io.nosqlbench.virtdata.api.annotations.Category;
|
||||||
|
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Takes a bytebuffer and turns it into a base64 string
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ThreadSafeMapper
|
||||||
|
@Categories({Category.general})
|
||||||
|
public class ToBase64 implements Function<ByteBuffer, String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(ByteBuffer input) {
|
||||||
|
ByteBuffer bb = input.asReadOnlyBuffer();
|
||||||
|
bb.position(0);
|
||||||
|
byte[] b = new byte[bb.limit()];
|
||||||
|
bb.get(b, 0, b.length);
|
||||||
|
return Base64.encodeAsString(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user