Class BiasedLockingRevocationRule
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.rules.jdk.latency.BiasedLockingRevocationRule
-
- All Implemented Interfaces:
IRule
public final class BiasedLockingRevocationRule extends java.lang.Object implements IRule
This rule is making use of the new dedicated biased locking revocation events available in JDK 10/18.3. It will fire whenever a class is excluded from biased lockings, or whenever there have been more than 15 revocations (can be configured) for a particular class.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<TypedPreference<?>>
CONFIG_ATTRIBUTES
private static TypedPreference<java.lang.String>
FILTERED_CLASSES
static TypedPreference<IQuantity>
MAX_NUMBER_OF_CLASSES_TO_REPORT
static TypedPreference<IQuantity>
WARNING_LIMIT
-
Constructor Summary
Constructors Constructor Description BiasedLockingRevocationRule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
calculateRevocationCountScore(java.util.List<ClassEntry> offendingClasses)
java.util.concurrent.RunnableFuture<Result>
evaluate(IItemCollection items, IPreferenceValueProvider valueProvider)
Gets a future representing the result of the evaluation of this rule.private java.util.Map<IMCType,ClassEntry>
extractRevocations(IItemCollection revokationEvents, IItemFilter filter, IAttribute<IMCType> classAttribute)
private java.util.Set<IMCType>
filter(java.util.Set<java.lang.String> filteredTypes, java.util.Set<IMCType> types)
private java.util.List<ClassEntry>
filteredMerge(java.util.Set<java.lang.String> filteredTypes, java.util.Set<IMCType> revokedTypes, java.util.Map<IMCType,ClassEntry> offendingClassRevocations, java.util.Map<IMCType,ClassEntry> offendingRevocations)
java.util.Collection<TypedPreference<?>>
getConfigurationAttributes()
Gets information about which attributes may be configured during rule evaluation.private static java.util.Set<java.lang.String>
getFilteredTypes(java.lang.String preferenceValue)
java.lang.String
getId()
java.lang.String
getName()
private Result
getResult(IItemCollection items, IPreferenceValueProvider valueProvider)
java.lang.String
getTopic()
private static void
putIfNotInFiltered(java.util.Set<java.lang.String> filteredTypes, java.util.Set<IMCType> revokedTypes, java.util.Map<IMCType,ClassEntry> merged, java.util.Map.Entry<IMCType,ClassEntry> entry)
-
-
-
Field Detail
-
WARNING_LIMIT
public static final TypedPreference<IQuantity> WARNING_LIMIT
-
MAX_NUMBER_OF_CLASSES_TO_REPORT
public static final TypedPreference<IQuantity> MAX_NUMBER_OF_CLASSES_TO_REPORT
-
FILTERED_CLASSES
private static final TypedPreference<java.lang.String> FILTERED_CLASSES
-
CONFIG_ATTRIBUTES
private static final java.util.List<TypedPreference<?>> CONFIG_ATTRIBUTES
-
-
Method Detail
-
getResult
private Result getResult(IItemCollection items, IPreferenceValueProvider valueProvider)
-
calculateRevocationCountScore
private int calculateRevocationCountScore(java.util.List<ClassEntry> offendingClasses)
-
filteredMerge
private java.util.List<ClassEntry> filteredMerge(java.util.Set<java.lang.String> filteredTypes, java.util.Set<IMCType> revokedTypes, java.util.Map<IMCType,ClassEntry> offendingClassRevocations, java.util.Map<IMCType,ClassEntry> offendingRevocations)
- Parameters:
filteredTypes
- user filtered typesrevokedTypes
- the types that were revoked during this recording.offendingClassRevocations
-offendingRevocations
-- Returns:
-
putIfNotInFiltered
private static void putIfNotInFiltered(java.util.Set<java.lang.String> filteredTypes, java.util.Set<IMCType> revokedTypes, java.util.Map<IMCType,ClassEntry> merged, java.util.Map.Entry<IMCType,ClassEntry> entry)
-
extractRevocations
private java.util.Map<IMCType,ClassEntry> extractRevocations(IItemCollection revokationEvents, IItemFilter filter, IAttribute<IMCType> classAttribute)
-
filter
private java.util.Set<IMCType> filter(java.util.Set<java.lang.String> filteredTypes, java.util.Set<IMCType> types)
-
getFilteredTypes
private static java.util.Set<java.lang.String> getFilteredTypes(java.lang.String preferenceValue)
-
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
-
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()
-
-