Skip to content

Performance improvements of AgentPropertiesFileHandler - #13852

Open
sureshanaparti wants to merge 1 commit into
apache:4.22from
shapeblue:agent-properties-handler-improvements
Open

Performance improvements of AgentPropertiesFileHandler#13852
sureshanaparti wants to merge 1 commit into
apache:4.22from
shapeblue:agent-properties-handler-improvements

Conversation

@sureshanaparti

Copy link
Copy Markdown
Contributor

Description

This PR optimizes the AgentPropertiesFileHandler.getPropertyValue method. This method is used to fetch properties values from agent.properties file. In the proposed change, the properties file is loaded lazily on first access and cached. The cache is invalidated whenever the agent persists a change via PropertiesStorage.persist, so agent-driven updates are picked up on the next read. External manual edits to agent.properties are not auto-detected and take effect after an agent restart.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sureshanaparti
sureshanaparti force-pushed the agent-properties-handler-improvements branch from 26e4af3 to 53f7168 Compare August 11, 2026 14:59
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.70%. Comparing base (5328528) to head (53f7168).

Files with missing lines Patch % Lines
...d/agent/properties/AgentPropertiesFileHandler.java 94.44% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #13852   +/-   ##
=========================================
  Coverage     17.69%   17.70%           
- Complexity    15835    15841    +6     
=========================================
  Files          5925     5925           
  Lines        533539   533572   +33     
  Branches      65274    65277    +3     
=========================================
+ Hits          94427    94450   +23     
- Misses       428435   428444    +9     
- Partials      10677    10678    +1     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.78% <94.73%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about the failure handling.

LOGGER.info("Loaded {} properties from [{}]", newProperties.size(), agentPropertiesFile.getAbsolutePath());

} catch (IOException ex) {
LOGGER.error("Failed to load properties from file [{}].", agentPropertiesFile.getAbsolutePath(), ex);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems FATAL to me. Any reason to keep running when this occurs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants