Skip to content

Commit

Permalink
Config rename
Browse files Browse the repository at this point in the history
Signed-off-by: Keshava Munegowda <keshava.gowda@gmail.com>
  • Loading branch information
kmgowda committed Apr 9, 2020
1 parent 327e5c3 commit e997750
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

package io.sbk.api;

public class SbkConfig {
public String sbkName;
public class Config {
public String name;
public String description;
public String packageName;
public boolean fork;
Expand Down
6 changes: 3 additions & 3 deletions sbk-api/src/main/java/io/sbk/api/impl/SbkBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.sbk.api.Performance;
import io.sbk.api.Reader;
import io.sbk.api.ResultLogger;
import io.sbk.api.SbkConfig;
import io.sbk.api.Config;
import io.sbk.api.Storage;
import io.sbk.api.Writer;
import lombok.Synchronized;
Expand All @@ -38,7 +38,7 @@
* Class for performing the benchmark.
*/
public class SbkBenchmark implements Benchmark {
final private SbkConfig config;
final private Config config;
final private Storage storage;
final private ExecutorService executor;
final private Parameters params;
Expand All @@ -60,7 +60,7 @@ public class SbkBenchmark implements Benchmark {
* @param logger Result Logger
* @param metricsLogger Log the results to metrics logger
*/
public SbkBenchmark(String action, SbkConfig config, Parameters params,
public SbkBenchmark(String action, Config config, Parameters params,
Storage storage, ResultLogger logger, ResultLogger metricsLogger) {
this.config = config;
this.params = params;
Expand Down
18 changes: 9 additions & 9 deletions sbk-api/src/main/java/io/sbk/main/SbkMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.sbk.api.Metric;
import io.sbk.api.Parameters;
import io.sbk.api.ResultLogger;
import io.sbk.api.SbkConfig;
import io.sbk.api.Config;
import io.sbk.api.Storage;
import io.sbk.api.impl.MetricImpl;
import io.sbk.api.impl.MetricsLogger;
Expand Down Expand Up @@ -60,20 +60,20 @@ public static void main(final String[] args) {
final List<String> driversList;
final ResultLogger metricsLogger;
final String version = SbkMain.class.getPackage().getImplementationVersion();
SbkConfig config = null;
CompletableFuture ret = null;
Config config = null;
CompletableFuture<Void> ret = null;

final ObjectMapper mapper = new ObjectMapper(new JavaPropsFactory())
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

try {
config = mapper.readValue(SbkMain.class.getClassLoader().getResourceAsStream(CONFIGFILE),
SbkConfig.class);
Config.class);
} catch (Exception ex) {
ex.printStackTrace();
System.exit(0);
}
System.out.printf("Package name : %s", config.packageName);

try {
commandline = new DefaultParser().parse(new Options()
.addOption("version", false, "Version"),
Expand All @@ -83,7 +83,7 @@ public static void main(final String[] args) {
System.exit(0);
}
if (commandline.hasOption("version")) {
System.out.println(config.description + ", " + config.sbkName + " version: " + version);
System.out.println(config.description + ", " + config.name + " version: " + version);
System.exit(0);
}

Expand All @@ -99,7 +99,7 @@ public static void main(final String[] args) {
driversList = getClassNames(config.packageName);
className = commandline.getOptionValue("class", null);
if (className == null) {
Parameters paramsHelp = new SbkParameters(config.sbkName, config.description, version, "", driversList, startTime);
Parameters paramsHelp = new SbkParameters(config.name, config.description, version, "", driversList, startTime);
metric.addArgs(paramsHelp);
paramsHelp.printHelp();
System.exit(0);
Expand All @@ -121,7 +121,7 @@ public static void main(final String[] args) {
System.out.println("Failure to create Benchmark object");
System.exit(0);
}
params = new SbkParameters(config.sbkName, config.description, version, name, driversList, startTime);
params = new SbkParameters(config.name, config.description, version, name, driversList, startTime);
storage.addArgs(params);
metric.addArgs(params);
try {
Expand Down Expand Up @@ -160,7 +160,7 @@ public static void main(final String[] args) {
metricsLogger = logger;
} else {
final CompositeMeterRegistry compositeLogger = Metrics.globalRegistry;
final String prefix = config.sbkName.toUpperCase() + "_" + name + "_" + action + "_";
final String prefix = config.name.toUpperCase() + "_" + name + "_" + action + "_";
compositeLogger.add(new JmxMeterRegistry(JmxConfig.DEFAULT, Clock.SYSTEM));
compositeLogger.add(metricRegistry);
metricsLogger = new MetricsLogger(
Expand Down
2 changes: 1 addition & 1 deletion sbk-api/src/main/resources/sbk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://www.apache.org/licenses/LICENSE-2.0

#Name of the Framework
sbkName=sbk
name=KESH

# Description
description=Storage Benchmark Kit
Expand Down

0 comments on commit e997750

Please sign in to comment.