Cache VM stats - #859
Cache VM stats#859ben-grande wants to merge 1 commit into
Conversation
|
Marek said: #827 (comment)
Let's assume the previous moment the stats were collected was a long
But let's assume that I did an average of a long time by assigning if not previous and self.stats_cache_data:
previous = self.stats_cache_dataI don't think it would be wrong to have an average of a long time compared to reporting 0%. |
92d83f7 to
45f3fdb
Compare
Clients that subscribe will each query extraneously query the statistics (spending time) and get different results for time based data such as CPU usage (elapsed time). This patch aims to fix those problems, but current the sleep between queries is only considered on the API.
45f3fdb to
3aa3201
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #859 +/- ##
==========================================
- Coverage 70.51% 70.49% -0.02%
==========================================
Files 61 61
Lines 14371 14375 +4
==========================================
Hits 10133 10133
- Misses 4238 4242 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
If you don't like the |
TTL cache to avoid multiple clients or requests from the same client of blocking CPU cycles from qubesd.