Class: QaServer::ScenarioHistoryCache

Inherits:
Object
  • Object
show all
Extended by:
CacheKeys
Defined in:
app/cache_processors/qa_server/scenario_history_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_SUMMARY_DATA_CACHE_KEY

Class Method Summary collapse

Class Method Details

.historical_summary(force: false) ⇒ Object

Get a summary of the number of days passing/failing for scenario runs during configured time period

Examples:

auth_name, failing, passing

{ 'agrovoc' => { good: 31, bad: 2 },
  'geonames_ld4l_cache' => { good: 32, bad: 1 } }

Parameters:

  • force (Boolean) (defaults to: false)

    if true, run the tests even if the cache hasn’t expired; otherwise, use cache if not expired



17
18
19
20
21
22
# File 'app/cache_processors/qa_server/scenario_history_cache.rb', line 17

def historical_summary(force: false)
  Rails.cache.fetch(cache_key_for_historical_data, expires_in: next_expiry, race_condition_ttl: 30.seconds, force: force) do
    QaServer.config.monitor_logger.debug("(QaServer::ScenarioHistoryCache) - CALCULATING HISTORY of scenario runs (force: #{force})")
    scenario_history_class.historical_summary
  end
end