Class: QaServer::ScenarioHistoryGraphCache

Inherits:
Object
  • Object
show all
Extended by:
CacheKeys, MonitorStatus::GruffGraph
Defined in:
app/cache_processors/qa_server/scenario_history_graph_cache.rb

Constant Summary collapse

HISTORICAL_GRAPH_FILENAME =
'historical_side_stacked_bar.png'

Constants included from CacheKeys

CacheKeys::PERFORMANCE_DATATABLE_DATA_CACHE_KEY, CacheKeys::PERFORMANCE_GRAPH_DAILY_DATA_CACHE_KEY, CacheKeys::PERFORMANCE_GRAPH_HOURLY_DATA_CACHE_KEY, CacheKeys::PERFORMANCE_GRAPH_MONTHLY_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_FAILURE_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_HISTORY_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_HISTORY_GRAPH_CACHE_KEY, CacheKeys::SCENARIO_RUN_SUMMARY_DATA_CACHE_KEY, CacheKeys::SCENARIO_RUN_TEST_DATA_CACHE_KEY

Class Method Summary collapse

Class Method Details

.generate_graph(data:, force: false) ⇒ Object

Generates graphs for the past 30 days for :search, :fetch, and :all actions for each authority.

Parameters:

  • force (Boolean) (defaults to: false) —

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



16
17
18
19
20
# File 'app/cache_processors/qa_server/scenario_history_graph_cache.rb', line 16

def generate_graph(data:, force: false)
  return unless QaServer::CacheExpiryService.cache_expired?(key: cache_key_for_force, force: force, next_expiry: next_expiry)
  QaServer.config.monitor_logger.debug("(QaServer::ScenarioHistoryGraphCache) - GENERATING historical summary graph (force: #{force})")
  graphing_service.generate_graph(data)
end