class
CQL::Performance::Monitor
- CQL::Performance::Monitor
- Reference
- Object
Overview
Monitor with dependency injection
Included Modules
Defined in:
performance/monitor.crConstant Summary
-
Log =
::Log.for(self)
Constructors
Instance Method Summary
-
#clear
Clear all data
-
#close : Nil
Stops the async queue, skipping the statements it still holds;
#recordis synchronous afterwards. -
#configure(&)
Configuration
-
#counters : MonitorCounters
What the monitor itself observed since it was built or last cleared;
overheadis estimated from one statement in 64 andpool_waitcounts a wait under 1 µs (a free connection) as zero. -
#critical_issues : Array(Issue)
Get critical issues
- #detector : NPlusOneDetectorInterface | Nil
-
#enabled? : Bool
Check if monitoring is enabled
- #end_relation_loading
- #error_count : Int32
-
#flush(timeout : Time::Span | Nil = nil) : Bool
True once every statement recorded before it was handled, at once when recording is synchronous; false on timeout.
-
#generate_report(format : String | Nil = nil) : String
Report generation
-
#healthy? : Bool
Same answer as
metrics.healthy?, without building the rest of the metrics -
#high_priority_issues : Array(Issue)
Get high priority issues
-
#metrics : PerformanceMetrics
Get comprehensive performance metrics
-
#metrics_summary : Hash(String, String | Int64 | Float64)
Get metrics summary
-
#monitor_query(sql : String, params : Array(DB::Any) = [] of DB::Any, &)
Main monitoring methods
-
#profiler : QueryProfilerInterface | Nil
Component access
-
#record(event : CQL::Telemetry::QueryEvent, params : Array(DB::Any)) : Nil
Records a statement
CQL::Execution.runhas already timed, on the async queue's fiber when monitoring is async. -
#start_relation_loading(relation_name : String, parent_model : String)
Relation loading hooks
-
#track(sql : String, params : Array(DB::Any) = [] of DB::Any, &)
API - just wrap the query
-
#with_context(context : String, &)
Context management
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
Stops the async queue, skipping the statements it still holds; #record is synchronous afterwards.
What the monitor itself observed since it was built or last cleared; overhead is estimated from one statement in 64
and pool_wait counts a wait under 1 µs (a free connection) as zero.
True once every statement recorded before it was handled, at once when recording is synchronous; false on timeout.
Main monitoring methods
Records a statement CQL::Execution.run has already timed, on the async queue's fiber when monitoring is async.
API - just wrap the query