Merge branch 'nosqlbench:main' into main

This commit is contained in:
yabinmeng 2022-11-17 10:27:28 -06:00 committed by GitHub
commit e128d2867a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 91 additions and 55 deletions

View File

@ -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

View File

@ -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: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
min_version: "4.17.30"
min_version: "4.17.31"
description: |
This workload is analogous to the cql-keyvalue2 workload, just implemented for MongoDB.
@ -52,13 +52,17 @@ blocks:
key: {
bsonType: "string",
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",
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: |
{

View File

@ -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: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
min_version: "4.17.30"
min_version: "4.17.31"
description: |
This workload is analogous to the cql-tabular2 workload, just implemented for MongoDB.

View File

@ -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/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
min_version: "4.17.30"
min_version: "4.17.31"
description: |
This workload is analogous to the cql-timeseries2 workload, just implemented for MongoDB.

View File

@ -63,17 +63,21 @@ The process of loading a workload definition occurs in several discrete steps du
session:
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.
4. The raw data structure is transformed into a normalized data structure according to the Op
Template normalization rules.
5. The data is provided to the ParsedOp API for use by the developer.
6. The DriverAdapter is loaded which understands the op fields provided in the op template.
7. The DriverAdapter uses its documented rules to determine which types of native driver operations
5. Each op template is then denormalized as a self-contained data
structure, containing all the provided bindings, params, and tags from the upper layers of the
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**.
8. The DriverAdapter uses the identified types to create dispensers of 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
9. The DriverAdapter (via the selected Op Mapper) uses the identified types to create dispensers of
native driver operations. This is called **Op Dispensing**.
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
construct an operation for any given cycle at high speed.

View File

@ -50,22 +50,22 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>11.0.11</version>
<version>11.0.12</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>11.0.11</version>
<version>11.0.12</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>11.0.11</version>
<version>11.0.12</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>11.0.11</version>
<version>11.0.12</version>
</dependency>
<dependency>

View File

@ -29,7 +29,7 @@
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>
</dependency>
<dependency>

View File

@ -46,7 +46,7 @@
<mvel2.version>2.4.14.Final</mvel2.version>
<number.to.words.version>1.0.0</number.to.words.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>
<!-- plugin versions -->
@ -141,7 +141,7 @@
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>4.2.10</version>
<version>4.2.12</version>
</dependency>
<dependency>
@ -189,7 +189,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.81.Final</version>
<version>4.1.82.Final</version>
</dependency>
<dependency>
@ -271,7 +271,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
<version>2.9.1</version>
</dependency>
<dependency>
@ -301,7 +301,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.11.1</version>
<version>2.11.2</version>
</dependency>
<dependency>

View File

@ -97,7 +97,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.12.325</version>
<version>1.12.330</version>
</dependency>
<dependency>

View File

@ -18,16 +18,15 @@ activitydef = {
"alias" : "testhistostatslogger",
"driver" : "diag",
"cycles" : "50000",
"threads" : "20",
"interval" : "2000",
"targetrate" : "10000.0",
"threads" : "5",
"rate" : "100.0",
"op" : "noop"
};
histostatslogger.logHistoStats("testing extention histostatslogger", ".*", "logs/histostats.csv", "0.5s");
print("started logging to logs/histostats.csv for all metrics at 1/2" +
" second intervals.");
scenario.start(activitydef);
scenario.waitMillis(2000);
scenario.waitMillis(4000);
scenario.stop(activitydef);

View File

@ -19,18 +19,18 @@ package io.nosqlbench.cli.testing;
import org.junit.jupiter.api.Test;
import java.util.Optional;
import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;
public class ExitStatusIntegrationTests {
class ExitStatusIntegrationTests {
private final String java = Optional.ofNullable(System.getenv(
"JAVA_HOME")).map(v -> v + "/bin/java").orElse("java");
private final static String JARNAME = "target/nbr.jar";
@Test
public void testExitStatusOnBadParam() {
void testExitStatusOnBadParam() {
ProcessInvoker invoker = new ProcessInvoker();
invoker.setLogDir("logs/test");
ProcessResult result = invoker.run("exitstatus_badparam", 15,
@ -38,13 +38,13 @@ public class ExitStatusIntegrationTests {
"badparam"
);
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(result.exitStatus).isEqualTo(2);
}
@Test
public void testExitStatusOnActivityInitException() {
void testExitStatusOnActivityInitException() {
ProcessInvoker invoker = new ProcessInvoker();
invoker.setLogDir("logs/test");
ProcessResult result = invoker.run("exitstatus_initexception", 15,
@ -52,7 +52,7 @@ public class ExitStatusIntegrationTests {
"driver=diag", "op=initdelay:initdelay=notanumber"
);
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(result.exitStatus).isEqualTo(2);
}
@ -73,19 +73,18 @@ public class ExitStatusIntegrationTests {
// }
@Test
public void testExitStatusOnActivityOpException() {
void testExitStatusOnActivityOpException() {
ProcessInvoker invoker = new ProcessInvoker();
invoker.setLogDir("logs/test");
ProcessResult result = invoker.run("exitstatus_asyncstoprequest", 30,
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();
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(result.exitStatus).isEqualTo(2);
}
}

View File

@ -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);
}
}