class

Azu::Handler::PerformanceMonitor

Inherits HTTP::Handler < Reference < Object

Performance monitoring handler that tracks request metrics automatically Integrates with the existing handler chain to provide transparent performance tracking

Constructors

new(metrics : PerformanceMetrics = PerformanceMetrics.new, log : Log = CONFIG.log)

Initialize with optional custom metrics collector

Source

Instance methods

clear_metrics

Clear all collected metrics

Source
enabled=(value : Bool)

Enable or disable monitoring

Source
enabled?
Source
endpoint_stats(endpoint : String, since : Time | Nil = nil)

Get endpoint-specific statistics

Source
generate_beautiful_report(since : Time | Nil = nil) : String

Generate beautifully formatted performance report for terminal display

Source
generate_report(since : Time | Nil = nil) : String

Generate performance report

Source
log_beautiful_report(since : Time | Nil = nil)

Generate beautiful terminal performance report with colors and formatting

Source
log_summary_report(since : Time | Nil = nil)

Log performance summary in a compact beautiful format

Source
metrics
Source
recent_requests(limit : Int32 = 50)

Get recent request metrics for debugging

Source
stats(since : Time | Nil = nil)

Get current performance metrics

Source
to_json(io : IO)

Export metrics as JSON

Source