mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
allow labels to be provided at the activity level
This commit is contained in:
@@ -154,6 +154,7 @@ public abstract class BaseDriverAdapter<R extends Op, S> implements DriverAdapte
|
||||
public NBConfigModel getConfigModel() {
|
||||
return ConfigModel.of(BaseDriverAdapter.class)
|
||||
.add(Param.optional("alias"))
|
||||
.add(Param.optional("labels",String.class,"Labels which will apply to metrics and annotations for this activity only"))
|
||||
.add(Param.defaultTo("strict", true, "strict op field mode, which requires that provided op fields are recognized and used"))
|
||||
.add(Param.optional(List.of("op", "stmt", "statement"), String.class, "op template in statement form"))
|
||||
.add(Param.optional("tags", String.class, "tags to be used to filter operations"))
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package io.nosqlbench.engine.api.activityimpl;
|
||||
|
||||
import com.codahale.metrics.Timer;
|
||||
import io.nosqlbench.api.config.NBLabelSpec;
|
||||
import io.nosqlbench.engine.api.activityapi.core.*;
|
||||
import io.nosqlbench.engine.api.activityapi.core.progress.ActivityMetricProgressMeter;
|
||||
import io.nosqlbench.engine.api.activityapi.core.progress.ProgressMeterDisplay;
|
||||
@@ -93,7 +94,13 @@ public class SimpleActivity implements Activity {
|
||||
private final NBLabels labels;
|
||||
|
||||
public SimpleActivity(ActivityDef activityDef, NBLabeledElement parentLabels) {
|
||||
labels = parentLabels.getLabels().and("activity",activityDef.getAlias());
|
||||
NBLabels activityLabels = parentLabels.getLabels()
|
||||
.andTypes("activity", activityDef.getAlias());
|
||||
Optional<String> auxLabelSpec = activityDef.getParams().getOptionalString("labels");
|
||||
if (auxLabelSpec.isPresent()) {
|
||||
activityLabels = activityLabels.and(NBLabelSpec.parseLabels(auxLabelSpec.get()));
|
||||
}
|
||||
this.labels = activityLabels;
|
||||
this.activityDef = activityDef;
|
||||
this.parentLabels = parentLabels;
|
||||
if (activityDef.getAlias().equals(ActivityDef.DEFAULT_ALIAS)) {
|
||||
|
||||
Reference in New Issue
Block a user