Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce startup time #1542

Merged
merged 1 commit into from
Jun 26, 2024
Merged

reduce startup time #1542

merged 1 commit into from
Jun 26, 2024

Conversation

lilai23
Copy link
Collaborator

@lilai23 lilai23 commented Jun 18, 2024

What type of PR is this?

Enhancement

What this PR does / why we need it?

  1. A pre-filter mechanism has been added.
    (1) First, before starting the application in the production environment, let the host application mount sermant-agent in the test environment or pre-production environment and run it once and turn on the pre-filter switch. This will generate a txt file containing the class names that do not need to be matched and enhanced in the host application.
    (2) When the production environment is officially running, sermant-agent will obtain the class name file in step 1 and ignore them in the matching filter of bytecode enhancement to save startup time.
    Since the classes that need to be enhanced only occupy a very small part, this method can filter out most of the classes and save a lot of matching time.

  2. modify some log print logic and optimize some process logic of loading agent

Which issue(s) this PR fixes?

Fixes #1541

Does this PR introduce a user-facing change?

No

Checklist

  • Make sure there is a GitHub_issue related with this PR before you start working on it.
  • Make sure you have squashed your change to one single commit.
  • GitHub Actions works fine in this PR.

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 11.81102% with 112 lines in your changes missing coverage. Please review.

Flag Coverage Δ Complexity Δ
unittests 42.96% <11.81%> (-0.38%) 181.00 <0.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ Complexity Δ
...ant/core/plugin/classloader/PluginClassFinder.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...ant/core/plugin/classloader/PluginClassLoader.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...java/io/sermant/god/common/SermantClassLoader.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...o/sermant/core/classloader/ClassLoaderManager.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ain/java/io/sermant/core/config/ConfigManager.java 6.89% <0.00%> (ø) 0.00 <0.00> (ø)
...agent/enhance/ClassLoaderLoadClassInterceptor.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/io/sermant/core/plugin/PluginSystemEntrance.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...rmant/implement/config/LoadPropertiesStrategy.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../io/sermant/implement/config/LoadYamlStrategy.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ain/java/io/sermant/core/plugin/PluginManager.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
... and 13 more

... and 31 files with indirect coverage changes

Signed-off-by: lilai <[email protected]>
@Sherlockhan Sherlockhan merged commit 380fde4 into sermant-io:develop Jun 26, 2024
279 of 280 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reduce startup time of sermant-agent
4 participants