mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
improve logging levels for debugging
This commit is contained in:
parent
6c0d60706d
commit
4175e79549
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2022-2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -20,8 +20,6 @@ import io.nosqlbench.engine.api.activityapi.core.RunState;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* <H2>Synopsis</H2>
|
||||
* <P>Event-oriented tally of the runtime states of all
|
||||
@ -90,9 +88,9 @@ public class RunStateTally {
|
||||
logger.trace(() -> this +" -"+from+ String.format(":%04d",counts[from.ordinal()])+ ", +"+to+ String.format(":%04d",counts[to.ordinal()]));
|
||||
|
||||
if (counts[from.ordinal()]==0 || counts[to.ordinal()]==1) {
|
||||
logger.debug(() -> "NOTIFYing on edge "+
|
||||
"from " + from + String.format(":%04d",counts[from.ordinal()]) +
|
||||
" to " + to + String.format(":%04d",counts[to.ordinal()]));
|
||||
// logger.debug(() -> "NOTIFYing on edge "+
|
||||
// "from " + from + String.format(":%04d",counts[from.ordinal()]) +
|
||||
// " to " + to + String.format(":%04d",counts[to.ordinal()]));
|
||||
notifyAll();
|
||||
}
|
||||
}
|
||||
@ -107,7 +105,7 @@ public class RunStateTally {
|
||||
counts[state.ordinal()]++;
|
||||
logger.trace(() -> this +" +"+state+ String.format(":%04d",counts[state.ordinal()]));
|
||||
if (counts[state.ordinal()]==1) {
|
||||
logger.debug(() -> "NOTIFYing on ++-SOME edge for " + state + String.format(":%04d",counts[state.ordinal()]));
|
||||
// logger.debug(() -> "NOTIFYing on ++-SOME edge for " + state + String.format(":%04d",counts[state.ordinal()]));
|
||||
notifyAll();
|
||||
}
|
||||
}
|
||||
@ -122,7 +120,7 @@ public class RunStateTally {
|
||||
counts[state.ordinal()]--;
|
||||
logger.trace(() -> this +" -"+state+ String.format(":%04d",counts[state.ordinal()]));
|
||||
if (counts[state.ordinal()]==0) {
|
||||
logger.debug(() -> "NOTIFYing on 00-NONE edge for " + state + String.format(":%04d",counts[state.ordinal()]));
|
||||
// logger.debug(() -> "NOTIFYing on 00-NONE edge for " + state + String.format(":%04d",counts[state.ordinal()]));
|
||||
notifyAll();
|
||||
}
|
||||
}
|
||||
@ -145,7 +143,7 @@ public class RunStateTally {
|
||||
* @return A {@link RunStateImage}, indicating success or failure, and the view of states at the time of evaluation
|
||||
*/
|
||||
public synchronized RunStateImage awaitNoneOther(long timeoutMillis, RunState... runStates) {
|
||||
logger.debug(() -> "☐ Awaiting only " + Arrays.toString(runStates) + " for " + timeoutMillis+"ms");
|
||||
// logger.debug(() -> "☐ Awaiting only " + Arrays.toString(runStates) + " for " + timeoutMillis+"ms");
|
||||
long timeoutAt = timeoutAt(timeoutMillis);
|
||||
|
||||
int sum=0;
|
||||
@ -171,7 +169,7 @@ public class RunStateTally {
|
||||
}
|
||||
|
||||
boolean timedout = (sum!=0);
|
||||
logger.debug(() -> (timedout ? "✘ TIMED-OUT awaiting only " : "☑ Awaited only " ) + toString(runStates));
|
||||
// logger.debug(() -> (timedout ? "✘ TIMED-OUT awaiting only " : "☑ Awaited only " ) + toString(runStates));
|
||||
return new RunStateImage(this.counts,timedout);
|
||||
}
|
||||
|
||||
@ -194,7 +192,7 @@ public class RunStateTally {
|
||||
* @return A {@link RunStateImage}, indicating success or failure, and the view of states at the time of evaluation
|
||||
*/
|
||||
public synchronized RunStateImage awaitNoneOf(long timeoutMillis, RunState... runStates) {
|
||||
logger.debug(() -> "☐ Awaiting none of " + Arrays.toString(runStates)+ " for " + timeoutMillis+"ms");
|
||||
// logger.debug(() -> "☐ Awaiting none of " + Arrays.toString(runStates)+ " for " + timeoutMillis+"ms");
|
||||
long timeoutAt = timeoutAt(timeoutMillis);
|
||||
|
||||
int sum=0;
|
||||
@ -212,7 +210,7 @@ public class RunStateTally {
|
||||
}
|
||||
}
|
||||
boolean timedout=sum==0;
|
||||
logger.debug(() -> (timedout ? "✘ TIMED-OUT awaiting none of " : "☑ Awaited none of " ) + toString(runStates));
|
||||
// logger.debug(() -> (timedout ? "✘ TIMED-OUT awaiting none of " : "☑ Awaited none of " ) + toString(runStates));
|
||||
return new RunStateImage(this.counts,timedout);
|
||||
}
|
||||
|
||||
@ -233,13 +231,13 @@ public class RunStateTally {
|
||||
* @return A {@link RunStateImage}, indicating success or failure, and the view of states at the time of evaluation
|
||||
*/
|
||||
public synchronized RunStateImage awaitAny(long timeoutMillis, RunState... runStates) {
|
||||
logger.debug(() -> "☐ Awaiting any " + Arrays.toString(runStates) + " for " + timeoutMillis + "ms");
|
||||
// logger.debug(() -> "☐ Awaiting any " + Arrays.toString(runStates) + " for " + timeoutMillis + "ms");
|
||||
long timeoutAt = timeoutAt(timeoutMillis);
|
||||
|
||||
while (System.currentTimeMillis()<timeoutAt) {
|
||||
for (RunState runState : runStates) {
|
||||
if (counts[runState.ordinal()]>0) {
|
||||
logger.debug("☑ Awaited any " + toString(runStates));
|
||||
// logger.debug("☑ Awaited any " + toString(runStates));
|
||||
return new RunStateImage(this.counts,false);
|
||||
}
|
||||
}
|
||||
@ -248,7 +246,7 @@ public class RunStateTally {
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
logger.debug(() -> "✘ TIMED-OUT awaiting any of " + toString(runStates));
|
||||
// logger.debug(() -> "✘ TIMED-OUT awaiting any of " + toString(runStates));
|
||||
return new RunStateImage(this.counts,true);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2022-2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -38,13 +38,13 @@ public class ExecutionResult {
|
||||
this.exception = error;
|
||||
this.iolog = ((iolog != null) ? iolog + "\n\n" : "") + exception;
|
||||
logger.debug("populating "+(error==null ? "NORMAL" : "ERROR")+" scenario result");
|
||||
if (logger.isTraceEnabled()) {
|
||||
StackTraceElement[] st = Thread.currentThread().getStackTrace();
|
||||
for (int i = 0; i < st.length; i++) {
|
||||
logger.debug(":AT " + st[i].getFileName()+":"+st[i].getLineNumber()+":"+st[i].getMethodName());
|
||||
if (i>10) break;
|
||||
}
|
||||
}
|
||||
// if (logger.isTraceEnabled()) {
|
||||
// StackTraceElement[] st = Thread.currentThread().getStackTrace();
|
||||
// for (int i = 0; i < st.length; i++) {
|
||||
// logger.debug(":AT " + st[i].getFileName()+":"+st[i].getLineNumber()+":"+st[i].getMethodName());
|
||||
// if (i>10) break;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2022-2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -28,7 +28,7 @@ public class ActivitiesExceptionHandler implements Thread.UncaughtExceptionHandl
|
||||
|
||||
public ActivitiesExceptionHandler(ScenarioController controller) {
|
||||
this.controller = controller;
|
||||
logger.debug(() -> "Activity exception handler starting up for executor '" + this.controller + "'");
|
||||
logger.debug(() -> "Activities exception handler starting up for executor '" + this.controller + "'");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2022-2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -27,7 +27,7 @@ public class ActivityExceptionHandler implements Thread.UncaughtExceptionHandler
|
||||
|
||||
public ActivityExceptionHandler(ActivityExecutor executor) {
|
||||
this.executor = executor;
|
||||
logger.debug(() -> "Activity exception handler starting up for executor '" + executor + "'");
|
||||
logger.debug(() -> "Activity executor exception handler starting up for executor '" + executor.getActivityDef().getAlias() + "'");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user