remove result size from base op

This commit is contained in:
Jonathan Shook 2023-09-07 10:03:24 -05:00
parent be4ef9c34f
commit 55ef2cff4a
5 changed files with 4 additions and 12 deletions

View File

@ -54,8 +54,4 @@ public class MongoDirectCommandOp implements CycleOp<Document> {
return document;
}
@Override
public long getResultSize() {
return resultSize;
}
}

View File

@ -16,7 +16,6 @@
package io.nosqlbench.adapters.api.activityimpl;
import com.codahale.metrics.Histogram;
import com.codahale.metrics.Timer;
import groovy.lang.Binding;
import io.nosqlbench.adapters.api.activityimpl.uniform.DriverAdapter;
@ -59,7 +58,6 @@ public abstract class BaseOpDispenser<T extends Op, S> implements OpDispenser<T>
protected final DriverAdapter<T, S> adapter;
private final NBLabels labels;
private boolean instrument;
private Histogram resultSizeHistogram;
private Timer successTimer;
private Timer errorTimer;
private final String[] timerStarts;
@ -181,7 +179,6 @@ public abstract class BaseOpDispenser<T extends Op, S> implements OpDispenser<T>
final int hdrDigits = pop.getStaticConfigOr("hdr_digits", 4).intValue();
successTimer = ActivityMetrics.timer(pop, "success", hdrDigits);
errorTimer = ActivityMetrics.timer(pop, "error", hdrDigits);
resultSizeHistogram = ActivityMetrics.histogram(pop, "resultset_size", hdrDigits);
}
}
@ -191,10 +188,9 @@ public abstract class BaseOpDispenser<T extends Op, S> implements OpDispenser<T>
}
@Override
public void onSuccess(final long cycleValue, final long nanoTime, final long resultSize) {
public void onSuccess(final long cycleValue, final long nanoTime) {
if (this.instrument) {
this.successTimer.update(nanoTime, TimeUnit.NANOSECONDS);
if (-1 < resultSize) this.resultSizeHistogram.update(resultSize);
}
if (null != timerStops) ThreadLocalNamedTimers.TL_INSTANCE.get().stop(this.timerStops);
}

View File

@ -18,6 +18,6 @@ package io.nosqlbench.adapters.api.activityimpl;
public interface OpResultTracker {
void onStart(long cycleValue);
void onSuccess(long cycleValue, long nanoTime, long resultsize);
void onSuccess(long cycleValue, long nanoTime);
void onError(long cycleValue, long resultNanos, Throwable t);
}

View File

@ -33,5 +33,5 @@ package io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes;
* </p>
*/
// TODO: optimize the runtime around the specific op type
public interface Op extends OpResultSize {
public interface Op {
}

View File

@ -127,7 +127,7 @@ public class StandardAction<A extends StandardActivity<R, ?>, R extends Op> impl
resultTimer.update(nanos, TimeUnit.NANOSECONDS);
if (error == null) {
resultSuccessTimer.update(nanos, TimeUnit.NANOSECONDS);
dispenser.onSuccess(cycle, nanos, op.getResultSize());
dispenser.onSuccess(cycle, nanos);
break;
} else {
ErrorDetail detail = errorHandler.handleError(error, cycle, nanos);