fixed empty runScenario method and made it final

This commit is contained in:
Jonathan Shook
2023-10-06 18:40:05 -05:00
parent f099fa0840
commit bed3070495
4 changed files with 22 additions and 54 deletions

View File

@@ -94,8 +94,8 @@ public class NBSceneBuffer implements NBSceneFixtures {
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));
}
}

View File

@@ -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<String, String> params, String progressInterval) {
super(parentComponent, scenarioName);
}
@Override
protected void runScenario(NBSceneFixtures sctx) {
}
}

View File

@@ -54,4 +54,21 @@ public class ScenarioResult {
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();
}
}