Skip to content

7orivorian/RuntimeProfiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RuntimeProfiler

GitHub release (latest SemVer) Maven Central Version GitHub License GitHub Downloads (all assets, all releases)

Performance monitoring for Java applications through execution time tracking and data export.

Features

  • Easy integration & usage.
    • Seamlessly add profiling capabilities to your Java projects with only a few lines of code.
  • Context switching:
    • Compare performance between different code sections.
  • Detailed data export:
    • Output profiling data for in-depth analysis, reporting, & graphing.

Importing

Maven

<dependency>
    <groupId>dev.7ori</groupId>
    <artifactId>runtimeprofiler</artifactId>
    <version>2.1.0</version>
</dependency>

Gradle

dependencies {
    implementation 'dev.7ori:runtimeprofiler:2.1.0'
}

Other

Download a .jar file from releases.

Building

  • Clone this repository
  • Run mvn clean package

Packaged jar file can be found in the ./target/ directory.

Usage Example

public class Main {

    public static void main(String[] args) {
        Profiler profiler = new Profiler("MyProfiler");
        profiler.start();

        profiler.push("Section_A");

        profiler.push("Sub-Section_1"); // Included in the runtime of Section_A
        /* Code to be profiled */
        profiler.swap("Sub-Section_2"); // Included in the runtime of Section_A
        /* Code to be profiled */
        profiler.pop();

        profiler.swap("Section_B");
        /* Code to be profiled */
        profiler.pop();

        profiler.stop();

        OutputWriter.HTML.writeToPath(profiler, new File("<output_dir>").toPath());
    }
}

License

This project is licensed under MIT.

MIT License Summary:

The MIT License is a permissive open-source license that allows you to use, modify, and distribute the software for both personal and commercial purposes. You are not required to share your changes, but you must include the original copyright notice and disclaimer in your distribution. The software is provided "as is," without any warranties or conditions.

About

Performance monitoring for Java applications through execution time tracking and data export.

Topics

Resources

License

Security policy

Stars

Watchers

Forks