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

feat: use time series data request manager #2907

Open
wants to merge 4 commits into
base: rc
Choose a base branch
from

Conversation

jmbuss
Copy link
Contributor

@jmbuss jmbuss commented Jul 9, 2024

Overview

This is the first piece of code for the useTimeSeriesData implementation. This includes a request manager which ensures that requests are deduped, and that the correct time intervals are picked.

Time intervals are created from:

  1. a static list of "live data" intervals. These are created in order to account for any late data points and configure different refresh rates.
  2. any existing cached intervals, so that we don't need to re-request those intervals.
  3. any gaps in the viewport and the above 2 lists.

There are 2 parts to this PR. the generic abstraction for resolving these intervals for any set of time series data. These classes are contained in the useTimeSeriesData hook. The concrete implementations will be in their own hooks, for example, the useAssetPropertyValueHistory hook. This will be the implementation of useTimeSeriesData for raw historical data. There will also be an implementation for useAssetPropertyAggregates and useGetAssetPropertyValue. Those will follow after completion of useAssetPropertyValueHistory as their implementations will be roughly the same with a few modifications to the cache client and request functions.

Legal

This project is available under the Apache 2.0 License.

@jmbuss jmbuss force-pushed the feat/use-time-series-data-request-manager branch 3 times, most recently from 2d652fd to 72aa24f Compare July 9, 2024 22:17
@jmbuss jmbuss changed the title Feat/use time series data request manager feat: use time series data request manager Jul 9, 2024
@jmbuss jmbuss force-pushed the feat/use-time-series-data-request-manager branch from 72aa24f to 5f39ec6 Compare July 10, 2024 14:59
@jmbuss jmbuss marked this pull request as ready for review July 10, 2024 15:06
@jmbuss jmbuss force-pushed the feat/use-time-series-data-request-manager branch from 5f39ec6 to 2789e76 Compare July 10, 2024 17:58
@jmbuss jmbuss force-pushed the feat/use-time-series-data-request-manager branch from 2789e76 to ece0c00 Compare July 10, 2024 19:02
@@ -9,5 +9,5 @@ export const queryClient = new QueryClient({
staleTime: STALE_TIME,
},
},
queryCache: new QueryCache({}),
queryCache: new QueryCache(),
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a difference or is it just cleaner this way?

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

4 participants