Class: QaServer::ScenarioRunSummaryCache

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

.summary_for_run(run:) ⇒ Object

Summary for a run

Examples:

ScenarioRunSummary includes methods for accessing

* run_id           [Integer] e.g. 14
* run_dt_stamp     [ActiveSupport::TimeWithZone] e.g. Wed, 19 Feb 2020 16:01:07 UTC +00:00
* authority_count  [Integer] e.g. 22
* failing_authority_count [Integer] e.g. 1
* passing_scenario_count  [Integer] e.g. 156
* failing_scenario_count  [Integer] e.g. 3
* total_scenario_count    [Integer] e.g. 159

Parameters:



22
23
24
25
26
27
# File 'app/cache_processors/qa_server/scenario_run_summary_cache.rb', line 22

def summary_for_run(run:)
  Rails.cache.fetch(cache_key_for_run_summary(run.id), expires_in: next_expiry, race_condition_ttl: 30.seconds) do
    QaServer.config.monitor_logger.debug("(QaServer::ScenarioRunSummaryCache) - CALCULATING SUMMARY for scenario run #{run.id}")
    scenario_history_class.run_summary(scenario_run: run)
  end
end