mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fix NPE when no filter or validator applied
This commit is contained in:
parent
17fa8500ab
commit
7b9f4389b8
@ -122,8 +122,8 @@ public class Annotators {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void recordAnnotation(Annotation annotation) {
|
public static synchronized void recordAnnotation(Annotation annotation) {
|
||||||
annotation.applyLabelFunction(filter);
|
if (filter!=null) annotation.applyLabelFunction(filter);
|
||||||
annotation.applyLabelFunction(validator);
|
if (validator!=null) annotation.applyLabelFunction(validator);
|
||||||
// sanity check here first
|
// sanity check here first
|
||||||
annotation.getLabels();
|
annotation.getLabels();
|
||||||
for (Annotator annotator : getAnnotators()) {
|
for (Annotator annotator : getAnnotators()) {
|
||||||
|
@ -76,8 +76,8 @@ public class ActivityMetrics {
|
|||||||
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
|
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
|
||||||
private static Metric register(NBLabels labels, MetricProvider metricProvider) {
|
private static Metric register(NBLabels labels, MetricProvider metricProvider) {
|
||||||
|
|
||||||
labels = labelFilter.apply(labels);
|
labels = labelFilter!=null ? labelFilter.apply(labels) : labels;
|
||||||
labels = labelValidator.apply(labels);
|
labels = labelValidator != null ? labelValidator.apply(labels) : labels;
|
||||||
|
|
||||||
final String graphiteName = labels.linearizeValues('.',"[activity]","[space]","[op]","name");
|
final String graphiteName = labels.linearizeValues('.',"[activity]","[space]","[op]","name");
|
||||||
Metric metric = get().getMetrics().get(graphiteName);
|
Metric metric = get().getMetrics().get(graphiteName);
|
||||||
|
Loading…
Reference in New Issue
Block a user