Modifier and Type | Class and Description |
---|---|
private class |
MethodProfilingRule.MethodProfilingCallable
Private Callable implementation specifically used to avoid storing the
FutureTask as a field.
|
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.
|
Constructor and Description |
---|
MethodProfilingRule() |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.RunnableFuture<IResult> |
createEvaluation(IItemCollection items,
IPreferenceValueProvider valueProvider,
IResultValueProvider resultProvider)
Gets a future representing the result of the evaluation of this rule.
|
private SlidingWindowToolkit.IUnorderedWindowVisitor |
createWindowVisitor(MethodProfilingRule.PeriodRangeMap settings,
IItemFilter settingsFilter,
IQuantity windowSize,
java.util.List<MethodProfilingRule.MethodProfilingWindowResult> rawScores,
java.util.concurrent.FutureTask<IResult> 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.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() |
java.util.Map<java.lang.String,RulesToolkit.EventAvailability> |
getRequiredEvents() |
private IResult |
getResult(IItemCollection items,
IPreferenceValueProvider valueProvider,
IResultValueProvider resultProvider,
java.util.concurrent.FutureTask<IResult> evaluationTask) |
java.util.Collection<TypedResult<?>> |
getResults()
Gets information about which results may be part of an
IResult instance. |
java.lang.String |
getTopic() |
private IQuantity |
getValueQuantity(java.lang.String settingValue)
Used to parse the value of a Recording Setting Period attribute
|
private 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.
|
private static final double SAMPLES_PER_PERIOD
public static final ContentType<MethodProfilingRule.MethodProfilingWindowResult> METHOD_PROFILING_WINDOW_RESULT
public static final TypedResult<IMCMethod> MOST_INTERESTING_METHOD
public static final TypedResult<IMCStackTrace> MOST_INTERESTING_STACKTRACE
public static final TypedResult<IQuantity> RATIO_OF_ALL_POSSIBLE_SAMPLES
public static final TypedResult<IQuantity> RATIO_OF_ACTUAL_SAMPLES
public static final TypedResult<IRange<IQuantity>> MOST_INTERESTING_WINDOW
public static final TypedCollectionResult<MethodProfilingRule.MethodProfilingWindowResult> INTERESTING_METHODS
private static final java.lang.String RESULT_ID
public static final TypedPreference<IQuantity> WINDOW_SIZE
public static final TypedPreference<java.lang.String> EXCLUDED_PACKAGE_REGEXP
private static final java.util.List<TypedPreference<?>> CONFIG_ATTRIBUTES
private static final java.util.Collection<TypedResult<?>> RESULT_ATTRIBUTES
private static final java.util.Map<java.lang.String,RulesToolkit.EventAvailability> REQUIRED_EVENTS
public java.util.concurrent.RunnableFuture<IResult> createEvaluation(IItemCollection items, IPreferenceValueProvider valueProvider, IResultValueProvider resultProvider)
IRule
createEvaluation
in interface IRule
items
- items to evaluatevalueProvider
- Provider of configuration values used for evaluation. The attributes that will be
asked for from the provider should be provided by
IRule.getConfigurationAttributes()
.resultProvider
- Provider of results from rules evaluated prior to this rule and which this rule
explicitly depends on via a DependsOn
annotation. The attributes that will
be asked for from the provider will be provided by each dependant rule, e.g. via
public static constants.private IResult getResult(IItemCollection items, IPreferenceValueProvider valueProvider, IResultValueProvider resultProvider, java.util.concurrent.FutureTask<IResult> evaluationTask)
private Pair<MethodProfilingRule.MethodProfilingWindowResult,java.util.Map<IMCStackTrace,MethodProfilingRule.MethodProfilingWindowResult>> getInterestingMethods(java.util.List<MethodProfilingRule.MethodProfilingWindowResult> windowResults)
private double performSigmoidMap(double input)
private SlidingWindowToolkit.IUnorderedWindowVisitor createWindowVisitor(MethodProfilingRule.PeriodRangeMap settings, IItemFilter settingsFilter, IQuantity windowSize, java.util.List<MethodProfilingRule.MethodProfilingWindowResult> rawScores, java.util.concurrent.FutureTask<IResult> evaluationTask, java.util.regex.Pattern excludes)
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 visitorprivate void populateSettingsMap(IItemCollection items, MethodProfilingRule.PeriodRangeMap settings)
items
- the items to search for execution sample period eventssettings
- the map to populate with the eventsprivate IQuantity getValueQuantity(java.lang.String settingValue)
settingValue
- the value to parsepublic java.util.Collection<TypedPreference<?>> getConfigurationAttributes()
IRule
getConfigurationAttributes
in interface IRule
public java.lang.String getId()
public java.lang.String getName()
public java.lang.String getTopic()
public java.util.Map<java.lang.String,RulesToolkit.EventAvailability> getRequiredEvents()
getRequiredEvents
in interface IRule
RulesToolkit.EventAvailability
this rule
requires for that event typepublic java.util.Collection<TypedResult<?>> getResults()
IRule
IResult
instance.getResults
in interface IRule