com.undefinedlabs.scope.rules.extractor.TimePerOpScopeBenchmarkStatisticsExtractor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scope-rule-java-jmh Show documentation
Show all versions of scope-rule-java-jmh Show documentation
Scope is a APM for tests to give engineering teams unprecedented visibility into their CI process to quickly
identify, troubleshoot and fix failed builds.
This artifact contains the classes to instrument the Java JMH Benchmark Framework.
package com.undefinedlabs.scope.rules.extractor;
import com.undefinedlabs.scope.rules.model.ScopeBenchmarkStatistics;
import org.openjdk.jmh.results.Result;
import org.openjdk.jmh.util.Statistics;
public class TimePerOpScopeBenchmarkStatisticsExtractor
extends AbstractScopeBenchmarkStatisticsExtractor {
public static final ScopeBenchmarkStatisticsExtractor INSTANCE =
new TimePerOpScopeBenchmarkStatisticsExtractor();
private TimePerOpScopeBenchmarkStatisticsExtractor() {}
@Override
public ScopeBenchmarkStatistics extract(final Result result) {
final ScopeBenchmarkStatistics.Builder builder = newBuilder();
final Statistics jmhStats = result.getStatistics();
builder.withSampleCount(result.getSampleCount());
builder.withScore(result.getScore());
builder.withScoreConfidence(result.getScoreConfidence());
builder.withScoreError(result.getScore());
if (jmhStats != null) {
builder.withMin(jmhStats.getMin());
builder.withMean(jmhStats.getMean());
builder.withMax(jmhStats.getMax());
builder.withStdDev(jmhStats.getStandardDeviation());
builder.withVariance(jmhStats.getVariance());
builder.withP00(jmhStats.getPercentile(0));
builder.withP50(jmhStats.getPercentile(50));
builder.withP90(jmhStats.getPercentile(90));
builder.withP95(jmhStats.getPercentile(95));
builder.withP99(jmhStats.getPercentile(99));
builder.withP100(jmhStats.getPercentile(100));
}
return builder.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy