Skip to content

Commit

Permalink
Don't capture queue time for websocket requests (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrothrock committed Mar 27, 2024
1 parent bf9fb4b commit cdaa532
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -15,6 +15,9 @@ def record!

return unless headers

# When an application uses Turbo Streams, we capture very innaccurate queue times.
return if request_over_websocket?

raw_start = locate_timestamp
return unless raw_start

Expand All @@ -38,6 +41,10 @@ def record!

private

def request_over_websocket?
headers["Upgrade"] == "websocket"
end

# Looks through the possible headers with this data, and extracts the raw
# value of the header
# Returns nil if not found
Expand Down

0 comments on commit cdaa532

Please sign in to comment.