mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-01 21:09:18 -06:00
quick fix for missing labels in measures
This commit is contained in:
parent
c0171dcec6
commit
b3b361b30a
@ -71,11 +71,8 @@ blocks:
|
||||
insert: |
|
||||
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,vectors)
|
||||
(key, value) VALUES ({id},{train_floatlist});
|
||||
# await_index:
|
||||
# ops:
|
||||
search_and_index:
|
||||
ops:
|
||||
select_ann_limit_borked:
|
||||
select_ann_limit:
|
||||
prepared: |
|
||||
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,vectors)
|
||||
|
@ -16,12 +16,13 @@
|
||||
|
||||
package io.nosqlbench.engine.extensions.computefunctions.relavency;
|
||||
|
||||
import io.nosqlbench.api.labels.NBLabeledElement;
|
||||
import io.nosqlbench.api.labels.NBLabels;
|
||||
import io.nosqlbench.api.engine.metrics.wrappers.RelevancyFunction;
|
||||
|
||||
public abstract class BaseRelevancyFunction implements RelevancyFunction {
|
||||
private final String name;
|
||||
private final NBLabels labels;
|
||||
private NBLabels labels;
|
||||
|
||||
public BaseRelevancyFunction(String name, NBLabels labels) {
|
||||
this.name = name;
|
||||
@ -36,4 +37,10 @@ public abstract class BaseRelevancyFunction implements RelevancyFunction {
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prependLabels(NBLabeledElement prepend) {
|
||||
this.labels = prepend.getLabels().and(this.labels);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,6 @@ public interface RelevancyFunction extends NBLabeledElement {
|
||||
* @return A string which can be used to identify if the metric exists yet.
|
||||
*/
|
||||
String getUniqueName();
|
||||
|
||||
void prependLabels(NBLabeledElement prepend);
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ public class RelevancyMeasures implements NBLabeledElement {
|
||||
public RelevancyMeasures addFunction(RelevancyFunction... f) {
|
||||
for (RelevancyFunction function : f) {
|
||||
this.functions.add(function);
|
||||
function.prependLabels(this);
|
||||
DoubleSummaryGauge gauge = ActivityMetrics.summaryGauge(function, function.getUniqueName());
|
||||
this.gauges.add(gauge);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user