rack-mini-profiler 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +2 -1
  4. data/lib/html/includes.css +5 -5
  5. data/lib/html/includes.js +38 -3
  6. data/lib/html/includes.scss +1 -1
  7. data/lib/html/includes.tmpl +5 -0
  8. data/lib/html/profile_handler.js +1 -1
  9. data/lib/mini_profiler/asset_version.rb +1 -1
  10. data/lib/mini_profiler/client_settings.rb +11 -12
  11. data/lib/mini_profiler/config.rb +17 -17
  12. data/lib/mini_profiler/context.rb +3 -3
  13. data/lib/mini_profiler/gc_profiler.rb +15 -16
  14. data/lib/mini_profiler/profiler.rb +50 -54
  15. data/lib/mini_profiler/profiling_methods.rb +4 -4
  16. data/lib/mini_profiler/storage/file_store.rb +10 -7
  17. data/lib/mini_profiler/storage/memcache_store.rb +4 -5
  18. data/lib/mini_profiler/storage/memory_store.rb +2 -3
  19. data/lib/mini_profiler/storage/redis_store.rb +2 -2
  20. data/lib/mini_profiler/timer_struct/base.rb +2 -2
  21. data/lib/mini_profiler/timer_struct/client.rb +6 -7
  22. data/lib/mini_profiler/timer_struct/custom.rb +4 -4
  23. data/lib/mini_profiler/timer_struct/page.rb +26 -25
  24. data/lib/mini_profiler/timer_struct/request.rb +25 -24
  25. data/lib/mini_profiler/timer_struct/sql.rb +20 -20
  26. data/lib/mini_profiler/version.rb +1 -1
  27. data/lib/mini_profiler_rails/railtie.rb +3 -3
  28. data/lib/patches/db/activerecord.rb +2 -2
  29. data/lib/patches/db/moped.rb +2 -2
  30. data/lib/patches/db/mysql2.rb +5 -5
  31. data/lib/patches/db/nobrainer.rb +1 -1
  32. data/lib/patches/db/pg.rb +34 -16
  33. data/lib/patches/db/riak.rb +11 -11
  34. data/lib/patches/db/rsolr.rb +2 -2
  35. data/rack-mini-profiler.gemspec +5 -4
  36. metadata +18 -4
@@ -20,7 +20,7 @@ end
20
20
  class Riak::Client
21
21
 
22
22
  alias_method :buckets_without_profiling, :buckets
23
- def buckets(options={}, &blk)
23
+ def buckets(options = {}, &blk)
24
24
  profile("buckets #{options}") { buckets_without_profiling(options, &blk) }
25
25
  end
26
26
 
@@ -30,32 +30,32 @@ class Riak::Client
30
30
  end
31
31
 
32
32
  alias_method :delete_object_without_profiling, :delete_object
33
- def delete_object(bucket, key, options={})
33
+ def delete_object(bucket, key, options = {})
34
34
  profile("delete_object bucket=#{bucket.name} key=#{key} options=#{options}") { delete_object_without_profiling(bucket, key, options) }
35
35
  end
36
36
 
37
37
  alias_method :get_bucket_props_without_profiling, :get_bucket_props
38
- def get_bucket_props(bucket, options={})
38
+ def get_bucket_props(bucket, options = {})
39
39
  profile("get_bucket_props bucket=#{bucket.name} options=#{options}") { get_bucket_props_without_profiling(bucket, options) }
40
40
  end
41
41
 
42
42
  alias_method :get_index_without_profiling, :get_index
43
- def get_index(bucket, index, query, options={})
43
+ def get_index(bucket, index, query, options = {})
44
44
  profile("get_index bucket=#{bucket.name} index=#{index} query=#{query} options=#{options}") { get_index_without_profiling(bucket, index, query, options) }
45
45
  end
46
46
 
47
47
  alias_method :get_preflist_without_profiling, :get_preflist
48
- def get_preflist(bucket, key, type=nil, options={})
48
+ def get_preflist(bucket, key, type = nil, options = {})
49
49
  profile("get_preflist bucket=#{bucket.name} key=#{key} type=#{type} options=#{options}") { get_preflist_without_profiling(bucket, key, type, options) }
50
50
  end
51
51
 
52
52
  alias_method :get_object_without_profiling, :get_object
53
- def get_object(bucket, key, options={})
53
+ def get_object(bucket, key, options = {})
54
54
  profile("get_object bucket=#{bucket.name} key=#{key} options=#{options}") { get_object_without_profiling(bucket, key, options) }
55
55
  end
56
56
 
57
57
  alias_method :list_keys_without_profiling, :list_keys
58
- def list_keys(bucket, options={}, &block)
58
+ def list_keys(bucket, options = {}, &block)
59
59
  profile("list_keys bucket=#{bucket.name} options=#{options}") { list_keys_without_profiling(bucket, options, &block) }
60
60
  end
61
61
 
@@ -70,22 +70,22 @@ class Riak::Client
70
70
  end
71
71
 
72
72
  alias_method :reload_object_without_profiling, :reload_object
73
- def reload_object(object, options={})
73
+ def reload_object(object, options = {})
74
74
  profile("reload_object bucket=#{object.bucket.name} key=#{object.key} vclock=#{object.vclock} options=#{options}") { reload_object_without_profiling(object, options) }
75
75
  end
76
76
 
77
77
  alias_method :set_bucket_props_without_profiling, :set_bucket_props
78
- def set_bucket_props(bucket, properties, type=nil)
78
+ def set_bucket_props(bucket, properties, type = nil)
79
79
  profile("set_bucket_props bucket=#{bucket.name} type=#{type}") { set_bucket_props_without_profiling(bucket, properties, type) }
80
80
  end
81
81
 
82
82
  alias_method :clear_bucket_props_without_profiling, :clear_bucket_props
83
- def clear_bucket_props(bucket, options={})
83
+ def clear_bucket_props(bucket, options = {})
84
84
  profile("clear_bucket_props bucket=#{bucket.name} options=#{options}") { clear_bucket_props_without_profiling(bucket, options) }
85
85
  end
86
86
 
87
87
  alias_method :store_object_without_profiling, :store_object
88
- def store_object(object, options={})
88
+ def store_object(object, options = {})
89
89
  profile("store_object bucket=#{object.bucket.name} key=#{object.key} vclock=#{object.vclock} options=#{options}") { store_object_without_profiling(object, options) }
90
90
  end
91
91
 
@@ -10,8 +10,8 @@ class RSolr::Connection
10
10
  elapsed_time = SqlPatches.elapsed_time(start)
11
11
 
12
12
  data = "#{request_context[:method].upcase} #{request_context[:uri]}".dup
13
- if request_context[:method] == :post and request_context[:data]
14
- if request_context[:headers].include?("Content-Type") and request_context[:headers]["Content-Type"] == "text/xml"
13
+ if (request_context[:method] == :post) && request_context[:data]
14
+ if request_context[:headers].include?("Content-Type") && (request_context[:headers]["Content-Type"] == "text/xml")
15
15
  # it's xml, unescaping isn't needed
16
16
  data << "\n#{request_context[:data]}"
17
17
  else
@@ -6,24 +6,24 @@ Gem::Specification.new do |s|
6
6
  s.name = "rack-mini-profiler"
7
7
  s.version = Rack::MiniProfiler::VERSION
8
8
  s.summary = "Profiles loading speed for rack applications."
9
- s.authors = ["Sam Saffron","Robin Ward","Aleks Totic"]
9
+ s.authors = ["Sam Saffron", "Robin Ward", "Aleks Totic"]
10
10
  s.description = "Profiling toolkit for Rack applications with Rails integration. Client Side profiling, DB profiling and Server profiling."
11
11
  s.email = "sam.saffron@gmail.com"
12
12
  s.homepage = "http://miniprofiler.com"
13
13
  s.license = "MIT"
14
14
  s.files = [
15
15
  'rack-mini-profiler.gemspec',
16
- ].concat( Dir.glob('lib/**/*').reject {|f| File.directory?(f) || f =~ /~$/ } )
16
+ ].concat(Dir.glob('lib/**/*').reject { |f| File.directory?(f) || f =~ /~$/ })
17
17
  s.extra_rdoc_files = [
18
18
  "README.md",
19
19
  "CHANGELOG.md"
20
20
  ]
21
21
  s.add_runtime_dependency 'rack', '>= 1.2.0'
22
- s.required_ruby_version = '>= 2.2.0'
22
+ s.required_ruby_version = '>= 2.3.0'
23
23
 
24
24
  s.metadata = {
25
25
  'source_code_uri' => 'https://github.com/MiniProfiler/rack-mini-profiler',
26
- 'changelog_uri' => 'https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md'
26
+ 'changelog_uri' => 'https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md'
27
27
  }
28
28
 
29
29
  s.add_development_dependency 'rake', '< 11'
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_development_dependency 'redis'
35
35
  s.add_development_dependency 'sass'
36
36
  s.add_development_dependency 'flamegraph'
37
+ s.add_development_dependency 'rubocop'
37
38
 
38
39
  s.require_paths = ["lib"]
39
40
  end
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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-03-29 00:00:00.000000000 Z
13
+ date: 2018-12-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -138,6 +138,20 @@ dependencies:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
+ - !ruby/object:Gem::Dependency
142
+ name: rubocop
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ type: :development
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
141
155
  description: Profiling toolkit for Rack applications with Rails integration. Client
142
156
  Side profiling, DB profiling and Server profiling.
143
157
  email: sam.saffron@gmail.com
@@ -213,7 +227,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
227
  requirements:
214
228
  - - ">="
215
229
  - !ruby/object:Gem::Version
216
- version: 2.2.0
230
+ version: 2.3.0
217
231
  required_rubygems_version: !ruby/object:Gem::Requirement
218
232
  requirements:
219
233
  - - ">="
@@ -221,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
235
  version: '0'
222
236
  requirements: []
223
237
  rubyforge_project:
224
- rubygems_version: 2.6.13
238
+ rubygems_version: 2.7.6
225
239
  signing_key:
226
240
  specification_version: 4
227
241
  summary: Profiles loading speed for rack applications.