Skip to content

feat(cache-chart): Show hits/misses per poll interval #4146

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hzpz
Copy link
Collaborator

@hzpz hzpz commented Mar 21, 2025

No description provided.

@hzpz hzpz requested a review from a team as a code owner March 21, 2025 10:51
const lastChartData = this.chartData[this.chartData.length - 1];
hitsPerInterval = data.hit - lastChartData.hit;
missesPerInterval = data.miss - lastChartData.miss;
totalPerInterval = data.total - lastChartData.total;
Copy link
Member

Choose a reason for hiding this comment

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

I think "previous" would be better than "last" (even if it is the "last" one in the array, we want the one that was before the current one, which is "previous")

Copy link
Member

Choose a reason for hiding this comment

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

And I would prefer to have the calculation in a separate function (with tests :D ). But I understand that this may be awkward because we want to return three values and the calculation itself is really simple

@hzpz hzpz force-pushed the cache-chart-hits-misses-per-poll-interval branch from 9f6a517 to 81dfb71 Compare March 28, 2025 09:04
@hzpz hzpz force-pushed the cache-chart-hits-misses-per-poll-interval branch from 81dfb71 to fe31a3e Compare April 11, 2025 06:07
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.

2 participants