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

ref: Use moka for Cacher implementation #979

Merged
merged 6 commits into from
Jan 30, 2023
Merged

ref: Use moka for Cacher implementation #979

merged 6 commits into from
Jan 30, 2023

Conversation

Swatinem
Copy link
Member

@Swatinem Swatinem commented Jan 16, 2023

Replaces the current request coalescing solution with moka.
This simplifies the channel creation and deduplication logic, as moka
does that already. This also gives us in-memory caches right now, even
though they are not hooked up to configuration yet.

@codecov
Copy link

codecov bot commented Jan 24, 2023

Codecov Report

Merging #979 (31187dc) into master (5763972) will increase coverage by 0.13%.
The diff coverage is 97.44%.

❗ Current head 31187dc differs from pull request most recent head a60fc8d. Consider uploading reports for the commit a60fc8d to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #979      +/-   ##
==========================================
+ Coverage   74.12%   74.26%   +0.13%     
==========================================
  Files          75       75              
  Lines       11439    11504      +65     
==========================================
+ Hits         8479     8543      +64     
- Misses       2960     2961       +1     

@Swatinem Swatinem mentioned this pull request Jan 27, 2023
Replaces the current request coalescing solution with `moka`.
This simplifies the channel creation and deduplication logic, as `moka`
does that already. This also gives us in-memory caches right now, even
though they are not hooked up to configuration yet.
// - ^ Well actually, eager `computations` should be `file.hits + file.miss - file.fallback`,
// as cache fallback does trigger a background computation.
// - in-memory miss: access - computations
// FIXME: is it better to use a different metrics key or tags for the cache name?
Copy link
Member Author

Choose a reason for hiding this comment

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

NOTE: for datadog it does not matter if we use different keys or tags. I would even prefer to have tags instead, but that might be a good followup.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would agree that tags seem like the natural choice.

@Swatinem Swatinem marked this pull request as ready for review January 27, 2023 14:23
@Swatinem Swatinem requested a review from a team January 27, 2023 14:23
@Swatinem Swatinem enabled auto-merge (squash) January 30, 2023 11:36
@Swatinem Swatinem merged commit ff40e2c into master Jan 30, 2023
@Swatinem Swatinem deleted the ref/moka-cache branch January 30, 2023 11:38
Swatinem added a commit that referenced this pull request Jan 30, 2023
Swatinem added a commit that referenced this pull request Jan 30, 2023
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.

None yet

2 participants