< prev index next >

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/latency/MethodProfilingRule.java

Print this page

        

*** 174,184 **** UnitLookup.SECOND.quantity(30)); public static final TypedPreference<String> EXCLUDED_PACKAGE_REGEXP = new TypedPreference<>( "method.profiling.evaluation.excluded.package", //$NON-NLS-1$ Messages.getString(Messages.MethodProfilingRule_EXCLUDED_PACKAGES), Messages.getString(Messages.MethodProfilingRule_EXCLUDED_PACKAGES_DESC), ! UnitLookup.PLAIN_TEXT.getPersister(), "java\\.(lang|util)"); private static final List<TypedPreference<?>> CONFIG_ATTRIBUTES = Arrays.<TypedPreference<?>> asList(WINDOW_SIZE, EXCLUDED_PACKAGE_REGEXP); /** * Private Callable implementation specifically used to avoid storing the FutureTask as a field. */ --- 174,184 ---- UnitLookup.SECOND.quantity(30)); public static final TypedPreference<String> EXCLUDED_PACKAGE_REGEXP = new TypedPreference<>( "method.profiling.evaluation.excluded.package", //$NON-NLS-1$ Messages.getString(Messages.MethodProfilingRule_EXCLUDED_PACKAGES), Messages.getString(Messages.MethodProfilingRule_EXCLUDED_PACKAGES_DESC), ! UnitLookup.PLAIN_TEXT.getPersister(), "java\\.(lang|util)"); //$NON-NLS-1$ private static final List<TypedPreference<?>> CONFIG_ATTRIBUTES = Arrays.<TypedPreference<?>> asList(WINDOW_SIZE, EXCLUDED_PACKAGE_REGEXP); /** * Private Callable implementation specifically used to avoid storing the FutureTask as a field. */
*** 230,240 **** Pattern excludes; try { excludes = Pattern.compile(excludedPattern); } catch (Exception e) { // Make sure we don't blow up on an invalid pattern. ! excludes = Pattern.compile(""); } List<MethodProfilingWindowResult> windowResults = new ArrayList<>(); IUnorderedWindowVisitor visitor = createWindowVisitor(settings, settingsFilter, windowSize, windowResults, evaluationTask, excludes); SlidingWindowToolkit.slidingWindowUnordered(visitor, items, windowSize, slideSize); --- 230,240 ---- Pattern excludes; try { excludes = Pattern.compile(excludedPattern); } catch (Exception e) { // Make sure we don't blow up on an invalid pattern. ! excludes = Pattern.compile(""); //$NON-NLS-1$ } List<MethodProfilingWindowResult> windowResults = new ArrayList<>(); IUnorderedWindowVisitor visitor = createWindowVisitor(settings, settingsFilter, windowSize, windowResults, evaluationTask, excludes); SlidingWindowToolkit.slidingWindowUnordered(visitor, items, windowSize, slideSize);
*** 399,409 **** private Pair<IQuantity, IMCStackTrace> performCalculation(IItemCollection items, IQuantity period) { IItemCollection filteredItems = items.apply(JdkFilters.EXECUTION_SAMPLE); final IMCMethod[] maxMethod = new IMCMethod[1]; final IMCStackTrace[] maxPath = new IMCStackTrace[1]; // Using this GroupingAggregator because it's the only way to extract the keys from the aggregation along with values ! IAggregator<IQuantity, ?> aggregator = GroupingAggregator.build("", "", //$NON-NLS-1$ //$NON_NLS_2$ MethodProfilingDataProvider.PATH_ACCESSOR_FACTORY, Aggregators.count(), new GroupingAggregator.IGroupsFinisher<IQuantity, IMCStackTrace, CountConsumer>() { @Override public IType<IQuantity> getValueType() { --- 399,409 ---- private Pair<IQuantity, IMCStackTrace> performCalculation(IItemCollection items, IQuantity period) { IItemCollection filteredItems = items.apply(JdkFilters.EXECUTION_SAMPLE); final IMCMethod[] maxMethod = new IMCMethod[1]; final IMCStackTrace[] maxPath = new IMCStackTrace[1]; // Using this GroupingAggregator because it's the only way to extract the keys from the aggregation along with values ! IAggregator<IQuantity, ?> aggregator = GroupingAggregator.build("", "", //$NON-NLS-1$ //$NON-NLS-2$ MethodProfilingDataProvider.PATH_ACCESSOR_FACTORY, Aggregators.count(), new GroupingAggregator.IGroupsFinisher<IQuantity, IMCStackTrace, CountConsumer>() { @Override public IType<IQuantity> getValueType() {
*** 452,462 **** List<IMCFrame> framesToDrop = new ArrayList<IMCFrame>(); // Drop any frames that match the excluded pattern, thereby treating the first non-matching frame that we encounter as the hot one. for (IMCFrame frame : frames) { IMCPackage p = frame.getMethod().getType().getPackage(); // Under some circumstances p.getName() will return a raw null, we need to handle this case. ! Matcher m = excludes.matcher(p.getName() == null ? "" : p.getName()); if (m.matches()) { framesToDrop.add(frame); } else { break; } --- 452,462 ---- List<IMCFrame> framesToDrop = new ArrayList<IMCFrame>(); // Drop any frames that match the excluded pattern, thereby treating the first non-matching frame that we encounter as the hot one. for (IMCFrame frame : frames) { IMCPackage p = frame.getMethod().getType().getPackage(); // Under some circumstances p.getName() will return a raw null, we need to handle this case. ! Matcher m = excludes.matcher(p.getName() == null ? "" : p.getName()); //$NON-NLS-1$ if (m.matches()) { framesToDrop.add(frame); } else { break; }
< prev index next >