Commit Graph

11 Commits (651b7a1ce64df19c730e1fd721a1dcf4ecf618cf)

Author SHA1 Message Date
dependabot[bot] a969754819
chore(deps): Bump chrono from 0.4.22 to 0.4.23 (#6129)
* chore(deps): Bump chrono from 0.4.22 to 0.4.23

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.22 to 0.4.23.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.22...v0.4.23)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor: chrono future compat

Integer->timstamp conversions should not silently panic.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marco Neumann <marco@crepererum.net>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-14 13:34:09 +00:00
Marco Neumann e04a9d875a
refactor: use concrete loader type within `CacheDriver` (#5532)
There's no technical reason to dyn-dispatch the loader. The user may
free to do so however.

Note that there's no change within `querier` because the type
inference will now automatically treat the passed `Arc` as `Arc<L>`
insteado of `Arc<dyn Loader<...>>`.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-02 11:30:47 +00:00
Marco Neumann c59dd01742
refactor: use concrete inner type in `CacheWithMetrics` (#5522)
The API user still CAN use dynamic dispatch but doesn't have to. This
also simplifies the generics a bit.

This is similar to #5520.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 06:05:59 +00:00
Marco Neumann c0dda14cef
refactor: use concrete backend type in `CacheDriver` (#5520)
This removes some `Box<dyn ...>` indirection when the user doesn't want
it (you still can, but don't have to) and makes the whole type handling
easier to understand.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-08-31 14:58:25 +00:00
Marco Neumann b35502ce61
feat: cache tracing (#5164)
* feat: cache tracing

Add tracing to the metrics cache wrapper. The extra arguments for GET
and PEEK make this quite simple, because the wrapper can just extend the
inner args with the trace information.

We currently terminate the span in `querier::cache` (i.e. only pass in
`None`, so no tracing will occur) to keep this PR rather small. This
will be changed in subsequent PRs.

For #5129.

* fix: typo

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-07-21 11:54:22 +00:00
Marco Neumann 4e4c37d68c
refactor: improve cache system generic tests (#5163)
This prepares the test system for the usage of extra args for GET and
PEEK by pulling all generics and the whole interface into a single
trait. This is similar to how the write buffer tests work.

This is needed to introduce extra args into the metrics wrapper (i.e. to
pass down spans) while still being able to use the generic tests in a
follow-up PR. Overall this change is required for #5129.

The tests itself are unchanged.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-07-21 05:52:54 +00:00
Marco Neumann 3b8f98c7b8
feat: allow passing for extra arguments to `Cache::peek` (#5161)
This will be used to pass spans down to `CacheWithMetrics` (or a new
wrapper specific to tracing) and will help with #5129.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-07-20 13:51:21 +00:00
Marco Neumann cec169b7ca
feat: add "peek" functionality for caches (#5049)
Required for #5032.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-07-07 07:00:44 +00:00
Marco Neumann 4e5842dec7
feat: expose hit-miss metrics for querier caches (#4811)
* feat: `MetricsCache`

* feat: expose hit-miss metrics for querier caches

* refactor: `MetricsCache` -> `CacheWithMetrics`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-06-09 13:07:40 +00:00
Marco Neumann 2e3ba83795
refactor: expose `CacheGetStatus` (and improve tests) (#4804)
* refactor: expose `CacheGetStatus` (and improve tests)

- add a `CacheGetStatus` which tells the user if the request was a hit
  or miss (or something inbetween)
- adapt some tests to use the status (only the tests where this could be
  relevant)
- move the test suite from using `sleep` to proper barriers (more stable
  under high load, more correct, potentially faster)

* refactor: improve `abort_and_wait` checks

* docs: typos and improve wording

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

* refactor: `FutureExt2` -> `EnsurePendingExt`

* refactor: `Queried` -> `MissAlreadyLoading`

* docs: explain `abort_or_wait` more

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-06-09 07:32:46 +00:00
Marco Neumann 317e9486df
refactor: make `Cache` a trait (#4802)
* refactor: make `Cache` a trait

To insert more high-level metrics (e.g. cache misses/hits) it would be
helpful if we could easily instrument the layer right above the cache
driver (that combines the backend and the loader). To do that without
polluting the types too much, let's introduce a trait that describes the
driver interface and that we could later wrap with intrumentation.

This also pulls out the test into a generic setup, similar to how this
is done for the cache storage backends.

This does NOT include any functionality changes.

* fix: typo

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-06-08 11:04:53 +00:00