class
Azu::Handler::PerformanceMonitor
- Azu::Handler::PerformanceMonitor
- Reference
- Object
Overview
Performance monitoring handler that tracks request metrics automatically Integrates with the existing handler chain to provide transparent performance tracking
Included Modules
- HTTP::Handler
Defined in:
azu/handler/performance_monitor.crConstructors
-
.new(metrics : PerformanceMetrics = PerformanceMetrics.new, log : Log = CONFIG.log)
Initialize with optional custom metrics collector
Instance Method Summary
- #call(context : HTTP::Server::Context)
-
#clear_metrics
Clear all collected metrics
-
#enabled=(value : Bool)
Enable or disable monitoring
- #enabled?
-
#endpoint_stats(endpoint : String, since : Time | Nil = nil)
Get endpoint-specific statistics
-
#generate_beautiful_report(since : Time | Nil = nil) : String
Generate beautifully formatted performance report for terminal display
-
#generate_report(since : Time | Nil = nil) : String
Generate performance report
- #log : Log
-
#log_beautiful_report(since : Time | Nil = nil)
Generate beautiful terminal performance report with colors and formatting
-
#log_summary_report(since : Time | Nil = nil)
Log performance summary in a compact beautiful format
- #metrics : PerformanceMetrics
-
#recent_requests(limit : Int32 = 50)
Get recent request metrics for debugging
-
#stats(since : Time | Nil = nil)
Get current performance metrics
-
#to_json(io : IO)
Export metrics as JSON
Constructor Detail
Initialize with optional custom metrics collector
Instance Method Detail
Generate beautifully formatted performance report for terminal display
Generate beautiful terminal performance report with colors and formatting
Log performance summary in a compact beautiful format