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

Fix concurrency issues in Performance Stats code #4910

Merged

Conversation

adamretter
Copy link
Contributor

Cleanup the code and fix concurrency issues in the Performance Stats code

@adamretter adamretter added the bug issue confirmed as bug label May 9, 2023
@adamretter adamretter added this to the eXist-7.0.0 milestone May 9, 2023
@adamretter adamretter requested review from dizzzz and reinhapa May 9, 2023 16:08
%test:assertXPath("$result//stats:index[@type = 'range'][@optimization = 2]")
%test:assertXPath("$result//stats:index[@type eq 'range'][@optimization-level eq 'Optimized']")
Copy link
Member

Choose a reason for hiding this comment

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

Will code that expects the performance stats to return <stats:index optimization="2"> need to be updated to read <stats:index optimization-level="Optimized"/> etc.? Monex, for example reads @optimization here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joewiz yes, indeed

Copy link
Member

Choose a reason for hiding this comment

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

hmmmm ok. then we need to have a plan to update monex here as well, whilst keeping that app compatible with older exist versions?

@dizzzz
Copy link
Member

dizzzz commented May 9, 2023

Codewise it looks OK to me. Better JMX support?

Copy link
Member

@dizzzz dizzzz left a comment

Choose a reason for hiding this comment

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

build fails :-(

@adamretter adamretter force-pushed the refactor/cleanup-performance-stats branch from a405132 to 783cbdd Compare May 10, 2023 08:23
@line-o
Copy link
Member

line-o commented May 10, 2023

Please update the description of this PR to include information about the breaking change(s) that it introduces.

@line-o line-o self-requested a review May 10, 2023 10:48
Copy link
Member

@line-o line-o left a comment

Choose a reason for hiding this comment

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

This PR introduces breaking changes and fails to communicate that clearly in the commit messages.
Please extract the breaking changes into a single commit so that we can discuss them separately.

@adamretter
Copy link
Contributor Author

Please extract the breaking changes into a single commit so that we can discuss them separately.

This is not something we have ever done before! So why do you believe that this PR is "special" in some way to any others that target an upcoming major release?

@line-o
Copy link
Member

line-o commented May 10, 2023

As the changes are not necessary to fix concurrency issues they should not be part of this PR.

Copy link
Member

@dizzzz dizzzz left a comment

Choose a reason for hiding this comment

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

ah ok, so some additional updates need to be put in place in apps to keep things compatible.

@adamretter
Copy link
Contributor Author

adamretter commented May 11, 2023

As the changes are not necessary to fix concurrency issues they should not be part of this PR.

When has that ever been a requirement of PRs against a major version? It might be sensible to put them in separate commits perhaps, but separate PRs is unnecessary!

@adamretter adamretter force-pushed the refactor/cleanup-performance-stats branch 4 times, most recently from b138c00 to eebf365 Compare May 16, 2023 17:58
@line-o
Copy link
Member

line-o commented May 16, 2023

@adamretter In yesterdays community call I was convinced that speaking labels are favourable over magical integer constants. We also found that the attribute name returned by the stats package should stay @optimization and not be changed to @optimization-level as it is both shorter and also better to understand. This is especially true for the case where no index is found and thus no optimisation can be used.
What are your thoughts on this?

@adamretter
Copy link
Contributor Author

adamretter commented May 17, 2023

@Optimization and not be changed to @optimization-level

I intentionally changed this because it was misleading. It does not describe the optimization that was performed, which is what it previously implied. Rather it describes the "level of optimization" that was able to be applied - and this is how it was described in the Java code. So I corrected it so that it actually reflects what it is.

@adamretter adamretter force-pushed the refactor/cleanup-performance-stats branch from eebf365 to c769150 Compare May 18, 2023 09:21
@adamretter
Copy link
Contributor Author

@reinhapa @dizzzz Is this one now ready to go?

@dizzzz
Copy link
Member

dizzzz commented May 18, 2023

during the teleconference we talked about the naming:

enum IndexOptimizationLevel {
NONE,
BASIC,
OPTIMIZED;
}

OptimizationLevel= OPTIMIZED does not reflect i kind of "amount" of optimisation was applied. "FULL" would do that much better, or "OPTIMAL". Maybe it is a kind language thingy ?

@adamretter
Copy link
Contributor Author

adamretter commented Oct 14, 2023

to even present that data under stats:index.
How about renaming the element then to stats:optimization

I am not sure that makes sense as these optimizations are index guided.

As this has been open now for 6 months, and is a clear improvement on the status quo, I suggest we just merge this and move on; rather than splitting hairs over naming! It can always be improved in the future as can everything else in eXist-db.

@dizzzz @reinhapa Can you discuss together, and consider merging this please?

@sonarcloud
Copy link

sonarcloud bot commented Oct 14, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug B 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 10 Code Smells

72.4% 72.4% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@dizzzz
Copy link
Member

dizzzz commented Oct 30, 2023

Does this require an money update? if not, I am happy.

@adamretter
Copy link
Contributor Author

adamretter commented Oct 30, 2023

Does this require an money update?

@dizzzz I am happy to receive any money!

@dizzzz
Copy link
Member

dizzzz commented Oct 30, 2023

I ment.... Monex :-P

@reinhapa reinhapa self-requested a review November 20, 2023 19:08
@adamretter adamretter force-pushed the refactor/cleanup-performance-stats branch from 1ee9ba7 to c8242fc Compare September 2, 2024 09:17
@adamretter adamretter requested a review from a team as a code owner September 2, 2024 09:17
@adamretter
Copy link
Contributor Author

@dizzzz Yes, see the discussion here: #4910 (comment)

@adamretter
Copy link
Contributor Author

@reinhapa Would you mind adding a review please?

@dizzzz
Copy link
Member

dizzzz commented Oct 11, 2024

Thnx @adamretter;

One (important) question remains... with the change, is Monex still working? ( @joewiz )

@adamretter
Copy link
Contributor Author

adamretter commented Oct 11, 2024

One (important) question remains... with the change, is Monex still working?

@dizzzz I don't know if Monex is still working, I think it may be possible that Monex will need a small change, but I have not tested Monex and I am not really involved in its development; so it is probably best to get one of the Monex developers to test/fix it once this PR has been merged. I did try and answer this before, but perhaps I wasn't clear enough (See here and here)

@dizzzz dizzzz merged commit 5865e79 into eXist-db:develop Oct 11, 2024
10 of 12 checks passed
@joewiz
Copy link
Member

joewiz commented Oct 11, 2024

The changes to Monex should be straightforward. I've opened an issue for this: eXist-db/monex#273.

@dizzzz
Copy link
Member

dizzzz commented Oct 12, 2024

With the merge there were still issues ?

Can't check well on my phone ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants