rack-mini-profiler 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack-mini-profiler might be problematic. Click here for more details.
- data/CHANGELOG.md +7 -0
- data/README.md +0 -10
- data/lib/mini_profiler/profiler.rb +11 -8
- data/lib/mini_profiler/storage/redis_store.rb +2 -1
- data/lib/mini_profiler_rails/railtie.rb +6 -3
- data/rack-mini-profiler.gemspec +4 -3
- metadata +6 -4
data/CHANGELOG.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
28-June-2012 - Sam
|
2
|
+
|
3
|
+
* Started change log
|
4
|
+
* Corrected profiler so it properly captures POST requests (was supressing non 200s)
|
5
|
+
* Amended Rack.MiniProfiler.config[:user_provider] to use ip addres for identity
|
6
|
+
* Fixed bug where unviewed missing ids never got cleared
|
7
|
+
* Supress all '/assets/' in the rails tie (makes debugging easier)
|
data/README.md
CHANGED
@@ -70,13 +70,3 @@ In a Rails app, this can be done conveniently in an initializer such as config/i
|
|
70
70
|
* skip_schema_queries - Whether or not you want to log the queries about the schema of your tables. Default is 'true'
|
71
71
|
|
72
72
|
|
73
|
-
## TODO: prior to release - pull requests welcome
|
74
|
-
|
75
|
-
- Stack Traces for SQL called (added but mental, needs to be filtered to something usable)
|
76
|
-
- Decide if we hook up SQL at the driver level (eg mysql gem) or library level (eg active record) - my personal perference is to do driver level hooks (Sam)
|
77
|
-
- Add automatic instrumentation for Rails (Controller times, Action times, Partial times, Layout times)
|
78
|
-
- Grab / display the parameters of SQL executed for parameterized SQL
|
79
|
-
- Beef up the documentation
|
80
|
-
- Auto-wire-up rails middleware
|
81
|
-
- Review our API and ensure it is trivial
|
82
|
-
|
@@ -38,7 +38,7 @@ module Rack
|
|
38
38
|
:backtrace_filter => nil,
|
39
39
|
:skip_schema_queries => true,
|
40
40
|
:storage => MiniProfiler::MemoryStore,
|
41
|
-
:user_provider => Proc.new{|env|
|
41
|
+
:user_provider => Proc.new{|env| Rack::Request.new(env).ip }
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
@@ -76,16 +76,17 @@ module Rack
|
|
76
76
|
|
77
77
|
def serve_results(env)
|
78
78
|
request = Rack::Request.new(env)
|
79
|
-
|
79
|
+
id = request['id']
|
80
|
+
page_struct = @storage.load(id)
|
80
81
|
unless page_struct
|
81
|
-
@storage.set_viewed(user(env),
|
82
|
-
|
82
|
+
@storage.set_viewed(user(env), id)
|
83
|
+
return [404, {}, ["Request not found: #{request['id']} - user #{user(env)}"]]
|
83
84
|
end
|
84
85
|
unless page_struct['HasUserViewed']
|
85
86
|
page_struct['ClientTimings'].init_from_form_data(env, page_struct)
|
86
87
|
page_struct['HasUserViewed'] = true
|
87
88
|
@storage.save(page_struct)
|
88
|
-
@storage.set_viewed(user(env),
|
89
|
+
@storage.set_viewed(user(env), id)
|
89
90
|
end
|
90
91
|
|
91
92
|
result_json = page_struct.to_json
|
@@ -194,10 +195,12 @@ module Rack
|
|
194
195
|
page_struct = current['page_struct']
|
195
196
|
page_struct['Root'].record_time((Time.now - start) * 1000)
|
196
197
|
|
197
|
-
|
198
|
+
# no matter what it is, it should be unviewed, otherwise we will miss POST
|
199
|
+
@storage.set_unviewed(user(env), page_struct['Id'])
|
200
|
+
@storage.save(page_struct)
|
201
|
+
|
202
|
+
# inject headers, script
|
198
203
|
if status == 200
|
199
|
-
@storage.save(page_struct)
|
200
|
-
@storage.set_unviewed(user(env), page_struct['Id'])
|
201
204
|
|
202
205
|
# inject header
|
203
206
|
if headers.is_a? Hash
|
@@ -4,9 +4,14 @@ module MiniProfilerRails
|
|
4
4
|
initializer "rack_mini_profiler.configure_rails_initialization" do |app|
|
5
5
|
|
6
6
|
# By default, only show the MiniProfiler in development mode
|
7
|
-
Rack::MiniProfiler.configuration[:authorize_cb] = lambda {|env|
|
7
|
+
Rack::MiniProfiler.configuration[:authorize_cb] = lambda { |env|
|
8
|
+
Rails.env.development? && !(env['PATH_INFO'] =~ /^\/assets\//)
|
9
|
+
}
|
10
|
+
|
11
|
+
# The file store is just so much less flaky
|
8
12
|
tmp = Rails.root.to_s + "/tmp/miniprofiler"
|
9
13
|
Dir::mkdir(tmp) unless File.exists?(tmp)
|
14
|
+
|
10
15
|
Rack::MiniProfiler.configuration[:storage_options] = {:path => tmp}
|
11
16
|
Rack::MiniProfiler.configuration[:storage] = Rack::MiniProfiler::FileStore
|
12
17
|
|
@@ -14,8 +19,6 @@ module MiniProfilerRails
|
|
14
19
|
Rack::MiniProfiler.configuration[:backtrace_remove] = Rails.root.to_s + "/"
|
15
20
|
Rack::MiniProfiler.configuration[:backtrace_filter] = /^\/?(app|config|lib|test)/
|
16
21
|
|
17
|
-
# The file store is just so much less flaky
|
18
|
-
|
19
22
|
# Install the Middleware
|
20
23
|
app.middleware.insert_before 'Rack::Lock', 'Rack::MiniProfiler'
|
21
24
|
|
data/rack-mini-profiler.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "rack-mini-profiler"
|
3
|
-
s.version = "0.1"
|
4
|
-
s.summary = "Profiles loading speed for
|
3
|
+
s.version = "0.1.1"
|
4
|
+
s.summary = "Profiles loading speed for rack applications."
|
5
5
|
s.authors = ["Aleks Totic","Sam Saffron", "Robin Ward"]
|
6
6
|
s.date = "2012-04-02"
|
7
7
|
s.description = "Page loading speed displayed on every page. Optimize while you develop, performance is a feature."
|
@@ -11,7 +11,8 @@ Gem::Specification.new do |s|
|
|
11
11
|
'rack-mini-profiler.gemspec',
|
12
12
|
].concat( Dir.glob('lib/**/*').reject {|f| File.directory?(f) || f =~ /~$/ } )
|
13
13
|
s.extra_rdoc_files = [
|
14
|
-
"README.md"
|
14
|
+
"README.md",
|
15
|
+
"CHANGELOG.md"
|
15
16
|
]
|
16
17
|
s.add_runtime_dependency 'rack', '>= 1.1.3'
|
17
18
|
if RUBY_VERSION < "1.9"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-mini-profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -84,6 +84,7 @@ executables: []
|
|
84
84
|
extensions: []
|
85
85
|
extra_rdoc_files:
|
86
86
|
- README.md
|
87
|
+
- CHANGELOG.md
|
87
88
|
files:
|
88
89
|
- rack-mini-profiler.gemspec
|
89
90
|
- lib/mini_profiler/sql_timer_struct.rb
|
@@ -113,6 +114,7 @@ files:
|
|
113
114
|
- lib/mini_profiler_rails/railtie.rb
|
114
115
|
- lib/patches/sql_patches.rb
|
115
116
|
- README.md
|
117
|
+
- CHANGELOG.md
|
116
118
|
homepage: http://miniprofiler.com
|
117
119
|
licenses: []
|
118
120
|
post_install_message:
|
@@ -127,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
129
|
version: '0'
|
128
130
|
segments:
|
129
131
|
- 0
|
130
|
-
hash: -
|
132
|
+
hash: -779964803
|
131
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
134
|
none: false
|
133
135
|
requirements:
|
@@ -136,11 +138,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
138
|
version: '0'
|
137
139
|
segments:
|
138
140
|
- 0
|
139
|
-
hash: -
|
141
|
+
hash: -779964803
|
140
142
|
requirements: []
|
141
143
|
rubyforge_project:
|
142
144
|
rubygems_version: 1.8.24
|
143
145
|
signing_key:
|
144
146
|
specification_version: 3
|
145
|
-
summary: Profiles loading speed for
|
147
|
+
summary: Profiles loading speed for rack applications.
|
146
148
|
test_files: []
|