diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/context/NBSceneBuffer.java b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/context/NBSceneBuffer.java index cb0a718a7b..92889db5ca 100644 --- a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/context/NBSceneBuffer.java +++ b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/context/NBSceneBuffer.java @@ -94,8 +94,8 @@ public NBSceneFixtures asFixtures() { return (NBSceneFixtures) this; } -// public static NBSceneBuffer init(String name) { -// TestComponent root = new TestComponent("scene", "self"); -// return new NBSceneBuffer(NBDefaultSceneFixtures.ofDefault(name)); -// } + public static NBSceneBuffer init(String name) { + TestComponent root = new TestComponent("scene", "self"); + return new NBSceneBuffer(NBDefaultSceneFixtures.ofDefault(name)); + } } diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/direct/NBBaseScenario.java b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/direct/NBBaseScenario.java deleted file mode 100644 index 4e4aa558a1..0000000000 --- a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/direct/NBBaseScenario.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2023 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.engine.core.lifecycle.scenario.direct; - -import io.nosqlbench.components.NBComponent; -import io.nosqlbench.engine.core.lifecycle.scenario.context.NBSceneFixtures; -import io.nosqlbench.engine.core.lifecycle.scenario.execution.NBScenario; - -import java.util.Map; - -public abstract class NBBaseScenario extends NBScenario { - - public NBBaseScenario(NBComponent parentComponent, String scenarioName, Map params, String progressInterval) { - super(parentComponent, scenarioName); - } - - @Override - protected void runScenario(NBSceneFixtures sctx) { - } -} diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/execution/ScenarioResult.java b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/execution/ScenarioResult.java index 8ff7038b5d..ecf44549d1 100644 --- a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/execution/ScenarioResult.java +++ b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/execution/ScenarioResult.java @@ -54,4 +54,21 @@ public void exitWithCode() { public String getIOLog() { return fixtures.getIOLog(); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ScenarioResult [") + .append(this.endedAt - this.startedAt) + .append("ms]"); + if (exception==null) { + sb.append(" OK "); + } else { + sb.append(" ERROR ").append(exception); + } + String iolog = getIOLog(); + if (!iolog.isEmpty()) { + sb.append(" IO{\n").append("}\n").append(iolog); + } + return sb.toString(); + } } diff --git a/nbr-examples/src/test/java/io/nosqlbench/nbr/examples/injava/SC_activity_error.java b/nbr-examples/src/test/java/io/nosqlbench/nbr/examples/injava/SC_activity_error.java index 8bfa405fa4..dca852d0d9 100644 --- a/nbr-examples/src/test/java/io/nosqlbench/nbr/examples/injava/SC_activity_error.java +++ b/nbr-examples/src/test/java/io/nosqlbench/nbr/examples/injava/SC_activity_error.java @@ -27,21 +27,6 @@ public SC_activity_error(NBComponent parentComponent, String scenarioName) { super(parentComponent, scenarioName); } - @Override - protected void runScenario(NBSceneFixtures shell) { - -// HdrHistoLogPluginData hdrHistoLogPluginData = new HdrHistoLogPluginData(); -// HdrHistoLogPlugin histologplugin = hdrHistoLogPluginData.getExtensionObject(...); -// histologplugin.logHistoIntervals(...); - -// HdrHistoLogPlugin logplugin = shell.extensions().get("histologger",HdrHistoLogPlugin.class); - -// var serviceojbect = extensions.get("histologger"); - -// AttachedMetricsSummaryReporter reporter = shell.runtime().create().summaryReporter(5, "labelname", "labelvalue"); - - } - /** * Equivalent to javascript form: *
{@code
@@ -73,7 +58,7 @@ public void invoke() {
         );
         stdout.write("starting activity activity_error");
         controller.start(activitydef1);
-        controller.waitMillis(2000);
+        controller.waitMillis(500);
         controller.getActivityDef("activity_error").getParams().set("threads","unparsable"); // forced error
         controller.awaitActivity("activity_error", Long.MAX_VALUE);
     }