Sha256: 133b43f0dda31e3d6b26fcd96b5038432a822296815ea46b745395db2797a677

Contents?: true

Size: 448 Bytes

Versions: 1

Compression:

Stored size: 448 Bytes

Contents

# frozen_string_literal: true

module Dial
  module RailsStat
    private

    def server_timing headers
      timing = if ::ActionDispatch.const_defined? "Constants::SERVER_TIMING"
        headers[::ActionDispatch::Constants::SERVER_TIMING]
      else
        headers["Server-Timing"]
      end
      (timing || "").split(", ").to_h do |pair|
        event, duration = pair.split ";dur="
        [event, duration.to_f]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dial-0.1.3 lib/dial/middleware/rails_stat.rb