Skip to content

Commit

Permalink
quick fix for missing labels in measures
Browse files Browse the repository at this point in the history
  • Loading branch information
jshook committed Sep 11, 2023
1 parent c0171dc commit b3b361b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,4 +37,10 @@ public NBLabels getLabels() {
public String getName() {
return this.name;
}

@Override
public void prependLabels(NBLabeledElement prepend) {
this.labels = prepend.getLabels().and(this.labels);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public NBLabels getLabels() {
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);
}
Expand Down

0 comments on commit b3b361b

Please sign in to comment.