Skip to content

Tidy up java code in o.a.s.metrics package - #4679

Open
epugh wants to merge 3 commits into
apache:mainfrom
epugh:tidy_oas_metrics
Open

Tidy up java code in o.a.s.metrics package#4679
epugh wants to merge 3 commits into
apache:mainfrom
epugh:tidy_oas_metrics

Conversation

@epugh

@epugh epugh commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

Reviewing code in the org.apache.solr.metrics package for potential improvements.

Solution

Mostly driven by what IntelliJ is suggesting are weaknesses. Specifically, there were quite a few unused methods and classes in the Metrics package. I debated removing them, so I kept them in a single commit to make it easy to undo it. I odn't know if having htose methods etc was for OTHER consumers of Solr? @mlbiscoc I'd love your opinon on this.

Tests

I had to tweak them just a bit after editing. Otherwise just rerunning them.

@mlbiscoc mlbiscoc 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.

The rest of these changes I am good with. Was just some mess I accidentally may have left behind. Thanks for tidying this up!

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.

So for these instruments, I purposely created them as tools if someone wanted to capture metrics with these doubles in the future even though I didn't use them myself on the migration. All of our metrics back then I don't think did things with doubles and it was all longs but with OTEL we are not constrained to that anymore.

I personally prefer to keep them for future developers so they know that these tools do exist. Or maybe an LLM sees these exist and decides this is the best instrument instead of the ones we used.

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.

agreed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks for chiming in.. I worry about YAGNI, but also get the reasons for keeping it. I'll back out those changes, and then look to merge... Anything else that looks iffy?

@epugh epugh added this to the 10.x milestone Aug 1, 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.

3 participants