rails_mini_profiler 0 → 0.1.0
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.
- checksums.yaml +4 -4
- data/README.md +29 -111
- data/Rakefile +18 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/bookmark.svg +0 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/chart.svg +0 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/delete.svg +0 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/graph.svg +0 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/logo.svg +0 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/logo_variant.svg +2 -2
- data/app/assets/images/rails_mini_profiler/search.svg +10 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/setting.svg +0 -0
- data/app/{javascript/images → assets/images/rails_mini_profiler}/show.svg +0 -0
- data/app/assets/javascripts/rails_mini_profiler.js +76 -1
- data/app/assets/stylesheets/rails_mini_profiler/application.css +149 -1
- data/app/assets/stylesheets/rails_mini_profiler/flamegraph.css +14 -0
- data/app/{javascript/stylesheets/flashes.scss → assets/stylesheets/rails_mini_profiler/flashes.css} +5 -3
- data/app/{javascript/stylesheets/navbar.scss → assets/stylesheets/rails_mini_profiler/navbar.css} +14 -8
- data/app/assets/stylesheets/rails_mini_profiler/profiled_requests.css +180 -0
- data/app/{javascript/stylesheets/traces.scss → assets/stylesheets/rails_mini_profiler/traces.css} +22 -17
- data/app/controllers/rails_mini_profiler/application_controller.rb +4 -9
- data/app/controllers/rails_mini_profiler/profiled_requests_controller.rb +10 -23
- data/app/helpers/rails_mini_profiler/application_helper.rb +0 -11
- data/app/models/rails_mini_profiler/application_record.rb +1 -1
- data/app/models/rails_mini_profiler/controller_trace.rb +3 -7
- data/app/models/rails_mini_profiler/flamegraph.rb +0 -4
- data/app/models/rails_mini_profiler/instantiation_trace.rb +3 -7
- data/app/models/rails_mini_profiler/profiled_request.rb +15 -21
- data/app/models/rails_mini_profiler/render_partial_trace.rb +3 -7
- data/app/models/rails_mini_profiler/render_template_trace.rb +3 -7
- data/app/models/rails_mini_profiler/rmp_trace.rb +3 -7
- data/app/models/rails_mini_profiler/sequel_trace.rb +3 -7
- data/app/models/rails_mini_profiler/trace.rb +3 -7
- data/app/presenters/rails_mini_profiler/profiled_request_presenter.rb +15 -8
- data/app/views/layouts/rails_mini_profiler/application.html.erb +12 -1
- data/app/views/layouts/rails_mini_profiler/flamegraph.html.erb +8 -1
- data/app/views/rails_mini_profiler/badge.html.erb +2 -2
- data/app/views/rails_mini_profiler/profiled_requests/index.html.erb +58 -8
- data/app/views/rails_mini_profiler/profiled_requests/show.html.erb +1 -1
- data/app/views/rails_mini_profiler/shared/_navbar.html.erb +1 -1
- data/db/migrate/20210621185018_create_rmp.rb +6 -8
- data/lib/generators/rails_mini_profiler/install_generator.rb +0 -24
- data/lib/generators/rails_mini_profiler/templates/rails_mini_profiler.rb.erb +7 -23
- data/lib/rails_mini_profiler/badge.rb +1 -23
- data/lib/rails_mini_profiler/configuration.rb +4 -28
- data/lib/rails_mini_profiler/engine.rb +4 -15
- data/lib/rails_mini_profiler/errors.rb +8 -0
- data/lib/rails_mini_profiler/guard.rb +7 -18
- data/lib/rails_mini_profiler/logger.rb +0 -5
- data/lib/rails_mini_profiler/middleware.rb +4 -4
- data/lib/rails_mini_profiler/models/base_model.rb +0 -5
- data/lib/rails_mini_profiler/models/trace.rb +9 -0
- data/lib/rails_mini_profiler/redirect.rb +1 -9
- data/lib/rails_mini_profiler/request_context.rb +7 -31
- data/lib/rails_mini_profiler/request_wrapper.rb +8 -44
- data/lib/rails_mini_profiler/storage.rb +29 -0
- data/lib/rails_mini_profiler/tracers.rb +85 -0
- data/lib/rails_mini_profiler/version.rb +1 -1
- data/lib/rails_mini_profiler.rb +9 -33
- metadata +30 -127
- data/LICENSE +0 -20
- data/app/javascript/images/check.svg +0 -3
- data/app/javascript/images/chevron.svg +0 -3
- data/app/javascript/images/filter.svg +0 -1
- data/app/javascript/images/search.svg +0 -9
- data/app/javascript/js/checklist_controller.js +0 -48
- data/app/javascript/js/enable_controller.js +0 -24
- data/app/javascript/js/filter_controller.js +0 -44
- data/app/javascript/js/search_controller.js +0 -18
- data/app/javascript/js/select_controller.js +0 -47
- data/app/javascript/packs/rails-mini-profiler.js +0 -88
- data/app/javascript/stylesheets/components/page_header/page_header.scss +0 -3
- data/app/javascript/stylesheets/components/pagination.scss +0 -55
- data/app/javascript/stylesheets/components/profiled_request_table/placeholder.scss +0 -33
- data/app/javascript/stylesheets/components/profiled_request_table/profiled_request_table.scss +0 -179
- data/app/javascript/stylesheets/flamegraph.scss +0 -10
- data/app/javascript/stylesheets/profiled_requests.scss +0 -89
- data/app/javascript/stylesheets/rails-mini-profiler.scss +0 -205
- data/app/search/rails_mini_profiler/base_search.rb +0 -67
- data/app/search/rails_mini_profiler/profiled_request_search.rb +0 -34
- data/app/views/models/_flamegraph.json.jb +0 -3
- data/app/views/models/_profiled_request.jb +0 -3
- data/app/views/models/_trace.jb +0 -3
- data/app/views/rails_mini_profiler/flamegraphs/show.json.jb +0 -3
- data/app/views/rails_mini_profiler/profiled_requests/index.json.jb +0 -3
- data/app/views/rails_mini_profiler/profiled_requests/shared/header/_header.erb +0 -20
- data/app/views/rails_mini_profiler/profiled_requests/shared/table/_placeholder.erb +0 -12
- data/app/views/rails_mini_profiler/profiled_requests/shared/table/_table.erb +0 -14
- data/app/views/rails_mini_profiler/profiled_requests/shared/table/_table_head.erb +0 -125
- data/app/views/rails_mini_profiler/profiled_requests/shared/table/_table_row.erb +0 -21
- data/app/views/rails_mini_profiler/profiled_requests/show.json.jb +0 -5
- data/app/views/rails_mini_profiler/shared/_head.erb +0 -13
- data/lib/generators/rails_mini_profiler/templates/rails_mini_profiler.js.erb +0 -13
- data/lib/rails_mini_profiler/configuration/storage.rb +0 -47
- data/lib/rails_mini_profiler/configuration/user_interface.rb +0 -48
- data/lib/rails_mini_profiler/tracing/controller_tracer.rb +0 -15
- data/lib/rails_mini_profiler/tracing/null_trace.rb +0 -7
- data/lib/rails_mini_profiler/tracing/sequel_tracer.rb +0 -37
- data/lib/rails_mini_profiler/tracing/sequel_tracker.rb +0 -37
- data/lib/rails_mini_profiler/tracing/subscriptions.rb +0 -34
- data/lib/rails_mini_profiler/tracing/trace.rb +0 -45
- data/lib/rails_mini_profiler/tracing/trace_factory.rb +0 -37
- data/lib/rails_mini_profiler/tracing/tracer.rb +0 -31
- data/lib/rails_mini_profiler/tracing/view_tracer.rb +0 -12
- data/lib/rails_mini_profiler/tracing.rb +0 -11
- data/public/rails_mini_profiler/speedscope/LICENSE +0 -21
- data/public/rails_mini_profiler/speedscope/demangle-cpp.1768f4cc.js +0 -4
- data/public/rails_mini_profiler/speedscope/demangle-cpp.1768f4cc.js.map +0 -1
- data/public/rails_mini_profiler/speedscope/favicon-16x16.f74b3187.png +0 -0
- data/public/rails_mini_profiler/speedscope/favicon-32x32.bc503437.png +0 -0
- data/public/rails_mini_profiler/speedscope/file-format-schema.json +0 -324
- data/public/rails_mini_profiler/speedscope/import.e3a73ef4.js +0 -117
- data/public/rails_mini_profiler/speedscope/import.e3a73ef4.js.map +0 -1
- data/public/rails_mini_profiler/speedscope/index.html +0 -2
- data/public/rails_mini_profiler/speedscope/release.txt +0 -3
- data/public/rails_mini_profiler/speedscope/reset.8c46b7a1.css +0 -2
- data/public/rails_mini_profiler/speedscope/reset.8c46b7a1.css.map +0 -1
- data/public/rails_mini_profiler/speedscope/source-map.438fa06b.js +0 -24
- data/public/rails_mini_profiler/speedscope/source-map.438fa06b.js.map +0 -1
- data/public/rails_mini_profiler/speedscope/speedscope.026f36b0.js +0 -200
- data/public/rails_mini_profiler/speedscope/speedscope.026f36b0.js.map +0 -1
- data/vendor/assets/images/bookmark.svg +0 -10
- data/vendor/assets/images/chart.svg +0 -12
- data/vendor/assets/images/check.svg +0 -3
- data/vendor/assets/images/chevron.svg +0 -3
- data/vendor/assets/images/delete.svg +0 -9
- data/vendor/assets/images/filter.svg +0 -1
- data/vendor/assets/images/graph.svg +0 -11
- data/vendor/assets/images/logo.svg +0 -18
- data/vendor/assets/images/logo_variant.svg +0 -32
- data/vendor/assets/images/search.svg +0 -9
- data/vendor/assets/images/setting.svg +0 -10
- data/vendor/assets/images/show.svg +0 -11
- data/vendor/assets/javascripts/rails-mini-profiler.css +0 -1
- data/vendor/assets/javascripts/rails-mini-profiler.js +0 -1
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module RailsMiniProfiler
|
|
4
|
-
# A convenience wrapper around [Rack::Env]
|
|
5
|
-
#
|
|
6
|
-
# @!attribute body
|
|
7
|
-
# @return [String] the request body
|
|
8
|
-
# @!attribute method
|
|
9
|
-
# @return [String] the request method
|
|
10
|
-
# @!attribute path
|
|
11
|
-
# @return [String] the request path
|
|
12
|
-
# @!attribute query_string
|
|
13
|
-
# @return [String] the request query string
|
|
14
|
-
# @!attribute env
|
|
15
|
-
# @return [Rack::Env] the original env
|
|
16
|
-
#
|
|
17
|
-
# @api private
|
|
18
4
|
class RequestWrapper
|
|
19
5
|
attr_reader :body,
|
|
20
6
|
:method,
|
|
@@ -22,43 +8,21 @@ module RailsMiniProfiler
|
|
|
22
8
|
:query_string,
|
|
23
9
|
:env
|
|
24
10
|
|
|
25
|
-
def initialize(
|
|
26
|
-
@
|
|
27
|
-
|
|
11
|
+
def initialize(env = {})
|
|
12
|
+
@env = env
|
|
13
|
+
@method = @env['REQUEST_METHOD'] || 'GET'
|
|
14
|
+
@query_string = @env['QUERY_STRING'] || ''
|
|
15
|
+
@path = @env['PATH_INFO'] || '/'
|
|
16
|
+
@body = read_body
|
|
28
17
|
end
|
|
29
18
|
|
|
30
|
-
# The request headers
|
|
31
|
-
#
|
|
32
|
-
# @return [Hash] the headers
|
|
33
19
|
def headers
|
|
34
|
-
@
|
|
20
|
+
@env.select { |k, _v| k.start_with? 'HTTP_' } || []
|
|
35
21
|
end
|
|
36
22
|
|
|
37
23
|
private
|
|
38
24
|
|
|
39
|
-
def
|
|
40
|
-
@env = @attributes[:env] || {}
|
|
41
|
-
@method = setup_method
|
|
42
|
-
@query_string = setup_query_string
|
|
43
|
-
@path = setup_path
|
|
44
|
-
@body = setup_body
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def setup_method
|
|
48
|
-
@attributes[:method] || @env['REQUEST_METHOD'] || 'GET'
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def setup_query_string
|
|
52
|
-
@attributes[:query_string] || @env['QUERY_STRING'] || ''
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def setup_path
|
|
56
|
-
@attributes[:path] || @env['PATH_INFO'] || '/'
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def setup_body
|
|
60
|
-
return @attributes[:body] if @attributes[:body]
|
|
61
|
-
|
|
25
|
+
def read_body
|
|
62
26
|
return '' unless @env['rack.input']
|
|
63
27
|
|
|
64
28
|
body = @env['rack.input'].read
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RailsMiniProfiler
|
|
4
|
+
class Storage
|
|
5
|
+
class << self
|
|
6
|
+
def configuration
|
|
7
|
+
@configuration ||= new
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def configure
|
|
11
|
+
yield(configuration)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
attr_accessor :database, :profiled_requests_table, :traces_table, :flamegraphs_table
|
|
16
|
+
|
|
17
|
+
def initialize(**kwargs)
|
|
18
|
+
defaults!
|
|
19
|
+
kwargs.each { |key, value| instance_variable_set("@#{key}", value) }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def defaults!
|
|
23
|
+
@database = nil
|
|
24
|
+
@profiled_requests_table = 'rmp_profiled_requests'
|
|
25
|
+
@flamegraphs_table = 'rmp_flamegraphs'
|
|
26
|
+
@traces_table = 'rmp_traces'
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RailsMiniProfiler
|
|
4
|
+
class Tracers
|
|
5
|
+
DEFAULT_SUBSCRIPTIONS = %w[
|
|
6
|
+
sql.active_record
|
|
7
|
+
instantiation.active_record
|
|
8
|
+
render_template.action_view
|
|
9
|
+
render_partial.action_view
|
|
10
|
+
process_action.action_controller
|
|
11
|
+
rails_mini_profiler.total_time
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
class << self
|
|
15
|
+
def setup!(&callback)
|
|
16
|
+
DEFAULT_SUBSCRIPTIONS.each do |event|
|
|
17
|
+
subscribe(event, &callback)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def build_trace(event)
|
|
22
|
+
start = (event.time.to_f * 100_000).to_i
|
|
23
|
+
finish = (event.end.to_f * 100_000).to_i
|
|
24
|
+
Models::Trace.new(
|
|
25
|
+
name: event.name,
|
|
26
|
+
start: start,
|
|
27
|
+
finish: finish,
|
|
28
|
+
duration: finish - start,
|
|
29
|
+
allocations: event.allocations,
|
|
30
|
+
backtrace: Rails.backtrace_cleaner.clean(caller),
|
|
31
|
+
payload: format_payload(event)
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def subscribe(*subscriptions, &callback)
|
|
38
|
+
subscriptions.each do |subscription|
|
|
39
|
+
ActiveSupport::Notifications.subscribe(subscription) do |event|
|
|
40
|
+
callback.call(event)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def format_payload(event)
|
|
46
|
+
case event.name
|
|
47
|
+
when 'sql.active_record'
|
|
48
|
+
transform_sql_event(event)
|
|
49
|
+
when 'render_template.action_view', 'render_partial.action_view'
|
|
50
|
+
event.payload.slice(:identifier, :count)
|
|
51
|
+
when 'process_action.action_controller'
|
|
52
|
+
transform_controller_event(event)
|
|
53
|
+
else
|
|
54
|
+
event.payload
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def transform_sql_event(event)
|
|
59
|
+
payload = event.payload.slice(:name, :sql, :binds, :type_casted_binds)
|
|
60
|
+
typecasted_binds = payload[:type_casted_binds]
|
|
61
|
+
# Sometimes, typecasted binds are a proc. Not sure why. In those instances, we extract the typecasted
|
|
62
|
+
# values from the proc by executing call.
|
|
63
|
+
typecasted_binds = typecasted_binds.respond_to?(:call) ? typecasted_binds.call : typecasted_binds
|
|
64
|
+
payload[:binds] = transform_binds(payload[:binds], typecasted_binds)
|
|
65
|
+
payload.delete(:type_casted_binds)
|
|
66
|
+
payload.reject { |_k, v| v.blank? }
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def transform_binds(binds, type_casted_binds)
|
|
70
|
+
binds.each_with_object([]).with_index do |(binding, object), i|
|
|
71
|
+
name = binding.name
|
|
72
|
+
value = type_casted_binds[i]
|
|
73
|
+
object << { name: name, value: value }
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def transform_controller_event(event)
|
|
78
|
+
payload = event.payload
|
|
79
|
+
.slice(:view_runtime, :db_runtime)
|
|
80
|
+
.transform_values { |value| value&.round(2) }
|
|
81
|
+
payload.reject { |_k, v| v.blank? }
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
data/lib/rails_mini_profiler.rb
CHANGED
|
@@ -2,76 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
require 'forwardable'
|
|
4
4
|
require 'inline_svg'
|
|
5
|
-
require 'pagy'
|
|
6
5
|
|
|
7
6
|
require 'rails_mini_profiler/version'
|
|
8
7
|
require 'rails_mini_profiler/engine'
|
|
9
8
|
|
|
10
|
-
require 'rails_mini_profiler/
|
|
11
|
-
require 'rails_mini_profiler/tracing'
|
|
12
|
-
require 'rails_mini_profiler/configuration'
|
|
9
|
+
require 'rails_mini_profiler/errors'
|
|
13
10
|
|
|
14
11
|
require 'rails_mini_profiler/user'
|
|
15
12
|
require 'rails_mini_profiler/request_context'
|
|
13
|
+
|
|
14
|
+
require 'rails_mini_profiler/models/base_model'
|
|
15
|
+
require 'rails_mini_profiler/models/trace'
|
|
16
|
+
|
|
16
17
|
require 'rails_mini_profiler/logger'
|
|
18
|
+
require 'rails_mini_profiler/configuration'
|
|
19
|
+
require 'rails_mini_profiler/storage'
|
|
17
20
|
require 'rails_mini_profiler/request_wrapper'
|
|
18
21
|
require 'rails_mini_profiler/response_wrapper'
|
|
19
22
|
require 'rails_mini_profiler/guard'
|
|
20
23
|
require 'rails_mini_profiler/flamegraph_guard'
|
|
21
24
|
require 'rails_mini_profiler/redirect'
|
|
22
25
|
require 'rails_mini_profiler/badge'
|
|
26
|
+
require 'rails_mini_profiler/tracers'
|
|
23
27
|
require 'rails_mini_profiler/middleware'
|
|
24
28
|
|
|
25
|
-
# Main namespace for Rails Mini Profiler
|
|
26
29
|
module RailsMiniProfiler
|
|
27
30
|
class << self
|
|
28
|
-
# Create a new configuration object
|
|
29
|
-
#
|
|
30
|
-
# @return [Configuration] a new configuration
|
|
31
31
|
def configuration
|
|
32
32
|
@configuration ||= Configuration.new
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
# Configure Rails Mini Profiler
|
|
36
|
-
#
|
|
37
|
-
# You may use this to configure where and how Rails Mini Profiler stores profiling and storage information.
|
|
38
|
-
#
|
|
39
|
-
# @see https://github.com/hschne/rails-mini-profiler#configuration
|
|
40
|
-
#
|
|
41
|
-
# @yieldreturn [Configuration] a new configuration
|
|
42
35
|
def configure
|
|
43
36
|
yield(configuration)
|
|
44
37
|
end
|
|
45
38
|
|
|
46
|
-
# Access storage configuration.
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
# @return [Storage] a new storage configuration
|
|
50
39
|
def storage_configuration
|
|
51
|
-
configuration.storage
|
|
40
|
+
configuration.storage.configuration
|
|
52
41
|
end
|
|
53
42
|
|
|
54
|
-
# Access the current logger
|
|
55
|
-
#
|
|
56
|
-
# @return [Logger] the logger instance
|
|
57
43
|
def logger
|
|
58
44
|
@logger ||= configuration.logger
|
|
59
45
|
end
|
|
60
46
|
|
|
61
|
-
# Authorize the current user for this request
|
|
62
|
-
#
|
|
63
|
-
# @param current_user [Object] the current user
|
|
64
|
-
#
|
|
65
|
-
# @see User#current_user
|
|
66
47
|
def authorize!(current_user)
|
|
67
48
|
RailsMiniProfiler::User.current_user = current_user
|
|
68
49
|
end
|
|
69
50
|
|
|
70
|
-
# Set the current user for this request
|
|
71
|
-
#
|
|
72
|
-
# @param current_user [Object] the current user
|
|
73
|
-
#
|
|
74
|
-
# @see User#current_user
|
|
75
51
|
def current_user=(current_user)
|
|
76
52
|
RailsMiniProfiler::User.current_user = current_user
|
|
77
53
|
end
|
metadata
CHANGED
|
@@ -1,57 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_mini_profiler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hschne
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: inline_svg
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.7'
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.7'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: jb
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0.8'
|
|
34
|
-
type: :runtime
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0.8'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: pagy
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
17
|
+
- - ">="
|
|
46
18
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
19
|
+
version: '0'
|
|
48
20
|
type: :runtime
|
|
49
21
|
prerelease: false
|
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
23
|
requirements:
|
|
52
|
-
- - "
|
|
24
|
+
- - ">="
|
|
53
25
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
26
|
+
version: '0'
|
|
55
27
|
- !ruby/object:Gem::Dependency
|
|
56
28
|
name: rails
|
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -73,44 +45,30 @@ executables: []
|
|
|
73
45
|
extensions: []
|
|
74
46
|
extra_rdoc_files: []
|
|
75
47
|
files:
|
|
76
|
-
- LICENSE
|
|
77
48
|
- README.md
|
|
49
|
+
- Rakefile
|
|
78
50
|
- app/assets/config/rails_mini_profiler_manifest.js
|
|
51
|
+
- app/assets/images/rails_mini_profiler/bookmark.svg
|
|
52
|
+
- app/assets/images/rails_mini_profiler/chart.svg
|
|
53
|
+
- app/assets/images/rails_mini_profiler/delete.svg
|
|
54
|
+
- app/assets/images/rails_mini_profiler/graph.svg
|
|
55
|
+
- app/assets/images/rails_mini_profiler/logo.svg
|
|
56
|
+
- app/assets/images/rails_mini_profiler/logo_variant.svg
|
|
57
|
+
- app/assets/images/rails_mini_profiler/search.svg
|
|
58
|
+
- app/assets/images/rails_mini_profiler/setting.svg
|
|
59
|
+
- app/assets/images/rails_mini_profiler/show.svg
|
|
79
60
|
- app/assets/javascripts/rails_mini_profiler.js
|
|
80
61
|
- app/assets/stylesheets/rails_mini_profiler/application.css
|
|
62
|
+
- app/assets/stylesheets/rails_mini_profiler/flamegraph.css
|
|
63
|
+
- app/assets/stylesheets/rails_mini_profiler/flashes.css
|
|
64
|
+
- app/assets/stylesheets/rails_mini_profiler/navbar.css
|
|
65
|
+
- app/assets/stylesheets/rails_mini_profiler/profiled_requests.css
|
|
66
|
+
- app/assets/stylesheets/rails_mini_profiler/traces.css
|
|
81
67
|
- app/controllers/rails_mini_profiler/application_controller.rb
|
|
82
68
|
- app/controllers/rails_mini_profiler/flamegraphs_controller.rb
|
|
83
69
|
- app/controllers/rails_mini_profiler/profiled_requests_controller.rb
|
|
84
70
|
- app/helpers/rails_mini_profiler/application_helper.rb
|
|
85
71
|
- app/helpers/rails_mini_profiler/profiled_requests_helper.rb
|
|
86
|
-
- app/javascript/images/bookmark.svg
|
|
87
|
-
- app/javascript/images/chart.svg
|
|
88
|
-
- app/javascript/images/check.svg
|
|
89
|
-
- app/javascript/images/chevron.svg
|
|
90
|
-
- app/javascript/images/delete.svg
|
|
91
|
-
- app/javascript/images/filter.svg
|
|
92
|
-
- app/javascript/images/graph.svg
|
|
93
|
-
- app/javascript/images/logo.svg
|
|
94
|
-
- app/javascript/images/logo_variant.svg
|
|
95
|
-
- app/javascript/images/search.svg
|
|
96
|
-
- app/javascript/images/setting.svg
|
|
97
|
-
- app/javascript/images/show.svg
|
|
98
|
-
- app/javascript/js/checklist_controller.js
|
|
99
|
-
- app/javascript/js/enable_controller.js
|
|
100
|
-
- app/javascript/js/filter_controller.js
|
|
101
|
-
- app/javascript/js/search_controller.js
|
|
102
|
-
- app/javascript/js/select_controller.js
|
|
103
|
-
- app/javascript/packs/rails-mini-profiler.js
|
|
104
|
-
- app/javascript/stylesheets/components/page_header/page_header.scss
|
|
105
|
-
- app/javascript/stylesheets/components/pagination.scss
|
|
106
|
-
- app/javascript/stylesheets/components/profiled_request_table/placeholder.scss
|
|
107
|
-
- app/javascript/stylesheets/components/profiled_request_table/profiled_request_table.scss
|
|
108
|
-
- app/javascript/stylesheets/flamegraph.scss
|
|
109
|
-
- app/javascript/stylesheets/flashes.scss
|
|
110
|
-
- app/javascript/stylesheets/navbar.scss
|
|
111
|
-
- app/javascript/stylesheets/profiled_requests.scss
|
|
112
|
-
- app/javascript/stylesheets/rails-mini-profiler.scss
|
|
113
|
-
- app/javascript/stylesheets/traces.scss
|
|
114
72
|
- app/models/rails_mini_profiler/application_record.rb
|
|
115
73
|
- app/models/rails_mini_profiler/controller_trace.rb
|
|
116
74
|
- app/models/rails_mini_profiler/flamegraph.rb
|
|
@@ -130,103 +88,48 @@ files:
|
|
|
130
88
|
- app/presenters/rails_mini_profiler/rmp_trace_presenter.rb
|
|
131
89
|
- app/presenters/rails_mini_profiler/sequel_trace_presenter.rb
|
|
132
90
|
- app/presenters/rails_mini_profiler/trace_presenter.rb
|
|
133
|
-
- app/search/rails_mini_profiler/base_search.rb
|
|
134
|
-
- app/search/rails_mini_profiler/profiled_request_search.rb
|
|
135
91
|
- app/views/layouts/rails_mini_profiler/application.html.erb
|
|
136
92
|
- app/views/layouts/rails_mini_profiler/flamegraph.html.erb
|
|
137
|
-
- app/views/models/_flamegraph.json.jb
|
|
138
|
-
- app/views/models/_profiled_request.jb
|
|
139
|
-
- app/views/models/_trace.jb
|
|
140
93
|
- app/views/rails_mini_profiler/badge.html.erb
|
|
141
94
|
- app/views/rails_mini_profiler/flamegraphs/show.html.erb
|
|
142
|
-
- app/views/rails_mini_profiler/flamegraphs/show.json.jb
|
|
143
95
|
- app/views/rails_mini_profiler/profiled_requests/index.html.erb
|
|
144
|
-
- app/views/rails_mini_profiler/profiled_requests/index.json.jb
|
|
145
96
|
- app/views/rails_mini_profiler/profiled_requests/shared/_trace.html.erb
|
|
146
|
-
- app/views/rails_mini_profiler/profiled_requests/shared/header/_header.erb
|
|
147
|
-
- app/views/rails_mini_profiler/profiled_requests/shared/table/_placeholder.erb
|
|
148
|
-
- app/views/rails_mini_profiler/profiled_requests/shared/table/_table.erb
|
|
149
|
-
- app/views/rails_mini_profiler/profiled_requests/shared/table/_table_head.erb
|
|
150
|
-
- app/views/rails_mini_profiler/profiled_requests/shared/table/_table_row.erb
|
|
151
97
|
- app/views/rails_mini_profiler/profiled_requests/show.html.erb
|
|
152
|
-
- app/views/rails_mini_profiler/profiled_requests/show.json.jb
|
|
153
98
|
- app/views/rails_mini_profiler/shared/_flashes.html.erb
|
|
154
|
-
- app/views/rails_mini_profiler/shared/_head.erb
|
|
155
99
|
- app/views/rails_mini_profiler/shared/_navbar.html.erb
|
|
156
100
|
- config/routes.rb
|
|
157
101
|
- db/migrate/20210621185018_create_rmp.rb
|
|
158
102
|
- lib/generators/rails_mini_profiler/USAGE
|
|
159
103
|
- lib/generators/rails_mini_profiler/install_generator.rb
|
|
160
|
-
- lib/generators/rails_mini_profiler/templates/rails_mini_profiler.js.erb
|
|
161
104
|
- lib/generators/rails_mini_profiler/templates/rails_mini_profiler.rb.erb
|
|
162
105
|
- lib/rails_mini_profiler.rb
|
|
163
106
|
- lib/rails_mini_profiler/badge.rb
|
|
164
107
|
- lib/rails_mini_profiler/configuration.rb
|
|
165
|
-
- lib/rails_mini_profiler/configuration/storage.rb
|
|
166
|
-
- lib/rails_mini_profiler/configuration/user_interface.rb
|
|
167
108
|
- lib/rails_mini_profiler/engine.rb
|
|
109
|
+
- lib/rails_mini_profiler/errors.rb
|
|
168
110
|
- lib/rails_mini_profiler/flamegraph_guard.rb
|
|
169
111
|
- lib/rails_mini_profiler/guard.rb
|
|
170
112
|
- lib/rails_mini_profiler/logger.rb
|
|
171
113
|
- lib/rails_mini_profiler/middleware.rb
|
|
172
114
|
- lib/rails_mini_profiler/models/base_model.rb
|
|
115
|
+
- lib/rails_mini_profiler/models/trace.rb
|
|
173
116
|
- lib/rails_mini_profiler/redirect.rb
|
|
174
117
|
- lib/rails_mini_profiler/request_context.rb
|
|
175
118
|
- lib/rails_mini_profiler/request_wrapper.rb
|
|
176
119
|
- lib/rails_mini_profiler/response_wrapper.rb
|
|
177
|
-
- lib/rails_mini_profiler/
|
|
178
|
-
- lib/rails_mini_profiler/
|
|
179
|
-
- lib/rails_mini_profiler/tracing/null_trace.rb
|
|
180
|
-
- lib/rails_mini_profiler/tracing/sequel_tracer.rb
|
|
181
|
-
- lib/rails_mini_profiler/tracing/sequel_tracker.rb
|
|
182
|
-
- lib/rails_mini_profiler/tracing/subscriptions.rb
|
|
183
|
-
- lib/rails_mini_profiler/tracing/trace.rb
|
|
184
|
-
- lib/rails_mini_profiler/tracing/trace_factory.rb
|
|
185
|
-
- lib/rails_mini_profiler/tracing/tracer.rb
|
|
186
|
-
- lib/rails_mini_profiler/tracing/view_tracer.rb
|
|
120
|
+
- lib/rails_mini_profiler/storage.rb
|
|
121
|
+
- lib/rails_mini_profiler/tracers.rb
|
|
187
122
|
- lib/rails_mini_profiler/user.rb
|
|
188
123
|
- lib/rails_mini_profiler/version.rb
|
|
189
124
|
- lib/tasks/rails_mini_profiler_tasks.rake
|
|
190
|
-
- public/rails_mini_profiler/speedscope/LICENSE
|
|
191
|
-
- public/rails_mini_profiler/speedscope/demangle-cpp.1768f4cc.js
|
|
192
|
-
- public/rails_mini_profiler/speedscope/demangle-cpp.1768f4cc.js.map
|
|
193
|
-
- public/rails_mini_profiler/speedscope/favicon-16x16.f74b3187.png
|
|
194
|
-
- public/rails_mini_profiler/speedscope/favicon-32x32.bc503437.png
|
|
195
|
-
- public/rails_mini_profiler/speedscope/file-format-schema.json
|
|
196
|
-
- public/rails_mini_profiler/speedscope/import.e3a73ef4.js
|
|
197
|
-
- public/rails_mini_profiler/speedscope/import.e3a73ef4.js.map
|
|
198
|
-
- public/rails_mini_profiler/speedscope/index.html
|
|
199
|
-
- public/rails_mini_profiler/speedscope/release.txt
|
|
200
|
-
- public/rails_mini_profiler/speedscope/reset.8c46b7a1.css
|
|
201
|
-
- public/rails_mini_profiler/speedscope/reset.8c46b7a1.css.map
|
|
202
|
-
- public/rails_mini_profiler/speedscope/source-map.438fa06b.js
|
|
203
|
-
- public/rails_mini_profiler/speedscope/source-map.438fa06b.js.map
|
|
204
|
-
- public/rails_mini_profiler/speedscope/speedscope.026f36b0.js
|
|
205
|
-
- public/rails_mini_profiler/speedscope/speedscope.026f36b0.js.map
|
|
206
|
-
- vendor/assets/images/bookmark.svg
|
|
207
|
-
- vendor/assets/images/chart.svg
|
|
208
|
-
- vendor/assets/images/check.svg
|
|
209
|
-
- vendor/assets/images/chevron.svg
|
|
210
|
-
- vendor/assets/images/delete.svg
|
|
211
|
-
- vendor/assets/images/filter.svg
|
|
212
|
-
- vendor/assets/images/graph.svg
|
|
213
|
-
- vendor/assets/images/logo.svg
|
|
214
|
-
- vendor/assets/images/logo_variant.svg
|
|
215
|
-
- vendor/assets/images/search.svg
|
|
216
|
-
- vendor/assets/images/setting.svg
|
|
217
|
-
- vendor/assets/images/show.svg
|
|
218
|
-
- vendor/assets/javascripts/rails-mini-profiler.css
|
|
219
|
-
- vendor/assets/javascripts/rails-mini-profiler.js
|
|
220
125
|
homepage: https://github.com/hschne/rails-mini-profiler
|
|
221
126
|
licenses:
|
|
222
127
|
- MIT
|
|
223
128
|
metadata:
|
|
224
|
-
bug_tracker_uri: https://github.com/hschne/rails-mini-profiler/issues
|
|
225
|
-
changelog_uri: https://github.com/hschne/rails-mini-profiler/blob/main/CHANGELOG.md
|
|
226
|
-
documentation_uri: https://github.com/hschne/rails-mini-profiler
|
|
227
129
|
homepage_uri: https://github.com/hschne/rails-mini-profiler
|
|
228
130
|
source_code_uri: https://github.com/hschne/rails-mini-profiler
|
|
229
|
-
|
|
131
|
+
changelog_uri: https://github.com/hschne/rails-mini-profiler/CHANGELOG.md
|
|
132
|
+
post_install_message:
|
|
230
133
|
rdoc_options: []
|
|
231
134
|
require_paths:
|
|
232
135
|
- lib
|
|
@@ -234,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
234
137
|
requirements:
|
|
235
138
|
- - ">="
|
|
236
139
|
- !ruby/object:Gem::Version
|
|
237
|
-
version: 2.
|
|
140
|
+
version: 2.7.0
|
|
238
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
142
|
requirements:
|
|
240
143
|
- - ">="
|
|
@@ -242,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
242
145
|
version: '0'
|
|
243
146
|
requirements: []
|
|
244
147
|
rubygems_version: 3.2.3
|
|
245
|
-
signing_key:
|
|
148
|
+
signing_key:
|
|
246
149
|
specification_version: 4
|
|
247
150
|
summary: Performance profiling for your Rails app, made simple
|
|
248
151
|
test_files: []
|
data/LICENSE
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Copyright 2021 hschne
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-filter"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon></svg>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
-
<g id="Iconly/Bulk/Search" stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd">
|
|
4
|
-
<g id="Search" transform="translate(2.000000, 2.000000)" fill="currentColor" fill-rule="nonzero">
|
|
5
|
-
<ellipse id="Ellipse_746" cx="8.59921927" cy="8.65324385" rx="8.59921927" ry="8.65324385"></ellipse>
|
|
6
|
-
<path fill="currentColor" d="M18.674623,19.9552573 C18.3405833,19.9444414 18.0229443,19.8069986 17.7853553,19.5704698 L15.7489321,17.1901566 C15.3123366,16.7908936 15.2766365,16.1123232 15.668898,15.6689038 L15.668898,15.6689038 C15.8525005,15.4831065 16.1021409,15.3786387 16.3625268,15.3786387 C16.6229128,15.3786387 16.8725531,15.4831065 17.0561557,15.6689038 L19.6172468,17.7181208 C19.9861582,18.0957076 20.0999999,18.656254 19.9078887,19.1492153 C19.7157774,19.6421767 19.2536179,19.9754211 18.7279791,20 L18.674623,19.9552573 Z" id="Path_34202" opacity="0.400000006"></path>
|
|
7
|
-
</g>
|
|
8
|
-
</g>
|
|
9
|
-
</svg>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Controller } from "stimulus";
|
|
2
|
-
|
|
3
|
-
export default class extends Controller {
|
|
4
|
-
static targets = ["count"];
|
|
5
|
-
|
|
6
|
-
connect() {
|
|
7
|
-
this.setCount();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
checkAll() {
|
|
11
|
-
this.setAllCheckboxes(true);
|
|
12
|
-
this.setCount();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
checkNone() {
|
|
16
|
-
this.setAllCheckboxes(false);
|
|
17
|
-
this.setCount();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
onChecked() {
|
|
21
|
-
this.setCount();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
setAllCheckboxes(checked) {
|
|
25
|
-
this.checkboxes.forEach((el) => {
|
|
26
|
-
const checkbox = el;
|
|
27
|
-
|
|
28
|
-
if (!checkbox.disabled) {
|
|
29
|
-
checkbox.checked = checked;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
setCount() {
|
|
35
|
-
if (this.hasCountTarget) {
|
|
36
|
-
const count = this.selectedCheckboxes.length;
|
|
37
|
-
this.countTarget.innerHTML = `${count} selected`;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get selectedCheckboxes() {
|
|
42
|
-
return this.checkboxes.filter((c) => c.checked);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
get checkboxes() {
|
|
46
|
-
return new Array(...this.element.querySelectorAll("input[type=checkbox]"));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Controller } from 'stimulus'
|
|
2
|
-
|
|
3
|
-
export default class extends Controller {
|
|
4
|
-
static targets = ["enable"];
|
|
5
|
-
|
|
6
|
-
enable() {
|
|
7
|
-
this.enableTarget.disabled = false;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
disable() {
|
|
11
|
-
this.enableTarget.disabled = true;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
change(event) {
|
|
15
|
-
if (event.type.match(/rmp:select:.*/)) {
|
|
16
|
-
if (event.detail.count > 0) {
|
|
17
|
-
this.enable();
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
this.disable()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|