Skip to content

[#noissue] Refactor useStatisticsAgentState#13328

Open
intr3p1d wants to merge 1 commit intopinpoint-apm:masterfrom
intr3p1d:cleanup_statistics
Open

[#noissue] Refactor useStatisticsAgentState#13328
intr3p1d wants to merge 1 commit intopinpoint-apm:masterfrom
intr3p1d:cleanup_statistics

Conversation

@intr3p1d
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors how useStatisticsAgentState is handled for server map histogram endpoints, simplifying controller signatures and centralizing the default behavior in ResponseTimeHistogramServiceOption.

Changes:

  • Default useStatisticsAgentState in ResponseTimeHistogramServiceOption.Builder is now true.
  • ServerMapHistogramController no longer accepts useStatisticsAgentState as a request parameter and stops threading it through to MapServiceOption / ResponseTimeHistogramServiceOption, relying instead on internal defaults.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/service/ResponseTimeHistogramServiceOption.java Sets useStatisticsAgentState default to true in the builder so histogram-related code paths use statistics-based agent state unless explicitly overridden.
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/ServerMapHistogramController.java Removes useStatisticsAgentState request parameters and the corresponding propagation, instead building MapServiceOption and ResponseTimeHistogramServiceOption with their internal defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.build(callerRange, calleeRange, bidirectional, wasOnly);

final MapServiceOption option = new MapServiceOption
.Builder(application, timeWindow, searchOption)
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

Previously, this controller propagated the useStatisticsAgentState request parameter into MapServiceOption.Builder.setUseStatisticsAgentState(...), so both the application map and the node histograms shared the same useStatisticsAgentState value. After this change, MapServiceOption.Builder is no longer configured here, so MapServiceOption.isUseStatisticsAgentState() will always be false for these endpoints while ResponseTimeHistogramServiceOption now defaults this flag to true. This will cause the server group list in the map (via MapServiceImpl.createApplicationMapBuilder and newServerGroupListFactory(option.isUseStatisticsAgentState())) to be built with non-statistics agent state, while the node histograms for the same request use statistics-based agent state, which is an inconsistent behavior compared to the previous implementation. Consider explicitly setting useStatisticsAgentState on MapServiceOption.Builder (or adjusting its default) so that map creation and histogram generation use a consistent value for this flag.

Suggested change
.Builder(application, timeWindow, searchOption)
.Builder(application, timeWindow, searchOption)
.setUseStatisticsAgentState(true)

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.18%. Comparing base (c9230bf) to head (b97801d).
⚠️ Report is 39 commits behind head on master.

Files with missing lines Patch % Lines
...onmap/controller/ServerMapHistogramController.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13328      +/-   ##
============================================
- Coverage     33.18%   33.18%   -0.01%     
+ Complexity    10987    10985       -2     
============================================
  Files          4063     4063              
  Lines         94291    94289       -2     
  Branches       9811     9811              
============================================
- Hits          31290    31288       -2     
+ Misses        60324    60322       -2     
- Partials       2677     2679       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

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.

1 participant