mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
differentiate dimension and instance labels
This commit is contained in:
parent
59a6544e68
commit
6c4833d48d
@ -71,13 +71,13 @@ public class NamingFolio {
|
||||
* by name, type, table, keyspace. For now it just returns everything in fully qualified form.
|
||||
*/
|
||||
public String nameFor(NBLabeledElement labeled, String... fields) {
|
||||
NBLabels labelsPlus = labeled.getLabels().and(fields);
|
||||
NBLabels labelsPlus = labeled.getLabels().andTypes(fields);
|
||||
String name = namer.apply(labelsPlus.asMap());
|
||||
return name;
|
||||
}
|
||||
|
||||
public String nameFor(NBLabeledElement labeled, Map<String,String> fields) {
|
||||
NBLabels labelsPlus = labeled.getLabels().and(fields);
|
||||
NBLabels labelsPlus = labeled.getLabels().andTypes(fields);
|
||||
String name = namer.apply(labelsPlus.asMap());
|
||||
return name;
|
||||
|
||||
|
@ -42,6 +42,6 @@ public class CqlTableColumn extends CqlColumnBase {
|
||||
|
||||
@Override
|
||||
public NBLabels getLabels() {
|
||||
return super.getLabels().and("table", table.getName());
|
||||
return super.getLabels().andTypes("table", table.getName());
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,6 @@ public class CqlTypeColumn extends CqlColumnBase {
|
||||
|
||||
@Override
|
||||
public NBLabels getLabels() {
|
||||
return super.getLabels().and("name", this.type.getName());
|
||||
return super.getLabels().andTypes("name", this.type.getName());
|
||||
}
|
||||
}
|
||||
|
@ -171,6 +171,6 @@ public class DiagTask_gauge extends BaseDiagTask implements Gauge<Double> {
|
||||
|
||||
@Override
|
||||
public NBLabels getLabels() {
|
||||
return super.getLabels().and("stat",this.stat.toString());
|
||||
return super.getLabels().andTypes("stat",this.stat.toString());
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class KafkaAdapterMetrics {
|
||||
|
||||
public KafkaAdapterMetrics(final KafkaBaseOpDispenser kafkaBaseOpDispenser, final NBLabeledElement labeledParent) {
|
||||
this.kafkaBaseOpDispenser = kafkaBaseOpDispenser;
|
||||
labels=labeledParent.getLabels().and("name",KafkaAdapterMetrics.class.getSimpleName());
|
||||
labels=labeledParent.getLabels().andTypes("name",KafkaAdapterMetrics.class.getSimpleName());
|
||||
}
|
||||
|
||||
public void initS4JAdapterInstrumentation() {
|
||||
|
@ -83,7 +83,7 @@ public class Scenario implements Callable<ExecutionMetricsResult>, NBLabeledElem
|
||||
|
||||
@Override
|
||||
public NBLabels getLabels() {
|
||||
return this.parentComponent.getLabels().and("scenario", this.scenarioName);
|
||||
return this.parentComponent.getLabels().andTypes("scenario", this.scenarioName);
|
||||
}
|
||||
|
||||
public enum State {
|
||||
|
@ -142,8 +142,9 @@ public interface NBLabels {
|
||||
* Keys and values in "key1", "value1", "key2", "value2", ... form
|
||||
* @return A new NBLabels instance
|
||||
*/
|
||||
NBLabels and(String... labelsAndValues);
|
||||
NBLabels andTypes(String... typeLabelsAndValues);
|
||||
|
||||
NBLabels and(NBLabels labels);
|
||||
/**
|
||||
* Create a new NBLabels value with the additional keys and values appended.
|
||||
*
|
||||
@ -151,7 +152,10 @@ public interface NBLabels {
|
||||
* a map of keys and values
|
||||
* @return A new NBLabels instance
|
||||
*/
|
||||
NBLabels and(Map<String, String> labels);
|
||||
NBLabels andTypes(Map<String, String> typeLabelsAndValues);
|
||||
NBLabels andInstances(String... instanceLabelsAndValues);
|
||||
|
||||
NBLabels andInstances(Map<String,String> instanceLabelsAndValues);
|
||||
|
||||
/**
|
||||
* Return the value of the specified label key.
|
||||
@ -170,4 +174,13 @@ public interface NBLabels {
|
||||
* @return a {@link Map} of keys and values, in deterministic order
|
||||
*/
|
||||
Map<String, String> asMap();
|
||||
|
||||
/**
|
||||
* @return a new set of labels which includes only those which are not using per-instance semantics.
|
||||
*/
|
||||
NBLabels onlyTypes();
|
||||
NBLabels onlyInstances();
|
||||
|
||||
String[] getInstanceFields();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user