Skip to content

Fix #646 - Fix calculation hit ratio in StandardCache's cache report.#647

Merged
danielfernandez merged 1 commit into
thymeleaf:3.0-masterfrom
yoshikawaa:issue646
Nov 4, 2017
Merged

Fix #646 - Fix calculation hit ratio in StandardCache's cache report.#647
danielfernandez merged 1 commit into
thymeleaf:3.0-masterfrom
yoshikawaa:issue646

Conversation

@yoshikawaa
Copy link
Copy Markdown
Contributor

#646 fixed.

Please check it, Thanks.

@danielfernandez danielfernandez self-assigned this Nov 4, 2017
@danielfernandez danielfernandez added this to the Thymeleaf 3.0 milestone Nov 4, 2017
@danielfernandez danielfernandez merged commit 1ba0221 into thymeleaf:3.0-master Nov 4, 2017
@danielfernandez
Copy link
Copy Markdown
Member

Thanks a lot @yoshikawaa!

@yoshikawaa
Copy link
Copy Markdown
Contributor Author

@danielfernandez
Thank you for accepting.

@yoshikawaa yoshikawaa deleted the issue646 branch November 6, 2017 05:07
long getCount = getGetCount();

double hitRatio = hitCount / getCount;
double hitRatio = (double) hitCount / (double) getCount;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@yoshikawaa @danielfernandez Why not use getHitRatio() method to reduce duplication? This also adds a protection against division by zero.


double hitRatio = hitCount / getCount;
double hitRatio = (double) hitCount / (double) getCount;
double missRatio = 1 - hitRatio;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

double missRatio = 1 - hitRatio;

BTW this can be replaced by using getMissRatio() method.

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.

4 participants