mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
merge fixes for: improve concurrency patterns for activity execution
This commit is contained in:
@@ -21,9 +21,9 @@ import io.nosqlbench.engine.cli.BasicScriptBuffer;
|
||||
import io.nosqlbench.engine.cli.Cmd;
|
||||
import io.nosqlbench.engine.cli.NBCLICommandParser;
|
||||
import io.nosqlbench.engine.cli.ScriptBuffer;
|
||||
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
|
||||
import io.nosqlbench.engine.core.script.Scenario;
|
||||
import io.nosqlbench.engine.core.script.ScenariosExecutor;
|
||||
import io.nosqlbench.engine.core.lifecycle.ExecutionMetricsResult;
|
||||
import io.nosqlbench.engine.core.lifecycle.scenario.Scenario;
|
||||
import io.nosqlbench.engine.core.lifecycle.scenario.ScenariosExecutor;
|
||||
import io.nosqlbench.engine.rest.services.WorkSpace;
|
||||
import io.nosqlbench.engine.rest.services.WorkspaceFinder;
|
||||
import io.nosqlbench.engine.rest.transfertypes.LiveScenarioView;
|
||||
@@ -234,8 +234,8 @@ public class ScenarioExecutorEndpoint implements WebServiceObject {
|
||||
Optional<Scenario> pendingScenario = executor.getPendingScenario(scenarioName);
|
||||
|
||||
if (pendingScenario.isPresent()) {
|
||||
Optional<Future<ScenarioResult>> pendingResult = executor.getPendingResult(scenarioName);
|
||||
Future<ScenarioResult> scenarioResultFuture = pendingResult.get();
|
||||
Optional<Future<ExecutionMetricsResult>> pendingResult = executor.getPendingResult(scenarioName);
|
||||
Future<ExecutionMetricsResult> scenarioResultFuture = pendingResult.get();
|
||||
return new LiveScenarioView(pendingScenario.get());
|
||||
} else {
|
||||
throw new RuntimeException("Scenario name '" + scenarioName + "' not found.");
|
||||
|
||||
@@ -19,7 +19,7 @@ package io.nosqlbench.engine.rest.transfertypes;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
||||
import io.nosqlbench.engine.api.activityapi.core.progress.ProgressMeterDisplay;
|
||||
import io.nosqlbench.engine.core.script.Scenario;
|
||||
import io.nosqlbench.engine.core.lifecycle.scenario.Scenario;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
|
||||
package io.nosqlbench.engine.rest.transfertypes;
|
||||
|
||||
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
|
||||
import io.nosqlbench.engine.core.lifecycle.ExecutionMetricsResult;
|
||||
|
||||
public class ResultView {
|
||||
|
||||
private final ScenarioResult result;
|
||||
private final ExecutionMetricsResult result;
|
||||
|
||||
public ResultView(ScenarioResult result) {
|
||||
public ResultView(ExecutionMetricsResult result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getIOLog() {
|
||||
if (result!=null) {
|
||||
if (result != null) {
|
||||
return result.getIOLog();
|
||||
} else {
|
||||
return "";
|
||||
@@ -35,8 +35,8 @@ public class ResultView {
|
||||
}
|
||||
|
||||
public String getError() {
|
||||
if (result!=null && result.getException().isPresent()) {
|
||||
return result.getException().get().getMessage();
|
||||
if (result != null && result.getException()!=null) {
|
||||
return result.getException().getMessage();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
57
engine-rest/src/test/resources/log4j2-test.xml
Normal file
57
engine-rest/src/test/resources/log4j2-test.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<Configuration status="debug" strict="true" name="XMLConfigTest"
|
||||
packages="org.apache.logging.log4j.test">
|
||||
|
||||
<Filter type="ThresholdFilter" level="info"/>
|
||||
|
||||
<Appenders>
|
||||
<Appender type="Console" name="STDOUT">
|
||||
<Layout type="PatternLayout" pattern="%7r %-5level [%t] %-12logger{0} %msg%n%throwable"/>
|
||||
<Filters>
|
||||
<Filter type="MarkerFilter" marker="FLOW" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<Filter type="MarkerFilter" marker="EXCEPTION" onMatch="DENY" onMismatch="ACCEPT"/>
|
||||
</Filters>
|
||||
</Appender>
|
||||
<Appender type="Console" name="FLOW">
|
||||
<Layout type="PatternLayout" pattern="%C{1}.%M %m %ex%n"/><!-- class and line number -->
|
||||
<Filters>
|
||||
<Filter type="MarkerFilter" marker="FLOW" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
|
||||
<Filter type="MarkerFilter" marker="EXCEPTION" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
</Appender>
|
||||
<Appender type="File" name="APPSLOG" fileName="docs/apps.log">
|
||||
<Layout type="PatternLayout">
|
||||
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
|
||||
</Layout>
|
||||
</Appender>
|
||||
</Appenders>
|
||||
|
||||
<Loggers>
|
||||
|
||||
<Logger name="io.nosqlbench.docsys" level="info" additivity="false">
|
||||
<AppenderRef ref="APPSLOG"/>
|
||||
</Logger>
|
||||
|
||||
<Root level="trace">
|
||||
<AppenderRef ref="STDOUT"/>
|
||||
</Root>
|
||||
|
||||
</Loggers>
|
||||
|
||||
</Configuration>
|
||||
Reference in New Issue
Block a user