Class: QaServer::ScenarioRunFailuresCache

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

.failures_for_run(run:) ⇒ Object

Set of failures for a run

Examples:

[ { status: :bad,
    authority_name: "geonames_ld4l_cache",
    subauthority_name: "area",
    service: "ld4l_cache",
    action: "search",
    url: "/qa/search/linked_data/geonames_ld4l_cache/area?q=France&maxRecords=4",
    err_message: "Unable to connect to authority",
    scenario_type: :connection
    run_time: 11.2 },
  { status: :unknown,
    authority_name: "oclcfast_ld4l_cache",
    subauthority_name: "Person",
    service: "ld4l_cache",
    action: "search",
    url: "/qa/search/linked_data/oclcfast_ld4l_cache/person?q=mark twain&maxRecords=4",
    err_message: "Not enough search results returned",
    scenario_type: :connection
    run_time: 0.123 } ]

Parameters:



33
34
35
36
37
38
# File 'app/cache_processors/qa_server/scenario_run_failures_cache.rb', line 33

def failures_for_run(run:)
  Rails.cache.fetch(cache_key_for_run_failures(run.id), expires_in: next_expiry, race_condition_ttl: 30.seconds) do
    QaServer.config.monitor_logger.debug("(QaServer::ScenarioRunFailuresCache) - CALCULATING FAILURES for scenario run #{run.id}")
    scenario_history_class.run_failures(run_id: run.id)
  end
end