mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Add Phase 2 optimizations: status API caching and improved Redis pipelining
- Add in-memory cache for /status endpoint with 30s TTL - Cache keyed by view parameters to handle different query patterns - Add cache clearing for tests to prevent interference - Optimize get_queue_metrics to use single pipeline for all Redis calls - Previously made 7+ separate pipeline calls - Now combines all queue metrics into one pipeline (7n+2 operations) - Reduces Redis round trips and improves API response time - Update unit tests to match new pipelining behavior - All 866 tests passing
This commit is contained in:
parent
e5c0fa986e
commit
7b657edd0d
4 changed files with 86 additions and 15 deletions
|
|
@ -17,6 +17,8 @@ describe Vmpooler::API::V3 do
|
|||
# https://rubydoc.info/gems/sinatra/Sinatra/Base#reset!-class_method
|
||||
before(:each) do
|
||||
app.reset!
|
||||
# Clear status cache to prevent test interference
|
||||
Vmpooler::API::V3.clear_status_cache
|
||||
end
|
||||
|
||||
describe 'status and metrics endpoints' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue