{"id":17482262,"url":"https://github.com/omarmahamid/async","last_synced_at":"2025-04-22T14:09:46.891Z","repository":{"id":258192847,"uuid":"870204660","full_name":"omarmahamid/async","owner":"omarmahamid","description":"async profiler for spring applications","archived":false,"fork":false,"pushed_at":"2024-11-17T21:55:24.000Z","size":409,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T14:09:39.003Z","etag":null,"topics":["async-profiler","flamegraph","java","jvm","profiling","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omarmahamid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-09T16:13:59.000Z","updated_at":"2024-11-17T21:55:28.000Z","dependencies_parsed_at":"2024-10-18T00:29:48.114Z","dependency_job_id":"029f7394-fcc3-4a12-8499-31f2e183ff74","html_url":"https://github.com/omarmahamid/async","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":"0.20512820512820518","last_synced_commit":"449827d9e732d8dcdc5e95d60beafbb0c761f464"},"previous_names":["omarmahamid/async"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarmahamid%2Fasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarmahamid%2Fasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarmahamid%2Fasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarmahamid%2Fasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omarmahamid","download_url":"https://codeload.github.com/omarmahamid/async/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250255697,"owners_count":21400410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-profiler","flamegraph","java","jvm","profiling","spring-boot"],"created_at":"2024-10-18T23:05:08.108Z","updated_at":"2025-04-22T14:09:46.873Z","avatar_url":"https://github.com/omarmahamid.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async profiler embedded in java applications\n\nThis project provides an embedded solution for Async Profiler https://github.com/async-profiler/async-profiler within a Java applications, with modules for core functionality, Spring integration, and annotations. It enables you to capture profiling data at regular intervals and automatically generate HTML reports that can be viewed in a browser.\n\n## Features\n\n1. Embedded Async Profiler for Java applications.\n2. Captures profiling data at scheduled intervals.\n3. Generates easy-to-read HTML reports.\n4. Supports multiple profiling events like CPU, ALLOC, and WALL.\n5. Can profile main method within async-annotation.\n\n## Artifacts\n1. `async-core`: Core profiling functionalities.\n2. `async-spring`: Profiling integration with Spring applications.\n3. `async-annotation`: Annotations for easy profiling in main methods.\n\n\n# pre-requisite\n\n`Java 17+`\n\n\n## Supported Machines\n\n\n| CPU Arch | Linux | MacOS | Windows |\n|----------|-------|-------|---------|\n| x86_64   | ✔️     | ✔️     | ❌       |\n| arm      | ✔️     | ✔️     | ❌       |\n| arm64    | ✔️     | ✔️     | ❌       |\n\n\n# Module Details\n\n## async-core\n\nThe core module of the project, responsible for managing the actual profiling tasks.\n\n\n### Dependency\n\n\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eio.github.omarmahamid\u003c/groupId\u003e\n\t\t\u003cartifactId\u003easync-core\u003c/artifactId\u003e\n\t\t\u003cversion\u003e${LATEST_VERSION}\u003c/version\u003e\n  \t\u003c/dependency\u003e\n\n## async-spring\n\nProvides seamless integration with Spring, allowing you to enable async profiling in your Spring services. Profiling reports are generated automatically at scheduled intervals.\n\n\n### Dependency\n\n\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eio.github.omarmahamid\u003c/groupId\u003e\n\t\t\u003cartifactId\u003easync-spring\u003c/artifactId\u003e\n\t\t\u003cversion\u003e${LATEST_VERSION}\u003c/version\u003e\n  \t\u003c/dependency\u003e\n\n\n### Configuration\n\n`async-profiler-enabled` - Enable profiler to work.\n\n`async-profiler-event` - Event of async profiler (CPU, ALLOC, WALL). (Default is CPU)\n\n`async-profiler-duration` - Duration of interval profiling in seconds. (Default is 1000)\n\n`async-profiler-basedir` - The based directory to dump the html files in. (Default is base application dir)\n\n### Generated File\n\nasync will generate a html file that can be shown in the browser.\n\n![img.png](img.png)\n\n![img_1.png](img_1.png)\n\n## async-annotation\n\nAllows you to use custom annotations to specify which parts of your code should be profiled. This makes it easy to apply profiling to specific methods or classes.\n\n\n### Dependency\n\n\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eio.github.omarmahamid\u003c/groupId\u003e\n\t\t\u003cartifactId\u003easync-annotation\u003c/artifactId\u003e\n\t\t\u003cversion\u003e${LATEST_VERSION}\u003c/version\u003e\n  \t\u003c/dependency\u003e\n\n\n## Usage\n\nadding @Profiling annotation on main method\n\n```java\npackage io.github.omarmahamid.annotation;\n\nimport io.github.omarmahamid.async.ModeAsyncProfiler;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target(ElementType.METHOD)\npublic @interface Profiling {\n\n    ModeAsyncProfiler mode() default ModeAsyncProfiler.CPU;\n\n    long duration() default 30; // in millisecond\n\n    String fileDump();\n}\n```\n\n\n## Example\n\n```java\npackage io.github.omarmahamid.annotation;\n\n\nimport java.math.BigDecimal;\n\n\npublic class Main {\n\n\n    @Profiling(fileDump = \"/Users/omarmahamid/Documents/GitHub/async/async-annotation/profiling.html\")\n    public static void main(String[] args) {\n\n        ProfilingProcessor.startProcess(Main.class);\n        \n        // Custom logic code\n    }\n}\n```\n\nstopProcess is not necessary since there is a shutdown hook that will stop the profiler\n\n## Result\n\njust open the path:\n\n/Users/omarmahamid/Documents/GitHub/async/async-annotation/profiling.html\n\n\n![img_2.png](img_2.png)\n\n\n# Contributions\nContributions are welcome! Feel free to submit issues or pull requests to help improve this project.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarmahamid%2Fasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomarmahamid%2Fasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarmahamid%2Fasync/lists"}