Class InstrumentationControl


  • public class InstrumentationControl
    extends Object
    Controls whether or not a given Java class is instrumented. To that end, it uses a couple of blacklists and whitelists read from the configuration. Moreover, it maintains statistics to report on the overall number of classes and constructs instrumented.
    See Also:
    DynamicTransformer, JarAnalyzer, WarAnalyzer
    • Method Detail

      • updateInstrumentationStatistics

        public void updateInstrumentationStatistics​(JavaId _jcid,
                                                    Boolean _instr_successful)
        Updates the statistics depending on whether the instrumentation of the given Java class succeeded or not.
        Parameters:
        _jcid - the class that was instrumented successfully or not
        _instr_successful - null if the class was already instrumented, or true/false if the instrumentation was done in this transformer
      • logStatistics

        public void logStatistics()
        Logs various statistics, depending on the log level. Called by UploadScheduler.run().
      • isBlacklistedJar

        public boolean isBlacklistedJar​(URL _url)
        Returns true if the JAR at the specified path is blacklisted, false otherwise. A JAR is blacklisted if the file name matches any of the patterns specified with configuration parameter instr.blacklist.jars, or if it resides in a directory (or subdirectory) of any of the paths specified with instr.blacklist.dirs.
        Parameters:
        _url - a URL object.
        Returns:
        a boolean.
      • isBlacklistedClass

        public boolean isBlacklistedClass​(String _qname)
        Returns true if the class with the specified qualified name is blacklisted, false otherwise. A qualified name is blacklisted if its package (or any of its parent packages) is specified as part of the configuration parameters instr.blacklist.classes.jre or instr.blacklist.classes.custom.
        Parameters:
        _qname - a String object.
        Returns:
        a boolean.
      • countClassesTotal

        public int countClassesTotal()
        Returns the total number of classes looked at.
        Returns:
        a int.
      • getFailedInstrumentations

        public Set<JavaId> getFailedInstrumentations()
        Returns the classes which could not be instrumented, hence, for which no traces or other information could be collected.
        Returns:
        a Set object.
      • getOverallStatistics

        public static Map<String,​Long> getOverallStatistics()

        getOverallStatistics.

        Returns:
        a Map object.
      • logOverallStatistics

        public static void logOverallStatistics()

        logOverallStatistics.