Class: QaServer::PerformanceCalculatorService
- Inherits:
-
Object
- Object
- QaServer::PerformanceCalculatorService
- Includes:
- PerformanceHistoryDataKeys
- Defined in:
- app/services/qa_server/performance_calculator_service.rb
Constant Summary
Constants included from PerformanceHistoryDataKeys
QaServer::PerformanceHistoryDataKeys::ALL_ACTIONS, QaServer::PerformanceHistoryDataKeys::ALL_AUTH, QaServer::PerformanceHistoryDataKeys::AVG_ACTN, QaServer::PerformanceHistoryDataKeys::AVG_FULL, QaServer::PerformanceHistoryDataKeys::AVG_GRPH, QaServer::PerformanceHistoryDataKeys::AVG_LOAD, QaServer::PerformanceHistoryDataKeys::AVG_NORM, QaServer::PerformanceHistoryDataKeys::AVG_RETR, QaServer::PerformanceHistoryDataKeys::BPMS_GRPH, QaServer::PerformanceHistoryDataKeys::BPMS_NORM, QaServer::PerformanceHistoryDataKeys::BPMS_RETR, QaServer::PerformanceHistoryDataKeys::BY_DAY, QaServer::PerformanceHistoryDataKeys::BY_HOUR, QaServer::PerformanceHistoryDataKeys::BY_MONTH, QaServer::PerformanceHistoryDataKeys::FETCH, QaServer::PerformanceHistoryDataKeys::FOR_DATATABLE, QaServer::PerformanceHistoryDataKeys::FOR_DAY, QaServer::PerformanceHistoryDataKeys::FOR_MONTH, QaServer::PerformanceHistoryDataKeys::FOR_YEAR, QaServer::PerformanceHistoryDataKeys::HIGH_ACTN, QaServer::PerformanceHistoryDataKeys::HIGH_FULL, QaServer::PerformanceHistoryDataKeys::HIGH_GRPH, QaServer::PerformanceHistoryDataKeys::HIGH_LOAD, QaServer::PerformanceHistoryDataKeys::HIGH_NORM, QaServer::PerformanceHistoryDataKeys::HIGH_RETR, QaServer::PerformanceHistoryDataKeys::LOW_ACTN, QaServer::PerformanceHistoryDataKeys::LOW_FULL, QaServer::PerformanceHistoryDataKeys::LOW_GRPH, QaServer::PerformanceHistoryDataKeys::LOW_LOAD, QaServer::PerformanceHistoryDataKeys::LOW_NORM, QaServer::PerformanceHistoryDataKeys::LOW_RETR, QaServer::PerformanceHistoryDataKeys::MSPB_GRPH, QaServer::PerformanceHistoryDataKeys::MSPB_NORM, QaServer::PerformanceHistoryDataKeys::MSPB_RETR, QaServer::PerformanceHistoryDataKeys::SEARCH, QaServer::PerformanceHistoryDataKeys::SRC_BYTES, QaServer::PerformanceHistoryDataKeys::STATS
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
-
#calculate_average_stats ⇒ Hash
Calculate performance statistics including averages only.
-
#calculate_stats_with_percentiles ⇒ Hash
Calculate performance statistics with percentiles.
-
#initialize(records, action: nil) ⇒ PerformanceCalculatorService
constructor
A new instance of PerformanceCalculatorService.
Constructor Details
#initialize(records, action: nil) ⇒ PerformanceCalculatorService
Returns a new instance of PerformanceCalculatorService.
11 12 13 14 15 |
# File 'app/services/qa_server/performance_calculator_service.rb', line 11 def initialize(records, action: nil) @records = records @action = [:search, :fetch].include?(action) ? action : nil @stats = {} end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'app/services/qa_server/performance_calculator_service.rb', line 8 def action @action end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
8 9 10 |
# File 'app/services/qa_server/performance_calculator_service.rb', line 8 def records @records end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
8 9 10 |
# File 'app/services/qa_server/performance_calculator_service.rb', line 8 def stats @stats end |
Instance Method Details
#calculate_average_stats ⇒ Hash
Calculate performance statistics including averages only.
35 36 37 38 39 40 41 |
# File 'app/services/qa_server/performance_calculator_service.rb', line 35 def calculate_average_stats calculate_load_stats(true, false, false) # used for backward compatibility only calculate_retrieve_stats(true, false, false) calculate_graph_load_stats(true, false, false) calculate_normalization_stats(true, false, false) stats end |
#calculate_stats_with_percentiles ⇒ Hash
Calculate performance statistics with percentiles. Min is at the 10th percentile. Max is at the 90th percentile.
23 24 25 26 27 28 29 |
# File 'app/services/qa_server/performance_calculator_service.rb', line 23 def calculate_stats_with_percentiles calculate_retrieve_stats(true, true, true) calculate_graph_load_stats(true, true, true) calculate_normalization_stats(true, true, true) calculate_action_stats(true, true, true) stats end |