[v4] Measure loading time of a query using QueryCache #6730
Replies: 1 comment
-
Your code makes no sense. Calculating loading time from You might want to consider some network analysis tools (like in your browser devtools) or googling (or ChatGPT) how to measure the time a promise needs to resolve. You then could append this information to your query data and display this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I'm implementing a hook that observes all queries coming to react-query and detects the ones that have poor latency. While implementing I stumbled upon an issue - loading queries have
dataUpdatedAt
always at zero (because they're loading so there's no data yet). Because of that, I can only detect slow-loading queries only on a page reload when they're picked up from query cache.How would I measure loading time of a query without a page reload, and if it takes more time to load than usual, to commit some kind of action? (in this case push a query to array)
This is my current implementation:
Beta Was this translation helpful? Give feedback.
All reactions