Class: Familia::Validation::PerformanceAnalyzer
- Inherits:
-
Object
- Object
- Familia::Validation::PerformanceAnalyzer
- Defined in:
- lib/familia/validation/validator.rb
Overview
Analyzes performance characteristics of recorded commands
Instance Attribute Summary collapse
-
#command_sequence ⇒ Object
readonly
Returns the value of attribute command_sequence.
Instance Method Summary collapse
-
#analyze ⇒ Object
-
#initialize(command_sequence) ⇒ PerformanceAnalyzer
constructor
A new instance of PerformanceAnalyzer.
Constructor Details
#initialize(command_sequence) ⇒ PerformanceAnalyzer
Returns a new instance of PerformanceAnalyzer.
300 301 302 |
# File 'lib/familia/validation/validator.rb', line 300 def initialize(command_sequence) @command_sequence = command_sequence end |
Instance Attribute Details
#command_sequence ⇒ Object (readonly)
Returns the value of attribute command_sequence.
298 299 300 |
# File 'lib/familia/validation/validator.rb', line 298 def command_sequence @command_sequence end |
Instance Method Details
#analyze ⇒ Object
304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/familia/validation/validator.rb', line 304 def analyze { total_commands: @command_sequence.command_count, total_duration_ms: total_duration_ms, average_command_time_us: average_command_time, slowest_commands: slowest_commands(5), command_type_breakdown: command_type_breakdown, transaction_efficiency: transaction_efficiency, potential_n_plus_one: detect_n_plus_one_patterns, efficiency_score: calculate_efficiency_score } end |