Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Set User in result page struct #80

Merged
merged 1 commit into from

2 participants

@rtomayko

The top-level 'User' attribute in the result JSON is set to 'unknown user' in PageTimerStruct and never updated to a real value anywhere that I can see. It's useful to have a valid value here for troubleshooting issues with users stomping and stealing each other's results.

Also uses the already calculated value to prevent creating a new Rack::Request each time the user is needed as happens with the default user provider.

This is just something I was playing around with while troubleshooting and figured I'd send it over. No biggie if it isn't interesting to you.

@rtomayko rtomayko Set User in result page struct
The page['User'] is set to 'unknown user' in PageTimerStruct and
never updated to a real value anywhere that I can see. It's useful
to have a valid value here for troubleshooting issues with users
stomping and stealing each other's results.
11567de
@SamSaffron SamSaffron merged commit 456b637 into SamSaffron:master
@SamSaffron
Owner

looks fine to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 30, 2012
  1. @rtomayko

    Set User in result page struct

    rtomayko authored
    The page['User'] is set to 'unknown user' in PageTimerStruct and
    never updated to a real value anywhere that I can see. It's useful
    to have a valid value here for troubleshooting issues with users
    stomping and stealing each other's results.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  Ruby/lib/mini_profiler/profiler.rb
View
3  Ruby/lib/mini_profiler/profiler.rb
@@ -316,6 +316,7 @@ def call(env)
end
page_struct = current.page_struct
+ page_struct['User'] = user(env)
page_struct['Root'].record_time((Time.now - start) * 1000)
if backtraces
@@ -325,7 +326,7 @@ def call(env)
# no matter what it is, it should be unviewed, otherwise we will miss POST
- @storage.set_unviewed(user(env), page_struct['Id'])
+ @storage.set_unviewed(page_struct['User'], page_struct['Id'])
@storage.save(page_struct)
# inject headers, script
Something went wrong with that request. Please try again.