public void process(Matcher matcher) { RuleStats ruleStats = (RuleStats) matcher.getTag(); int rematches = 0, remismatches = 0; for (Integer i : ruleStats.positionMatches.values()) { if (i > 0) { rematches += i - 1; } else if (i < 0) { remismatches += -(i + 1); } } totalMatches += ruleStats.matches; totalMismatches += ruleStats.mismatches; totalRematches += rematches; totalRemismatches += remismatches; RuleReport ruleReport = ruleReports.get(matcher); if (ruleReport == null) { ruleReport = new RuleReport(matcher); ruleReports.put(matcher, ruleReport); } ruleReport.update(ruleStats.matches, ruleStats.matchSubs, ruleStats.mismatches, ruleStats.mismatchSubs, rematches, ruleStats.rematchSubs, remismatches, ruleStats.remismatchSubs, ruleStats.nanoTime); } };
"%-30s | %6.0f ms | %6s / %6s | %6s / %6s | %6s / %6s | %,12.0f ns | %6.2f%% | %6s / %6s | %6s / %6s | %6s / %6s | %6.2f%% / %6.2f%%\n", StringUtils.left( rep.getMatcher().toString() + ": " + rep.getMatcher().getClass().getSimpleName() .replace("Matcher", ""), 30), rep.getNanoTime() / 1000000.0, humanize(rep.getInvocations()), humanize(rep.getInvocationSubs()), humanize(rep.getMatches()), humanize(rep.getMatchSubs()), humanize(rep.getMismatches()), humanize(rep.getMismatchSubs()), rep.getNanoTime() / (double) rep.getInvocations(), rep.getMatchShare() * 100, humanize(rep.getReinvocations()), humanize(rep.getReinvocationSubs()), humanize(rep.getRematches()), humanize(rep.getRematchSubs()), humanize(rep.getRemismatches()), humanize(rep.getRemismatchSubs()), rep.getReinvocationShare() * 100, rep.getReinvocationShare2() * 100 ));
public double getReinvocationShare() { return ((double) getReinvocations()) / getInvocations(); }
public double getReinvocationShare2() { return ((double) getReinvocationSubs()) / getInvocationSubs(); }
public double getMatchShare() { return ((double) matches) / getInvocations(); }
public double getMatchShare2() { return ((double) matchSubs) / getInvocationSubs(); }
public int compare(RuleReport a, RuleReport b) { return intCompare(a.getInvocations(), b.getInvocations()); } });
public int compare(RuleReport a, RuleReport b) { return longCompare(a.getNanoTime(), b.getNanoTime()); } });
public int compare(RuleReport a, RuleReport b) { return intCompare(a.getMatches(), b.getMatches()); } });
public int compare(RuleReport a, RuleReport b) { return intCompare(a.getMismatches(), b.getMismatches()); } });
public int compare(RuleReport a, RuleReport b) { return intCompare(a.getInvocationSubs(), b.getInvocationSubs()); } });
public int compare(RuleReport a, RuleReport b) { return doubleCompare(a.getNanoTime() / (double) a.getInvocations(), b.getNanoTime() / (double) b.getInvocations()); } });
public boolean apply(RuleReport rep) { return rep.getMatcher().hasCustomLabel(); } };