class
CQL::Performance::NPlusOneDetector
Overview
N+1 detector without event system
Included Modules
Defined in:
performance/n_plus_one_detector.crConstant Summary
-
MAX_PATTERNS =
100
Constructors
Instance Method Summary
-
#clear : Void
Clear all data
- #end_relation_loading : Void
-
#issues : Array(Issue)
Get performance issues
-
#patterns : Array(NPlusOnePattern)
Get detected patterns
-
#record_query(sql : String, normalized_sql : String | Nil = nil) : Void
Direct method call for query recording
-
#start_relation_loading(relation_name : String, parent_model : String) : Void
Mark relation loading boundaries
Instance methods inherited from module CQL::Performance::NPlusOneDetectorInterface
clear : Void
clear,
end_relation_loading : Void
end_relation_loading,
issues : Array(Issue)
issues,
patterns
patterns,
record_query(sql : String, normalized_sql : String | Nil = nil) : Void
record_query,
start_relation_loading(relation_name : String, parent_model : String) : Void
start_relation_loading
Instance methods inherited from class CQL::Performance::BasePerformanceComponent
enabled=(enabled : Bool)
enabled=,
enabled? : Bool
enabled?,
healthy? : Bool
healthy?,
reset
reset,
stats : StatsTracker
stats
Instance methods inherited from module CQL::Performance::TimingUtils
categorize_duration(duration : Time::Span, slow_threshold : Time::Span = 100.milliseconds, very_slow_threshold : Time::Span = 1.second) : Symbol
categorize_duration,
format_duration(duration : Time::Span) : String
format_duration,
measure_execution(&)
measure_execution
Constructor Detail
Instance Method Detail
def record_query(sql : String, normalized_sql : String | Nil = nil) : Void
#
Direct method call for query recording
def start_relation_loading(relation_name : String, parent_model : String) : Void
#
Mark relation loading boundaries