All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----intuitive.audit.Audit
Summary |
public class Audit extends java.lang.Object { // Fields 15 public static final int APPEND_TIME_TO_FILENAME; public static final int CPU_PROFILER; public static final int DEFAULT_OPTIONS; public static final int DEFAULT_PORT_NUMBER; public static final int DEFAULT_SNAPSHOT_OPTIONS; public static final int INCLUDE_CPU; public static final int INCLUDE_MEMORY; public static final int INCLUDE_REFERENCE_GRAPH; public static final int MEMORY_PROFILER; public static final int MEMORY_PROFILER_ALWAYS_DISABLED; public static final int PROFILERS_ALWAYS_ENABLED; public static final int SYSTEM_EXIT_DISABLED; public static final int WAIT_FOR_FILTERS; public static final int WAIT_FOR_OPTIMIZEIT; public static final String filterOptionsStr; // Constructors 1 public Audit(); // Methods 22 public static int buildVersion(); public static void createSamplerThreadForIBMVM(); public static void disableCPUProfiler(); public static void disableCPUProfiler(Thread); public static void disableCPUProfiler(ThreadGroup); public static void disableMemoryProfiler(); public static void disableMemoryProfiler(Thread); public static void disableMemoryProfiler(ThreadGroup); public static void enableCPUProfiler(); public static void enableCPUProfiler(Thread); public static void enableCPUProfiler(ThreadGroup); public static void enableMemoryProfiler(); public static void enableMemoryProfiler(Thread); public static void enableMemoryProfiler(ThreadGroup); public static void enableProfiler(Object, int, boolean); public static void generateSnapshot(int); public static void generateSnapshot(String, int); public static void generateSnapshot(String, String, int); public static native void invokeSamplerThread(); public static void main(String[]); public static void runGarbageCollector(); public static void start(int, int); }
The Audit class provides a collection of static methods to start and control OptimizeIt's memory and CPU profilers. When started this way, the audit system disables both profilers and wait the program to enable a profiler for a specific thread or thread group.
Fields |
· filterOptionsStr | Summary | Top |
public static final String filterOptionsStr
· DEFAULT_PORT_NUMBER | Summary | Top |
public static final int DEFAULT_PORT_NUMBER
Use this value when using start() and you want to use the default port number
See Also: start
· DEFAULT_OPTIONS | Summary | Top |
public static final int DEFAULT_OPTIONS
Use the following value when using start() and no option is required
See Also: start
· MEMORY_PROFILER_ALWAYS_DISABLED | Summary | Top |
public static final int MEMORY_PROFILER_ALWAYS_DISABLED
This option informs the audit system that the memory profiler will never be enabled for any thread. OptimizeIt's audit system uses this information to avoid allocating some resources and minimize overhead.
See Also: start
· SYSTEM_EXIT_DISABLED | Summary | Top |
public static final int SYSTEM_EXIT_DISABLED
This option causes OptimizeIt's audit system to disable any call to System.exit() Use this option if you never want the tested virtual machine to exit so you can collect some information from OptimizeIt even if your program exits.
See Also: start
· PROFILERS_ALWAYS_ENABLED | Summary | Top |
public static final int PROFILERS_ALWAYS_ENABLED
This option causes OptimizeIt's audit system to ignore the enable / disable API. CPU profiler will be enabled for all threads. Memory profiler will be enabled for all threads but if MEMORY_PROFILER_ALWAYS_DISABLED is set
· WAIT_FOR_OPTIMIZEIT | Summary | Top |
public static final int WAIT_FOR_OPTIMIZEIT
This option causes OptimizeIt's audit system to wait until it is contacted by OptimizeIt. The start() method will wait until OptimizeIt attachs to the tested virtual machine. The tested program will resume when the resume button is pressed in OptimizeIt
· WAIT_FOR_FILTERS | Summary | Top |
public static final int WAIT_FOR_FILTERS
This option causes OptimizeIt's audit system to wait until it is contacted by OptimizeIt. The start() method will wait until OptimizeIt attachs to the tested virtual machine and send the code filters.
· MEMORY_PROFILER | Summary | Top |
public static final int MEMORY_PROFILER
Constant representing the memory profiler
See Also: enableProfiler
· CPU_PROFILER | Summary | Top |
public static final int CPU_PROFILER
Constant representing the CPU profiler
See Also: enableProfiler
· DEFAULT_SNAPSHOT_OPTIONS | Summary | Top |
public static final int DEFAULT_SNAPSHOT_OPTIONS
Use the following value when using generateSnapshot().
See Also: generateSnapshot
· INCLUDE_MEMORY | Summary | Top |
public static final int INCLUDE_MEMORY
Use this value when using generateSnapshot() and you want to include memory profiler information in the snapshot.
See Also: generateSnapshot
· INCLUDE_CPU | Summary | Top |
public static final int INCLUDE_CPU
Use this value when using generateSnapshot() and you want to include CPU profiler information in the snapshot.
See Also: generateSnapshot
· INCLUDE_REFERENCE_GRAPH | Summary | Top |
public static final int INCLUDE_REFERENCE_GRAPH
Use this value when using generateSnapshot() and you want to include reference graph information in the snapshot. Note: The snapshots generated with that option are bigger files and take more time to be generated.
See Also: generateSnapshot
· APPEND_TIME_TO_FILENAME | Summary | Top |
public static final int APPEND_TIME_TO_FILENAME
Use this value if you want to append the date and time at the end of the snapshot file name.
See Also: generateSnapshot
Constructors |
· Audit | Summary | Top |
public Audit()
Default constructor
Methods |
· start | Summary | Top |
public static void start(int portNumber, int optionMask)
Start OptimizeIt's audit system.
portNumber
is the port number that should be used. If no specific port number is required, useDEFAULT_PORT_NUMBER
.optionMask
is a mask composed of boolean options. If no specific option is needed, you can useDEFAULT_OPTIONS
When started this way, OptimizeIt's audit system disables both the memory and the CPU profiler for all threads. Use the methods
enableProfiler
or one of its conveniences to enable profiling for a given thread. Note: this method does nothing if the audit system is already running. Note: even when you start the audit system that way, you need to disable class garbage collection when starting the virtual machine. Use -noclassgc with 1.1 virtual machines and -Xnoclassgc with 1.2 virtual machines.
See Also: DEFAULT_PORT_NUMBER, DEFAULT_OPTIONS
· enableProfiler | Summary | Top |
public static void enableProfiler(Object threadOrThreadGroup, int profilerKind, boolean isEnabled)
Enable or disable the memory and/or the CPU profiler for a given thread or thread group.
If
threadOrThreadGroup
is a thread group, this action will apply to all threads and sub thread groups belonging tothreadOrThreadGroup
If
threadOrThreadGroup
is a thread, this action will only apply to that thread.
profilerKind
contains a mask that describes which profiler should be affected by this action. Current possible values include MEMORY_PROFILER, CPU_PROFILER or (MEMORY_PROFILER | CPU_PROFILER).if
isEnabled
is true, the corresponding profilers will become enabled for the given thread or thread group. If false the corresponding profiler will become disabled.Enabling a profiler for a thread means marking that thread as a thread to be profiled when the profiler runs. This action is different from starting the CPU profiler from OptimizeIt's UI which starts CPU profiling for all eligible threads.
Note: Multiple enable calls can be nested. If a profiler is enabled more than one time, it should be disable a corresponding number of times before becoming effectively disabled.
· enableMemoryProfiler | Summary | Top |
public static void enableMemoryProfiler(ThreadGroup aGroup)
Convenience that enables the memory profiler for a given thread group
· enableMemoryProfiler | Summary | Top |
public static void enableMemoryProfiler(Thread aThread)
Convenience that enables the memory profiler for a given thread
· enableMemoryProfiler | Summary | Top |
public static void enableMemoryProfiler()
Convenience that enables the memory profiler for the calling thread
· disableMemoryProfiler | Summary | Top |
public static void disableMemoryProfiler(ThreadGroup aThreadGroup)
Convenience that disables the memory profiler for a given thread group.
· disableMemoryProfiler | Summary | Top |
public static void disableMemoryProfiler(Thread aThread)
Convenience that disables the memory profiler for a given thread
· disableMemoryProfiler | Summary | Top |
public static void disableMemoryProfiler()
Convenience that disables the memory profiler for the calling thread
· enableCPUProfiler | Summary | Top |
public static void enableCPUProfiler(ThreadGroup aGroup)
Convenience that enables the CPU profiler for a given thread group
· enableCPUProfiler | Summary | Top |
public static void enableCPUProfiler(Thread aThread)
Convenience that enables the CPU profiler for a given thread
· enableCPUProfiler | Summary | Top |
public static void enableCPUProfiler()
Convenience that enables the CPU profiler for the calling thread
· disableCPUProfiler | Summary | Top |
public static void disableCPUProfiler(ThreadGroup aThreadGroup)
Convenience that disables the CPU profiler for a given thread group.
· disableCPUProfiler | Summary | Top |
public static void disableCPUProfiler(Thread aThread)
Convenience that disables the CPU profiler for a given thread
· disableCPUProfiler | Summary | Top |
public static void disableCPUProfiler()
Convenience that disables the CPU profiler for the calling thread
· runGarbageCollector | Summary | Top |
public static void runGarbageCollector()
This method runs the garbage collector even if the "Disable Garbage Collector" option in Optimizeit is checked
· generateSnapshot | Summary | Top |
public static void generateSnapshot(String directory, String filename, int optionMask)
Generates a snapshot.
directory
is the directory where the snapshoty is generated.filename
is the name used for the snapshot.optionMask
is a mask composed of boolean options. If no specific option is needed, you can useDEFAULT_SNAPSHOT_OPTIONS
When generated this way the snapshot includes memory and CPU information, does not include the reference information and append the date and time at the end of the snapshot filename.
· generateSnapshot | Summary | Top |
public static void generateSnapshot(String filename, int optionMask)
Generates a snapshot in the current directory.
filename
is the name used for the snapshot.optionMask
is a mask composed of boolean options. If no specific option is needed, you can useDEFAULT_SNAPSHOT_OPTIONS
When generated this way the snapshot includes memory and CPU information, does not include the reference information and append the date and time at the end of the snapshot filename.
· generateSnapshot | Summary | Top |
public static void generateSnapshot(int optionMask)
Generates a snapshot in the current directory using a default name.
optionMask
is a mask composed of boolean options. If no specific option is needed, you can useDEFAULT_SNAPSHOT_OPTIONS
When generated this way the snapshot includes memory and CPU information, does not include the reference information and append the date and time at the end of the snapshot filename. Note: the name used is snapshot.
· buildVersion | Summary | Top |
public static int buildVersion()
This method returns the build number of the audit system.
· main | Summary | Top |
public static void main(String[] args)
This method is the audit system main entry point. It is public for some implementation reasons. Do not call this method.
· invokeSamplerThread | Summary | Top |
public static native void invokeSamplerThread()
The following is a workaround for the IBM vm. This is to avoid a null pointer exception that happens when creating the sampler thread when initializing the system from the audit api
· createSamplerThreadForIBMVM | Summary | Top |
public static void createSamplerThreadForIBMVM()
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7