Sha256: 7a59af54fe4506e2b59a20e7396ca68c403cac9ba157613411c19859b6bc17ec
Contents?: true
Size: 388 Bytes
Versions: 34
Compression:
Stored size: 388 Bytes
Contents
class Jets::Server class TimingMiddleware def initialize(app) @app = app end def call(env) before = Time.now.to_i status, headers, body = @app.call(env) after = Time.now.to_i log_message = "App took #{after - before} seconds.\n" headers["Timing"] = "App took #{after - before} seconds.\n" [status, headers, body] end end end
Version data entries
34 entries across 34 versions & 1 rubygems