mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
use local logger at debug level for any test output
This commit is contained in:
parent
f8f7ca052c
commit
fd8e871da5
@ -100,7 +100,7 @@
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.10.1</version>
|
||||
<version>4.11.1</version>
|
||||
<configuration>
|
||||
<sourceDirectory>src/main/java/io/nosqlbench/cqlgen/grammars
|
||||
</sourceDirectory>
|
||||
|
@ -28,7 +28,7 @@ import io.nosqlbench.cqlgen.parser.CqlModelParser;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
/**
|
||||
* map<A,B>
|
||||
* map<A,B>
|
||||
* where:
|
||||
* A := (f1 text, f2 text, f3 int)
|
||||
* AND
|
||||
|
@ -19,11 +19,14 @@ package io.nosqlbench.activitytype.http.statuscodes;
|
||||
import io.nosqlbench.adapter.http.statuscodes.HttpStatusCodes;
|
||||
import io.nosqlbench.adapter.http.statuscodes.HttpStatusRanges;
|
||||
import io.nosqlbench.adapter.http.statuscodes.IetfStatusCode;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class HttpStatusCodesTest {
|
||||
private final static Logger logger = LogManager.getLogger(HttpStatusCodesTest.class);
|
||||
|
||||
@Test
|
||||
public void testLookup() {
|
||||
@ -32,7 +35,7 @@ public class HttpStatusCodesTest {
|
||||
assertThat(result.getReference()).isEqualTo("[RFC7231, Section 6.5.4]");
|
||||
assertThat(result.getValues()).isEqualTo("404");
|
||||
assertThat(result.getDescription()).isEqualTo("Not Found");
|
||||
System.out.println(result.toString(404));
|
||||
logger.debug(result.toString(404));
|
||||
assertThat(result.toString(404)).isEqualTo("404, Not Found, [https://www.iana.org/go/rfc7231#section-6.5.4], CLIENT_ERROR (The request contains bad syntax or cannot be fulfilled.)");
|
||||
}
|
||||
|
||||
@ -43,7 +46,7 @@ public class HttpStatusCodesTest {
|
||||
assertThat(result.getReference()).isEqualTo("[check https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml]");
|
||||
assertThat(result.getValues()).isEqualTo("496");
|
||||
assertThat(result.getDescription()).isNullOrEmpty();
|
||||
System.out.println(result.toString(496));
|
||||
logger.debug(result.toString(496));
|
||||
assertThat(result.toString(496)).isEqualTo("496, [check https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml], CLIENT_ERROR (The request contains bad syntax or cannot be fulfilled.)");
|
||||
}
|
||||
|
||||
@ -54,7 +57,7 @@ public class HttpStatusCodesTest {
|
||||
assertThat(result.getReference()).isEqualTo("[check https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml]");
|
||||
assertThat(result.getValues()).isEqualTo("747");
|
||||
assertThat(result.getDescription()).isNullOrEmpty();
|
||||
System.out.println(result.toString(747));
|
||||
logger.debug(result.toString(747));
|
||||
assertThat(result.toString(747)).isEqualTo("747, [check https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml], UNKNOWN_ERROR (This error type is not known based on IANA registered HTTP status codes.)");
|
||||
|
||||
}
|
||||
|
@ -18,12 +18,14 @@ package io.nosqlbench.adapter.http;
|
||||
|
||||
import io.nosqlbench.adapter.http.core.HttpOpMapper;
|
||||
import io.nosqlbench.adapter.http.core.HttpSpace;
|
||||
import io.nosqlbench.api.config.standard.NBConfiguration;
|
||||
import io.nosqlbench.engine.api.activityconfig.StatementsLoader;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
||||
import io.nosqlbench.engine.api.activityimpl.uniform.DriverSpaceCache;
|
||||
import io.nosqlbench.engine.api.templating.ParsedOp;
|
||||
import io.nosqlbench.api.config.standard.NBConfiguration;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -34,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class HttpOpMapperTest {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(HttpOpMapperTest.class);
|
||||
static NBConfiguration cfg;
|
||||
static HttpDriverAdapter adapter;
|
||||
static HttpOpMapper mapper;
|
||||
@ -132,7 +135,7 @@ public class HttpOpMapperTest {
|
||||
body: StaticStringMapper('test')
|
||||
""");
|
||||
|
||||
System.out.println(pop);
|
||||
logger.debug(pop);
|
||||
assertThat(pop.getDefinedNames()).containsAll(List.of(
|
||||
"method","uri","version","Header1","body"
|
||||
));
|
||||
|
@ -17,6 +17,8 @@
|
||||
package io.nosqlbench.engine.api.util;
|
||||
|
||||
import io.nosqlbench.api.engine.util.Tagged;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
@ -26,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TagFilterTest {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(TagFilterTest.class);
|
||||
@Test
|
||||
public void testTagFilterNameOnly() {
|
||||
TagFilter tf = new TagFilter("name");
|
||||
@ -123,7 +126,7 @@ public class TagFilterTest {
|
||||
TagFilter tfLeft = new TagFilter("one:'four-.*' five two seven six=again ");
|
||||
TagFilter.Result result = tfLeft.matchesTaggedResult(tagged);
|
||||
assertThat(result.matched()).isFalse();
|
||||
System.out.println(result.getLog());
|
||||
logger.debug(result.getLog());
|
||||
assertThat(result.getLog()).contains("(☑,☐) filter(one:'four-.*' five two seven six=again) tag(one:four-five-six): did not match '^'four-.*' five two seven six=again$'");
|
||||
|
||||
}
|
||||
|
@ -334,7 +334,7 @@
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-runtime</artifactId>
|
||||
<version>4.10.1</version>
|
||||
<version>4.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -496,6 +496,7 @@
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M6</version>
|
||||
<configuration>
|
||||
<parallel>methods</parallel>
|
||||
<excludes>
|
||||
<exclude>**/*Integrated*Test*.java</exclude>
|
||||
<exclude>**/*IntegrationTest.java</exclude>
|
||||
@ -703,7 +704,7 @@
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.10.1</version>
|
||||
<version>4.11.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
@ -18,6 +18,8 @@ package io.nosqlbench.nb.api.config.standard;
|
||||
|
||||
import io.nosqlbench.api.config.standard.NBTypeConverter;
|
||||
import org.apache.commons.lang3.ClassUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -25,6 +27,7 @@ import java.math.BigDecimal;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class NBTypeConverterTest {
|
||||
public final static Logger logger = LogManager.getLogger(NBTypeConverterTest.class);
|
||||
|
||||
@Test
|
||||
public void testBasicConversion() {
|
||||
@ -37,17 +40,16 @@ public class NBTypeConverterTest {
|
||||
for (Class<?> inc : NBTypeConverter.CORE_TYPES) {
|
||||
for (Class<?> outc : NBTypeConverter.CORE_TYPES) {
|
||||
Object in = genElement(inc);
|
||||
System.out.print("inc:" + inc.getSimpleName() + ", outc:" + outc.getSimpleName() +", in:" + in + " --> ");
|
||||
logger.debug(() -> "inc:" + inc.getSimpleName() + ", outc:" + outc.getSimpleName() +", in:" + in + " --> ");
|
||||
assertThat(NBTypeConverter.canConvert(in,outc)).as("Should be able to convert core types from " + inc.getSimpleName() + " to " + outc);
|
||||
|
||||
Object out = NBTypeConverter.convert(in, outc);
|
||||
System.out.println("out:" + out +", type:" + out.getClass().getSimpleName());
|
||||
logger.debug(() -> "out:" + out +", type:" + out.getClass().getSimpleName());
|
||||
assertThat(ClassUtils.isAssignable(out.getClass(),outc,true))
|
||||
.as(outc.getSimpleName() + " should be assignable from "+ out.getClass().getSimpleName())
|
||||
.isTrue();
|
||||
}
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -20,6 +20,8 @@ import io.nosqlbench.api.content.Content;
|
||||
import io.nosqlbench.api.content.NBIO;
|
||||
import io.nosqlbench.api.content.NBIORelativizer;
|
||||
import io.nosqlbench.api.content.NBPathsAPI;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
@ -36,6 +38,7 @@ import java.util.stream.Collectors;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class NBIOTest {
|
||||
private final static Logger logger = LogManager.getLogger(NBIOTest.class);
|
||||
|
||||
@Test
|
||||
public void testFullyQualifiedNameSearches() {
|
||||
@ -212,15 +215,15 @@ public class NBIOTest {
|
||||
List<Content<?>> list = null;
|
||||
|
||||
list = NBIO.classpath().prefix("./").list();
|
||||
System.out.println("found " + list.size() + " entries for path '.'");
|
||||
logger.debug("found " + list.size() + " entries for path '.'");
|
||||
assertThat(list).hasSizeGreaterThan(0);
|
||||
|
||||
list = NBIO.fs().prefix("./").list();
|
||||
System.out.println("found " + list.size() + " entries for path '.'");
|
||||
logger.debug("found " + list.size() + " entries for path '.'");
|
||||
assertThat(list).hasSizeGreaterThan(0);
|
||||
|
||||
list = NBIO.remote().prefix("./").list();
|
||||
System.out.println("found " + list.size() + " entries for path '.'");
|
||||
logger.debug("found " + list.size() + " entries for path '.'");
|
||||
assertThat(list).hasSize(0);
|
||||
}
|
||||
|
||||
|
@ -18,11 +18,14 @@ package io.nosqlbench.nb.api.testutils;
|
||||
|
||||
import io.nosqlbench.api.testutils.Perf;
|
||||
import io.nosqlbench.api.testutils.Result;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class PerfTest {
|
||||
private final static Logger logger = LogManager.getLogger(PerfTest.class);
|
||||
|
||||
@Test
|
||||
public void testBasics() {
|
||||
@ -35,7 +38,7 @@ public class PerfTest {
|
||||
assertThat(p.isConverged(Result::getOpsPerSec,0.2d, 3)).isFalse();
|
||||
p.add("3",0,100,1431);
|
||||
double[] deltas = p.getDeltas(Result::getOpsPerSec);
|
||||
System.out.println("Sanity Check for Perf methods:\n"+p.toStringDelta(Result::getOpsPerSec, "D_ops_s"));
|
||||
logger.debug("Sanity Check for Perf methods:\n"+p.toStringDelta(Result::getOpsPerSec, "D_ops_s"));
|
||||
assertThat(p.isConverged(Result::getOpsPerSec,0.2d, 3)).isFalse();
|
||||
p.add("4",0,100,1441);
|
||||
assertThat(p.isConverged(Result::getOpsPerSec,0.2d, 3)).isTrue();
|
||||
|
@ -65,6 +65,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<parallel>methods</parallel>
|
||||
<!-- <additionalClasspathElements>-->
|
||||
<!-- <additionalClasspathElement>${project.basedir}/target/virtdata-userlibs-${project.version}.jar-->
|
||||
<!-- </additionalClasspathElement>-->
|
||||
|
@ -17,14 +17,16 @@
|
||||
package io.nosqlbench.nbr.examples;
|
||||
|
||||
import io.nosqlbench.engine.core.lifecycle.ExecutionMetricsResult;
|
||||
import io.nosqlbench.engine.core.lifecycle.scenario.ScenariosResults;
|
||||
import io.nosqlbench.engine.core.lifecycle.scenario.Scenario;
|
||||
import io.nosqlbench.engine.core.lifecycle.scenario.ScenariosExecutor;
|
||||
import io.nosqlbench.engine.core.lifecycle.scenario.ScenariosResults;
|
||||
import io.nosqlbench.nb.annotations.Maturity;
|
||||
import org.apache.commons.compress.utils.IOUtils;
|
||||
import org.assertj.core.data.Offset;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.parallel.Execution;
|
||||
import org.junit.jupiter.api.parallel.ExecutionMode;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -39,6 +41,7 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@Execution(ExecutionMode.CONCURRENT)
|
||||
public class ScriptExampleTests {
|
||||
|
||||
public static ExecutionMetricsResult runScenario(String scriptname, String... params) {
|
||||
@ -111,7 +114,7 @@ public class ScriptExampleTests {
|
||||
String digits = m.group(1);
|
||||
assertThat(digits).isNotEmpty();
|
||||
double rate = Double.parseDouble(digits);
|
||||
assertThat(rate).isCloseTo(1000, Offset.offset(100.0));
|
||||
assertThat(rate).isCloseTo(500, Offset.offset(100.0));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
18
nbr-examples/src/test/resources/junit-platform.properties
Normal file
18
nbr-examples/src/test/resources/junit-platform.properties
Normal file
@ -0,0 +1,18 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
junit.jupiter.execution.parallel.enabled = true
|
||||
junit.jupiter.execution.parallel.config.fixed.parallelism = 4
|
@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
co_cycle_delay = {
|
||||
"alias": "co_cycle_delay",
|
||||
co_cycle_delay_bursty = {
|
||||
"alias": "co_cycle_delay_bursty",
|
||||
"driver": "diag",
|
||||
"cycles": "0..1000000",
|
||||
"threads": "10",
|
||||
@ -23,41 +23,41 @@ co_cycle_delay = {
|
||||
"op" : '{"log":{"level":"info","modulo":1000},"diagrate":{"diagrate":"500"}}'
|
||||
};
|
||||
|
||||
print('starting activity co_cycle_delay');
|
||||
scenario.start(co_cycle_delay);
|
||||
print('starting activity co_cycle_delay_bursty');
|
||||
scenario.start(co_cycle_delay_bursty);
|
||||
for (i = 0; i < 5; i++) {
|
||||
scenario.waitMillis(1000);
|
||||
if (!scenario.isRunningActivity('co_cycle_delay')) {
|
||||
if (!scenario.isRunningActivity('co_cycle_delay_bursty')) {
|
||||
print("scenario exited prematurely, aborting.");
|
||||
break;
|
||||
}
|
||||
print("backlogging, cycles=" + metrics.co_cycle_delay.cycles.servicetime.count +
|
||||
" waittime=" + metrics.co_cycle_delay.cycles.waittime.value +
|
||||
" diagrate=" + activities.co_cycle_delay.diagrate +
|
||||
" cyclerate=" + activities.co_cycle_delay.cyclerate
|
||||
print("backlogging, cycles=" + metrics.co_cycle_delay_bursty.cycles.servicetime.count +
|
||||
" waittime=" + metrics.co_cycle_delay_bursty.cycles.waittime.value +
|
||||
" diagrate=" + activities.co_cycle_delay_bursty.diagrate +
|
||||
" cyclerate=" + activities.co_cycle_delay_bursty.cyclerate
|
||||
);
|
||||
}
|
||||
print('step1 metrics.waittime=' + metrics.co_cycle_delay.cycles.waittime.value);
|
||||
activities.co_cycle_delay.diagrate = "10000";
|
||||
print('step1 metrics.waittime=' + metrics.co_cycle_delay_bursty.cycles.waittime.value);
|
||||
activities.co_cycle_delay_bursty.diagrate = "10000";
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (!scenario.isRunningActivity('co_cycle_delay')) {
|
||||
if (!scenario.isRunningActivity('co_cycle_delay_bursty')) {
|
||||
print("scenario exited prematurely, aborting.");
|
||||
break;
|
||||
}
|
||||
print("recovering, cycles=" + metrics.co_cycle_delay.cycles.servicetime.count +
|
||||
" waittime=" + metrics.co_cycle_delay.cycles.waittime.value +
|
||||
" diagrate=" + activities.co_cycle_delay.diagrate +
|
||||
" cyclerate=" + activities.co_cycle_delay.cyclerate
|
||||
print("recovering, cycles=" + metrics.co_cycle_delay_bursty.cycles.servicetime.count +
|
||||
" waittime=" + metrics.co_cycle_delay_bursty.cycles.waittime.value +
|
||||
" diagrate=" + activities.co_cycle_delay_bursty.diagrate +
|
||||
" cyclerate=" + activities.co_cycle_delay_bursty.cyclerate
|
||||
);
|
||||
|
||||
scenario.waitMillis(1000);
|
||||
if (metrics.co_cycle_delay.cycles.waittime.value < 50000000) {
|
||||
if (metrics.co_cycle_delay_bursty.cycles.waittime.value < 50000000) {
|
||||
print("waittime trended back down as expected, exiting on iteration " + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//scenario.awaitActivity("co_cycle_delay");
|
||||
print('step2 metrics.waittime=' + metrics.co_cycle_delay.cycles.waittime.value);
|
||||
scenario.stop(co_cycle_delay);
|
||||
print("stopped activity co_cycle_delay");
|
||||
print('step2 metrics.waittime=' + metrics.co_cycle_delay_bursty.cycles.waittime.value);
|
||||
scenario.stop(co_cycle_delay_bursty);
|
||||
print("stopped activity co_cycle_delay_bursty");
|
||||
|
@ -18,9 +18,9 @@
|
||||
activitydef = {
|
||||
"alias" : "cycle_rate",
|
||||
"driver" : "diag",
|
||||
"cycles" : "5K",
|
||||
"cycles" : "2500",
|
||||
"threads" : "10",
|
||||
"cyclerate" : "1K",
|
||||
"cyclerate" : "500",
|
||||
"op" : "noop"
|
||||
};
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
activitydef = {
|
||||
"alias" : "testhistologger",
|
||||
"driver" : "diag",
|
||||
"cycles" : "50000",
|
||||
"cycles" : "1000",
|
||||
"threads" : "20",
|
||||
"interval" : "2000",
|
||||
"targetrate" : "10000.0",
|
||||
"targetrate" : "100.0",
|
||||
"op" : "noop"
|
||||
};
|
||||
|
||||
@ -28,5 +28,5 @@ histologger.logHistoIntervals("testing extention histologger", ".*", "hdrhistoda
|
||||
print("started logging to hdrhistodata.log for all metrics at 1/2 second intervals.");
|
||||
|
||||
scenario.start(activitydef);
|
||||
scenario.waitMillis(2000);
|
||||
scenario.waitMillis(3000);
|
||||
scenario.stop(activitydef);
|
||||
|
@ -17,8 +17,10 @@
|
||||
package io.nosqlbench.virtdata.core.composers;
|
||||
|
||||
import io.nosqlbench.virtdata.core.bindings.DataMapper;
|
||||
import io.nosqlbench.virtdata.core.bindings.FunctionType;
|
||||
import io.nosqlbench.virtdata.core.bindings.DataMapperFunctionMapper;
|
||||
import io.nosqlbench.virtdata.core.bindings.FunctionType;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -27,6 +29,7 @@ import java.util.List;
|
||||
import java.util.function.*;
|
||||
|
||||
public class FunctionAssemblerMatrixTest {
|
||||
private final static Logger logger = LogManager.getLogger(FunctionAssemblerMatrixTest.class);
|
||||
|
||||
@Test
|
||||
public void testFullPrimitiveMatrix() {
|
||||
@ -59,7 +62,7 @@ public class FunctionAssemblerMatrixTest {
|
||||
double pctDone = 100.0 * ((double) iteration / totalIterations);
|
||||
|
||||
String testingSignature = "testing: f1:" + f1 + ", f2:" + f2;
|
||||
System.out.format("%3d/%3d %s",iteration,totalIterations, testingSignature);
|
||||
logger.debug(String.format("%3d/%3d %s",iteration,totalIterations, testingSignature));
|
||||
FunctionComposer assy = new FunctionAssembly();
|
||||
|
||||
assy = assy.andThen(f1);
|
||||
@ -67,7 +70,7 @@ public class FunctionAssemblerMatrixTest {
|
||||
|
||||
DataMapper g = DataMapperFunctionMapper.map(assy.getResolvedFunction().getFunctionObject());
|
||||
Object o = g.get(1L);
|
||||
System.out.println(" out:" + o);
|
||||
logger.debug(" out:" + o);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.10.1</version>
|
||||
<version>4.11.1</version>
|
||||
<configuration>
|
||||
<sourceDirectory>src/main/java/io/nosqlbench/virtdata/lang/grammars</sourceDirectory>
|
||||
<arguments>
|
||||
|
@ -22,6 +22,8 @@ import io.nosqlbench.virtdata.lang.generated.VirtDataParser;
|
||||
import org.antlr.v4.runtime.CharStreams;
|
||||
import org.antlr.v4.runtime.CodePointCharStream;
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@ -37,6 +39,7 @@ import java.util.List;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class VirtdataBuilderTest {
|
||||
private final static Logger logger = LogManager.getLogger(VirtdataBuilderTest.class);
|
||||
|
||||
private static char[] readFile(String filename) {
|
||||
BufferedReader sr = new BufferedReader(
|
||||
@ -62,7 +65,7 @@ public class VirtdataBuilderTest {
|
||||
char[] chars = readFile("test-syntax.virtdata");
|
||||
CodePointCharStream ais = CharStreams.fromString(new String(chars));
|
||||
String inputString = new String(chars);
|
||||
System.out.println("Parsing:\n" + inputString);
|
||||
logger.debug("Parsing:\n" + inputString);
|
||||
VirtDataLexer lexer = new VirtDataLexer(ais);
|
||||
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
||||
VirtDataParser parser = new VirtDataParser(tokens);
|
||||
@ -70,10 +73,10 @@ public class VirtdataBuilderTest {
|
||||
parser.addParseListener(astListener);
|
||||
|
||||
VirtDataParser.VirtdataRecipeContext virtdataRecipeContext = parser.virtdataRecipe();
|
||||
System.out.println(virtdataRecipeContext.toStringTree(parser));
|
||||
logger.debug(virtdataRecipeContext.toStringTree(parser));
|
||||
|
||||
if (astListener.hasErrors()) {
|
||||
System.out.println(astListener.getErrorNodes());
|
||||
logger.debug(astListener.getErrorNodes());
|
||||
}
|
||||
|
||||
VirtDataAST ast = astListener.getModel();
|
||||
|
@ -16,10 +16,13 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.core.stathelpers;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class DiscreteProbabilityBufferTest {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(DiscreteProbabilityBufferTest.class);
|
||||
@Test
|
||||
public void testReplay() {
|
||||
DiscreteProbabilityBuffer dp = new DiscreteProbabilityBuffer(10);
|
||||
@ -36,9 +39,9 @@ public class DiscreteProbabilityBufferTest {
|
||||
dp.normalize();
|
||||
|
||||
for (DiscreteProbabilityBuffer.Entry entry : dp) {
|
||||
System.out.println("entry: " + entry.getEventId() + ":" + entry.getProbability());
|
||||
logger.debug("entry: " + entry.getEventId() + ":" + entry.getProbability());
|
||||
}
|
||||
System.out.println("cumuProb:" + dp.getCumulativeProbability());
|
||||
logger.debug("cumuProb:" + dp.getCumulativeProbability());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,12 +16,15 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.shared.basicsmappers;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.assertj.core.data.Offset;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ExprTest {
|
||||
private final static Logger logger = LogManager.getLogger(ExprTest.class);
|
||||
|
||||
@Test
|
||||
public void testLongUnaryExpr() {
|
||||
@ -66,15 +69,13 @@ public class ExprTest {
|
||||
int max=1000000;
|
||||
for (int i = min; i < max; i++) {
|
||||
long l = mod5.applyAsLong(i);
|
||||
//System.out.format("input=%d output=%d\n", i, l);
|
||||
//assertThat(l).isEqualTo((i%5));
|
||||
|
||||
}
|
||||
long end = System.nanoTime();
|
||||
long duration = end-start;
|
||||
double nsperop = (double) duration / (double) (max-min);
|
||||
|
||||
System.out.format("(ops/time)=(%d/%dns) rate=%.3f\n", (max-min), duration, ((double) max-min)*1000000000.0/duration);
|
||||
logger.debug(String.format("(ops/time)=(%d/%dns) rate=%.3f\n", (max-min), duration, ((double) max-min)*1000000000.0/duration));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.shared.distributions;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.assertj.core.data.Percentage;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -38,6 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* } </pre>
|
||||
*/
|
||||
public class CSVSamplerTest {
|
||||
private final static Logger logger = LogManager.getLogger(CSVSamplerTest.class);
|
||||
|
||||
|
||||
/**
|
||||
@ -53,7 +56,7 @@ public class CSVSamplerTest {
|
||||
String name = sampler.apply(i);
|
||||
results.compute(name, (k,v) -> v==null ? 1d : v + 1d);
|
||||
}
|
||||
System.out.println(results);
|
||||
logger.debug(results);
|
||||
assertThat(results.get("alpha")).isCloseTo(results.get("beta")*2, Percentage.withPercentage(5.0d));
|
||||
assertThat(results.get("alpha")).isCloseTo(results.get("gamma")*2, Percentage.withPercentage(5.0d));
|
||||
assertThat(results.get("alpha")).isCloseTo(results.get("delta")*2, Percentage.withPercentage(5.0d));
|
||||
@ -73,7 +76,7 @@ public class CSVSamplerTest {
|
||||
String name = sampler.apply(i);
|
||||
results.compute(name, (k,v) -> v==null ? 1d : v + 1d);
|
||||
}
|
||||
System.out.println(results);
|
||||
logger.debug(results);
|
||||
assertThat(results.get("alpha")).isCloseTo(33333, Percentage.withPercentage(2.0d));
|
||||
}
|
||||
|
||||
@ -90,7 +93,7 @@ public class CSVSamplerTest {
|
||||
String name = sampler.apply(i);
|
||||
results.compute(name, (k,v) -> v==null ? 1d : v + 1d);
|
||||
}
|
||||
System.out.println(results);
|
||||
logger.debug(results);
|
||||
assertThat(results.get("alpha")).isCloseTo(20000, Percentage.withPercentage(2.0d));
|
||||
}
|
||||
|
||||
@ -107,7 +110,7 @@ public class CSVSamplerTest {
|
||||
String name = sampler.apply(i);
|
||||
results.compute(name, (k,v) -> v==null ? 1d : v + 1d);
|
||||
}
|
||||
System.out.println(results);
|
||||
logger.debug(results);
|
||||
assertThat(results.get("alpha")).isCloseTo(6666, Percentage.withPercentage(2.0d));
|
||||
}
|
||||
|
||||
@ -124,7 +127,7 @@ public class CSVSamplerTest {
|
||||
String name = sampler.apply(i);
|
||||
results.compute(name, (k,v) -> v==null ? 1d : v + 1d);
|
||||
}
|
||||
System.out.println(results);
|
||||
logger.debug(results);
|
||||
assertThat(results.get("alpha")).isCloseTo(30000, Percentage.withPercentage(2.0d));
|
||||
}
|
||||
|
||||
@ -141,7 +144,7 @@ public class CSVSamplerTest {
|
||||
String name = sampler.apply(i);
|
||||
results.compute(name, (k,v) -> v==null ? 1d : v + 1d);
|
||||
}
|
||||
System.out.println(results);
|
||||
logger.debug(results);
|
||||
assertThat(results.get("alpha")).isCloseTo(20000, Percentage.withPercentage(2.0d));
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_double.to_bigdecimal;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.assertj.core.data.Offset;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -25,11 +27,12 @@ import java.math.MathContext;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ToBigDecimalTest {
|
||||
private final static Logger logger = LogManager.getLogger(ToBigDecimalTest.class);
|
||||
|
||||
@Test
|
||||
public void demonstrateDoubleToBigDecimal() {
|
||||
double big = 1234567890.098765d;
|
||||
System.out.println(big);
|
||||
logger.debug(big);
|
||||
|
||||
ToBigDecimal unlimited = new ToBigDecimal();
|
||||
BigDecimal bignum = unlimited.apply(big);
|
||||
@ -39,7 +42,7 @@ public class ToBigDecimalTest {
|
||||
ToBigDecimal p5rounded = new ToBigDecimal("precision=5 roundingMode=UP");
|
||||
BigDecimal rounded = p5rounded.apply(big);
|
||||
assertThat(rounded.doubleValue()).isCloseTo(1234600000.0D,Offset.offset(0.0000001d));
|
||||
System.out.println(rounded);
|
||||
logger.debug(rounded);
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,8 @@ package io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer;
|
||||
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_charbuffer.CharBufferExtract;
|
||||
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_string.HashedLoremExtractToString;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@ -26,13 +28,14 @@ import java.nio.CharBuffer;
|
||||
import java.util.function.LongToIntFunction;
|
||||
|
||||
public class HashedByteBufferExtractTest {
|
||||
private final static Logger logger = LogManager.getLogger(HashedByteBufferExtractTest.class);
|
||||
|
||||
@Test
|
||||
public void read1MBBytesDefault() {
|
||||
HashedByteBufferExtract bbe = new HashedByteBufferExtract(1024*1024,(LongToIntFunction) l -> 10);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
ByteBuffer a0 = bbe.apply(i);
|
||||
System.out.println(Hex.encodeHex(a0));
|
||||
logger.debug(Hex.encodeHex(a0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +44,7 @@ public class HashedByteBufferExtractTest {
|
||||
HashedByteBufferExtract bbe = new HashedByteBufferExtract(new ByteBufferSizedHashed(1024*1024),(LongToIntFunction) l -> 10);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
ByteBuffer a0 = bbe.apply(i);
|
||||
System.out.println(Hex.encodeHex(a0));
|
||||
logger.debug(Hex.encodeHex(a0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +53,7 @@ public class HashedByteBufferExtractTest {
|
||||
CharBufferExtract bbe = new CharBufferExtract(1024*1024,(LongToIntFunction) l -> 10);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
CharBuffer a0 = bbe.apply(i);
|
||||
System.out.println(a0.toString());
|
||||
logger.debug(a0.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +62,7 @@ public class HashedByteBufferExtractTest {
|
||||
CharBufferExtract bbe = new CharBufferExtract(new HashedLoremExtractToString(1000,1000),(LongToIntFunction) l -> 10);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
CharBuffer a0 = bbe.apply(i);
|
||||
System.out.println(a0.toString());
|
||||
logger.debug(a0.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,8 @@
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_collection;
|
||||
|
||||
|
||||
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_string.NumberNameToString;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
@ -27,6 +28,7 @@ import java.util.function.LongToIntFunction;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ListSizedHashedTest {
|
||||
private final static Logger logger = LogManager.getLogger(ListSizedHashedTest.class);
|
||||
|
||||
@Test
|
||||
public void testTwoPartExample() {
|
||||
@ -38,7 +40,7 @@ public class ListSizedHashedTest {
|
||||
assertThat(for37).hasSize(37);
|
||||
assertThat(for37.get(0)).isNotEqualTo(for37.get(36));
|
||||
for (Object o : for37) {
|
||||
System.out.println(o);
|
||||
logger.debug(o);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_long;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.assertj.core.data.Percentage;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -25,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class HashRangeScaledTest {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(HashRangeScaledTest.class);
|
||||
@Test
|
||||
public void testRanging() {
|
||||
HashRangeScaled hrs = new HashRangeScaled();
|
||||
@ -44,7 +47,7 @@ public class HashRangeScaledTest {
|
||||
for (long i = 0; i < top; i++) {
|
||||
lss.accept(hrs.applyAsLong(i));
|
||||
}
|
||||
System.out.println(lss);
|
||||
logger.debug(lss);
|
||||
assertThat(lss.getAverage()).isCloseTo(top / 4d, Percentage.withPercentage(1d));
|
||||
}
|
||||
|
||||
@ -58,7 +61,7 @@ public class HashRangeScaledTest {
|
||||
for (long i = 0; i < top; i++) {
|
||||
lss.accept(hrs.applyAsLong(i));
|
||||
}
|
||||
System.out.println(lss);
|
||||
logger.debug(lss);
|
||||
assertThat(lss.getAverage()).isCloseTo(top / 8d, Percentage.withPercentage(1d));
|
||||
}
|
||||
|
||||
@ -72,7 +75,7 @@ public class HashRangeScaledTest {
|
||||
for (long i = 0; i < top; i++) {
|
||||
lss.accept(hrs.applyAsLong(i));
|
||||
}
|
||||
System.out.println(lss);
|
||||
logger.debug(lss);
|
||||
assertThat(lss.getAverage()).isCloseTo(top / 2d, Percentage.withPercentage(1d));
|
||||
}
|
||||
|
||||
|
@ -17,12 +17,15 @@
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_long;
|
||||
|
||||
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.assertj.core.data.Offset;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class InterpolateTest {
|
||||
private final static Logger logger = LogManager.getLogger(InterpolateTest.class);
|
||||
|
||||
@Test
|
||||
public void testRanging() {
|
||||
@ -58,12 +61,12 @@ public class InterpolateTest {
|
||||
assertThat(min).isEqualTo(0L);
|
||||
|
||||
long expected = (long)(((double)topvalue) * .8);
|
||||
System.out.println("expected long at 80% of maximum value:" + expected);
|
||||
logger.debug("expected long at 80% of maximum value:" + expected);
|
||||
|
||||
long highvalue = (long) (Long.MAX_VALUE * 0.98d);
|
||||
long high = f.applyAsLong(highvalue);
|
||||
assertThat(high).isEqualTo(expected);
|
||||
System.out.println(" -> was " + high);
|
||||
logger.debug(" -> was " + high);
|
||||
|
||||
long highervalue = (long) (Long.MAX_VALUE * 0.9999d);
|
||||
long higher = f.applyAsLong(highervalue);
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_long;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -24,6 +26,7 @@ import java.util.Arrays;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ShuffleTest {
|
||||
private final static Logger logger = LogManager.getLogger(ShuffleTest.class);
|
||||
|
||||
/**
|
||||
* Worst Case:
|
||||
@ -169,14 +172,14 @@ public class ShuffleTest {
|
||||
for (int i = 1; i <= r.length; i++) {
|
||||
r[i-1]=shuffle.applyAsLong(i);
|
||||
}
|
||||
System.out.println(Arrays.toString(r));
|
||||
logger.debug(Arrays.toString(r));
|
||||
Arrays.sort(r);
|
||||
|
||||
System.out.println(Arrays.toString(r));
|
||||
logger.debug(Arrays.toString(r));
|
||||
for (int i = 0; i < r.length; i++) {
|
||||
assertThat(r[i]).isEqualTo(i+1);
|
||||
}
|
||||
// System.out.println("resampling stats for " + max + " values: " + Arrays.toString(shuffle.stats));
|
||||
// logger.debug("resampling stats for " + max + " values: " + Arrays.toString(shuffle.stats));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -188,13 +191,13 @@ public class ShuffleTest {
|
||||
for (int i = 1; i <= r.length; i++) {
|
||||
r[i-1]=shuffle.applyAsLong(i);
|
||||
}
|
||||
// System.out.println(Arrays.toString(r));
|
||||
// logger.debug(Arrays.toString(r));
|
||||
Arrays.sort(r);
|
||||
// System.out.println(Arrays.toString(r));
|
||||
// logger.debug(Arrays.toString(r));
|
||||
for (int i = 0; i < r.length; i++) {
|
||||
assertThat(r[i]).isEqualTo(i+1);
|
||||
}
|
||||
// System.out.println("resampling stats for " + max + " values: " + Arrays.toString(shuffle.stats));
|
||||
// logger.debug("resampling stats for " + max + " values: " + Arrays.toString(shuffle.stats));
|
||||
|
||||
}
|
||||
|
||||
@ -208,13 +211,13 @@ public class ShuffleTest {
|
||||
for (int i = 1; i <= r.length; i++) {
|
||||
r[i-1]=shuffle.applyAsLong(i);
|
||||
}
|
||||
// System.out.println(Arrays.toString(r));
|
||||
// logger.debug(Arrays.toString(r));
|
||||
Arrays.sort(r);
|
||||
// System.out.println(Arrays.toString(r));
|
||||
// logger.debug(Arrays.toString(r));
|
||||
for (int i = 0; i < r.length; i++) {
|
||||
assertThat(r[i]).isEqualTo(i+1);
|
||||
}
|
||||
// System.out.println("resampling stats for " + max + " values: " + Arrays.toString(shuffle.stats));
|
||||
// logger.debug("resampling stats for " + max + " values: " + Arrays.toString(shuffle.stats));
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,11 +17,14 @@
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_object;
|
||||
|
||||
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.FixedValues;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class WeightedFuncsTest {
|
||||
private final static Logger logger = LogManager.getLogger(WeightedFuncsTest.class);
|
||||
|
||||
@Test
|
||||
public void testFuncSelectionDistribution() {
|
||||
@ -44,7 +47,7 @@ public class WeightedFuncsTest {
|
||||
int v = ((Long) o).intValue();
|
||||
results[v]++;
|
||||
}
|
||||
System.out.print(Arrays.toString(results));
|
||||
logger.debug(Arrays.toString(results));
|
||||
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,12 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_string;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class TextImageExtractTest {
|
||||
private final static Logger logger = LogManager.getLogger(TextImageExtractTest.class);
|
||||
|
||||
/**
|
||||
* These tests are largely illustrative for those integrating this function into their
|
||||
@ -28,20 +31,20 @@ public class TextImageExtractTest {
|
||||
public void testCtors() {
|
||||
|
||||
CharBufImage f1 = new CharBufImage(10);
|
||||
System.out.println("f1:" + f1.apply(1L));
|
||||
logger.debug("f1:" + f1.apply(1L));
|
||||
|
||||
CharBufImage f2 = new CharBufImage("abc123",15);
|
||||
System.out.println("f2:" + f2.apply(1L));
|
||||
logger.debug("f2:" + f2.apply(1L));
|
||||
|
||||
CharBufImage f3 = new CharBufImage("abcdef",10,3L,5);
|
||||
System.out.println("f3:" + f3.apply(1L));
|
||||
logger.debug("f3:" + f3.apply(1L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testComposedFromStringFunc() {
|
||||
NumberNameToString nnts = new NumberNameToString();
|
||||
CharBufImage cbi = new CharBufImage(nnts, 100, 20);
|
||||
System.out.println("cbi:" + cbi.apply(1L));
|
||||
logger.debug("cbi:" + cbi.apply(1L));
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,6 +18,8 @@ package io.nosqlbench.virtdata.library.basics.tests.long_timeuuid;
|
||||
|
||||
import io.nosqlbench.virtdata.library.basics.core.DateTimeFormats;
|
||||
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_time_types.ToEpochTimeUUID;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormatter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -26,6 +28,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ToEpochTimeUUIDTest {
|
||||
private final static Logger logger = LogManager.getLogger(ToEpochTimeUUIDTest.class);
|
||||
|
||||
@Test
|
||||
public void testFormats() {
|
||||
@ -41,7 +44,7 @@ public class ToEpochTimeUUIDTest {
|
||||
}
|
||||
|
||||
for (String formatted : formats) {
|
||||
System.out.println(formatted);
|
||||
logger.debug(formatted);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,7 +111,7 @@ public class IntegerDistributionsConcurrencyTest {
|
||||
for (int i = 0; i < futures.size(); i++) {
|
||||
try {
|
||||
results[i] = futures.get(i).get();
|
||||
System.out.println(description + ": got results for thread " + i);
|
||||
logger.debug(description + ": got results for thread " + i);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@ -122,7 +122,7 @@ public class IntegerDistributionsConcurrencyTest {
|
||||
long[] threadResults = results[vthread];
|
||||
for (int i = 0; i <values.length ; i++) {
|
||||
if (threadResults[i] != values[i]) {
|
||||
System.out.println("not equal in thread="+ vthread + ", i=" + i
|
||||
logger.debug("not equal in thread="+ vthread + ", i=" + i
|
||||
+", " + threadResults[i] + "!=" + values[i]);
|
||||
for (int ithread = 0; ithread < threads; ithread++) {
|
||||
System.out.print(results[ithread][i] + ",");
|
||||
|
@ -20,10 +20,13 @@ import io.nosqlbench.virtdata.userlibs.apps.docsapp.fdocs.ExampleDocFunc1;
|
||||
import io.nosqlbench.virtdata.userlibs.apps.docsapp.fdocs.ExampleDocFunc2;
|
||||
import io.nosqlbench.virtdata.userlibs.apps.docsapp.fdocs.FDocFunc;
|
||||
import io.nosqlbench.virtdata.userlibs.apps.docsapp.fdocs.FDocFuncs;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class FDocFuncsTest {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(FDocFuncsTest.class);
|
||||
@Test
|
||||
public void testMarkdownFormat() {
|
||||
ExampleDocFunc1 exampleDocData1 = new ExampleDocFunc1();
|
||||
@ -34,7 +37,7 @@ public class FDocFuncsTest {
|
||||
funcs.addFunctionDoc(new FDocFunc(exampleDocData2));
|
||||
|
||||
String out = funcs.asMarkdown();
|
||||
System.out.print(out);
|
||||
logger.debug(out);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,11 +16,9 @@
|
||||
|
||||
package io.virtdata;
|
||||
|
||||
import io.nosqlbench.virtdata.core.bindings.DataMapper;
|
||||
import io.nosqlbench.virtdata.core.bindings.Bindings;
|
||||
import io.nosqlbench.virtdata.core.bindings.BindingsTemplate;
|
||||
import io.nosqlbench.virtdata.core.bindings.ResolverDiagnostics;
|
||||
import io.nosqlbench.virtdata.core.bindings.VirtData;
|
||||
import io.nosqlbench.virtdata.core.bindings.*;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -31,6 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
public class IntegratedComposerLibraryTest {
|
||||
private final static Logger logger = LogManager.getLogger(IntegratedComposerLibraryTest.class);
|
||||
|
||||
// The deprecated functions are not being included in the next release, so this test's purpose has been
|
||||
// reversed.
|
||||
@ -194,10 +193,10 @@ public class IntegratedComposerLibraryTest {
|
||||
public void testTemplateBindingConversion() {
|
||||
ResolverDiagnostics diag;
|
||||
diag = VirtData.getMapperDiagnostics("Uniform(0.0,1.0)");
|
||||
System.out.println(diag.toString());
|
||||
logger.debug(diag.toString());
|
||||
|
||||
diag = VirtData.getMapperDiagnostics("Template('{}', long->Uniform(0.0D,1.0D))->double");
|
||||
System.out.println(diag.toString());
|
||||
logger.debug(diag.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user