Class MethodProfilingRule
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
MethodProfilingRule.MethodProfilingCallable
Private Callable implementation specifically used to avoid storing the FutureTask as a field.private static class
MethodProfilingRule.MethodProfilingWindowResult
private static class
MethodProfilingRule.PeriodRangeMap
A simple class for storing execution sample period settings, allowing the sliding window to get the correct samples for each time slice.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<TypedPreference<?>>
CONFIG_ATTRIBUTES
static TypedPreference<java.lang.String>
EXCLUDED_PACKAGE_REGEXP
private static int
MAX_STACK_DEPTH
Constant value of the maximum number of stack frames to display for the hottest path.private static java.lang.String
RESULT_ID
private static double
SAMPLES_PER_PERIOD
Constant value of the maximum number of samples the JVM attempts per sampling period.static TypedPreference<IQuantity>
WINDOW_SIZE
-
Constructor Summary
Constructors Constructor Description MethodProfilingRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
buildResultList(java.util.Map<IMCStackTrace,MethodProfilingRule.MethodProfilingWindowResult> percentByMethod)
private SlidingWindowToolkit.IUnorderedWindowVisitor
createWindowVisitor(MethodProfilingRule.PeriodRangeMap settings, IItemFilter settingsFilter, IQuantity windowSize, java.util.List<MethodProfilingRule.MethodProfilingWindowResult> rawScores, java.util.concurrent.FutureTask<Result> evaluationTask, java.util.regex.Pattern excludes)
Creates an IUnorderedWindowVisitor that is called on each slice in the recording and generates the scores for each slice and places them in the rawScores list.java.util.concurrent.RunnableFuture<Result>
evaluate(IItemCollection items, IPreferenceValueProvider valueProvider)
Gets a future representing the result of the evaluation of this rule.java.util.Collection<TypedPreference<?>>
getConfigurationAttributes()
Gets information about which attributes may be configured during rule evaluation.java.lang.String
getId()
private Pair<MethodProfilingRule.MethodProfilingWindowResult,java.util.Map<IMCStackTrace,MethodProfilingRule.MethodProfilingWindowResult>>
getInterestingMethods(java.util.List<MethodProfilingRule.MethodProfilingWindowResult> windowResults)
java.lang.String
getName()
private Result
getResult(IItemCollection items, IPreferenceValueProvider valueProvider, java.util.concurrent.FutureTask<Result> evaluationTask)
java.lang.String
getTopic()
private IQuantity
getValueQuantity(java.lang.String settingValue)
Used to parse the value of a Recording Setting Period attributeprivate double
performSigmoidMap(double input)
private void
populateSettingsMap(IItemCollection items, MethodProfilingRule.PeriodRangeMap settings)
Populates the settings map with all the period settings for the execution sample event found in this recording.
-
-
-
Field Detail
-
SAMPLES_PER_PERIOD
private static final double SAMPLES_PER_PERIOD
Constant value of the maximum number of samples the JVM attempts per sampling period.- See Also:
- Constant Field Values
-
MAX_STACK_DEPTH
private static final int MAX_STACK_DEPTH
Constant value of the maximum number of stack frames to display for the hottest path.- See Also:
- Constant Field Values
-
RESULT_ID
private static final java.lang.String RESULT_ID
- See Also:
- Constant Field Values
-
WINDOW_SIZE
public static final TypedPreference<IQuantity> WINDOW_SIZE
-
EXCLUDED_PACKAGE_REGEXP
public static final TypedPreference<java.lang.String> EXCLUDED_PACKAGE_REGEXP
-
CONFIG_ATTRIBUTES
private static final java.util.List<TypedPreference<?>> CONFIG_ATTRIBUTES
-
-
Method Detail
-
evaluate
public java.util.concurrent.RunnableFuture<Result> evaluate(IItemCollection items, IPreferenceValueProvider valueProvider)
Description copied from interface:IRule
Gets a future representing the result of the evaluation of this rule. Running the RunnableFuture is the responsibility of the caller of this method, not the implementation.- Specified by:
evaluate
in interfaceIRule
- Parameters:
items
- items to evaluatevalueProvider
- Provider of configuration values used for evaluation. The attributes that will be asked for from the provider should be provided byIRule.getConfigurationAttributes()
.- Returns:
- a RunnableFuture that when run will return the evaluation result
-
getResult
private Result getResult(IItemCollection items, IPreferenceValueProvider valueProvider, java.util.concurrent.FutureTask<Result> evaluationTask)
-
buildResultList
private java.lang.String buildResultList(java.util.Map<IMCStackTrace,MethodProfilingRule.MethodProfilingWindowResult> percentByMethod)
-
getInterestingMethods
private Pair<MethodProfilingRule.MethodProfilingWindowResult,java.util.Map<IMCStackTrace,MethodProfilingRule.MethodProfilingWindowResult>> getInterestingMethods(java.util.List<MethodProfilingRule.MethodProfilingWindowResult> windowResults)
-
performSigmoidMap
private double performSigmoidMap(double input)
-
createWindowVisitor
private SlidingWindowToolkit.IUnorderedWindowVisitor createWindowVisitor(MethodProfilingRule.PeriodRangeMap settings, IItemFilter settingsFilter, IQuantity windowSize, java.util.List<MethodProfilingRule.MethodProfilingWindowResult> rawScores, java.util.concurrent.FutureTask<Result> evaluationTask, java.util.regex.Pattern excludes)
Creates an IUnorderedWindowVisitor that is called on each slice in the recording and generates the scores for each slice and places them in the rawScores list. The given parameters that are also given to the slidingWindowUnordered call must be the same as in this call.- Parameters:
settings
- the settings map with all the times the execution sample event has a change of periodicitysettingsFilter
- the filter used to select the recording setting for the execution sample eventwindowSize
- the size of the sliding windowrawScores
- the list of raw scores that will be populated by this visitor- Returns:
- an IUnorderedWindowVisitor implementation that will populate the rawScores list with raw score values
-
populateSettingsMap
private void populateSettingsMap(IItemCollection items, MethodProfilingRule.PeriodRangeMap settings)
Populates the settings map with all the period settings for the execution sample event found in this recording.- Parameters:
items
- the items to search for execution sample period eventssettings
- the map to populate with the events
-
getValueQuantity
private IQuantity getValueQuantity(java.lang.String settingValue)
Used to parse the value of a Recording Setting Period attribute- Parameters:
settingValue
- the value to parse- Returns:
- an IQuantity representation of the passed String object
-
getConfigurationAttributes
public java.util.Collection<TypedPreference<?>> getConfigurationAttributes()
Description copied from interface:IRule
Gets information about which attributes may be configured during rule evaluation.- Specified by:
getConfigurationAttributes
in interfaceIRule
- Returns:
- a list of configuration attributes
-
getId
public java.lang.String getId()
-
getName
public java.lang.String getName()
-
-