本文整理汇总了Java中org.databene.contiperf.PerformanceRequirement.getAverage方法的典型用法代码示例。如果您正苦于以下问题:Java PerformanceRequirement.getAverage方法的具体用法?Java PerformanceRequirement.getAverage怎么用?Java PerformanceRequirement.getAverage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.databene.contiperf.PerformanceRequirement
的用法示例。
在下文中一共展示了PerformanceRequirement.getAverage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printAverageStats
import org.databene.contiperf.PerformanceRequirement; //导入方法依赖的package包/类
private static void printAverageStats(LatencyCounter[] counters,
PerformanceRequirement requirement, PrintWriter out) {
Verdict verdict = ReportUtil.averageVerdict(counters[0], requirement);
Long required = (requirement != null && requirement.getAverage() > 0 ? (long) requirement
.getAverage() : null);
long[] secondaryValues = null;
if (counters.length > 1) {
secondaryValues = new long[counters.length - 1];
for (int i = 1; i < counters.length; i++) {
secondaryValues[i - 1] = (long) counters[i].averageLatency();
}
}
printStatMsLine("Average latency:",
(long) counters[0].averageLatency(), required, secondaryValues,
verdict, out);
}
示例2: averageVerdict
import org.databene.contiperf.PerformanceRequirement; //导入方法依赖的package包/类
public static Verdict averageVerdict(LatencyCounter counter,
PerformanceRequirement requirement) {
if (requirement == null || requirement.getAverage() < 0
|| counter.getAssertionErrors().size() > 0) {
return Verdict.IGNORED;
}
return (counter.averageLatency() <= requirement.getAverage() ? Verdict.SUCCESS
: Verdict.FAILURE);
}