Class Profiler
java.lang.Object
org.matwoess.jsourceprofiler.tool.profile.Profiler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCompiles the main instrumented file and output it to theclassesdirectory.voidCreates a symbolic link to the main report index file in the current directory.voidGenerates the report from the metadata and counts files.voidRuns the instrumented and compiled main file with the given program arguments.
-
Constructor Details
-
Profiler
Creates a newProfilerobject with the given main file and an array of additional files to profile.- Parameters:
mainJavaFile- the main file to profileadditionalJavaFiles- the additional dependent project files to profile
-
-
Method Details
-
compileInstrumented
public void compileInstrumented()Compiles the main instrumented file and output it to theclassesdirectory. Thejavactool will automatically compile all referenced instrumented java files. The working directory is not changed during this process. -
profile
Runs the instrumented and compiled main file with the given program arguments.The name of the class file is determined by the relative path of the main file and removing the
.javaextension.- Parameters:
programArgs- the program arguments to pass to the main method
-
generateReport
public void generateReport()Generates the report from the metadata and counts files.Before creation, the hit counts are added to the blocks from the counts file data.
First the report directory is cleared. Then the following files are written:
- the index file
- the source files
- the method index files for each class in the source files
copyReportResources(). -
createLinkForReport
public void createLinkForReport()Creates a symbolic link to the main report index file in the current directory. Should work on Linux and macOS but might not work on Windows, depending on group policy rules.
-