Class: QaServer::PerformanceDatatableCache

Inherits:
Object
  • Object
show all
Includes:
CacheKeys
Defined in:
app/cache_processors/qa_server/performance_datatable_cache.rb

Constant Summary

Constants included from CacheKeys

CacheKeys::PERFORMANCE_DATATABLE_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_FAILURE_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_HISTORY_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_HISTORY_UP_DOWN_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_SUMMARY_DATA_CACHE_KEY

Class Method Summary collapse

Class Method Details

.data(force: false) ⇒ Object

Retrieve performance datatable data from the cache

Examples:

{ all_authorities:
  { search:
    { retrieve_avg_ms: 12.3, graph_load_avg_ms: 2.1, normalization_avg_ms: 4.2, full_request_avg_ms: 16.5,
      retrieve_10th_ms: 12.3, graph_load_10th_ms: 12.3, normalization_10th_ms: 4.2, full_request_10th_ms: 16.5,
      retrieve_90th_ms: 12.3, graph_load_90th_ms: 12.3, normalization_90th_ms: 4.2, full_request_90th_ms: 16.5 },
    fetch: { ... # same data as for search_stats },
    all: { ... # same data as for search_stats }
  },
  AGROVOC_LD4L_CACHE: { ... # same data for each authority  }
}

Parameters:

  • force (Boolean) (defaults to: false)

    if true, calculate the stats even if the cache hasn’t expired; otherwise, use cache if not expired



24
25
26
27
28
29
30
31
# File 'app/cache_processors/qa_server/performance_datatable_cache.rb', line 24

def self.data(force: false)
  Rails.cache.fetch(PERFORMANCE_DATATABLE_DATA_CACHE_KEY,
                    expires_in: QaServer::CacheExpiryService.cache_expiry,
                    race_condition_ttl: 5.minutes, force: force) do
    QaServer.config.monitor_logger.debug("(QaServer::PerformanceDatatableCache) - CALCULATING performance datatable stats (force: #{force})")
    performance_data_service.calculate_datatable_data
  end
end