quick fix for missing labels in measures

This commit is contained in:
Jonathan Shook 2023-09-11 18:39:26 -05:00
parent c0171dcec6
commit b3b361b30a
4 changed files with 11 additions and 4 deletions

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}