rails_mini_profiler 0.7.1 → 0.7.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf80c23de0eb365fe7d08849fa5afd481bcc5f88688e624f2579e8150951b117
|
4
|
+
data.tar.gz: 4cad20db870e39edfd3eaf88563925a4af583a225987876ce937bf0ba699d10e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38f5d7cb76745769b83055e9a7c466ee069d6fd508dc68552815fc5d7feed841c5e884f42c939781d862b9611cb21466e75928be24234c295bca4a5f68bf73a9
|
7
|
+
data.tar.gz: af53189f0036e15210ba195d2fbc35b6182239dca5365bc19fa83e44776be8e44e9d031507057c3c2154b989479860232d750b538a50facddd4e4e8493b7d15f
|
@@ -5,12 +5,12 @@
|
|
5
5
|
# Table name: rmp_traces
|
6
6
|
#
|
7
7
|
# id :integer not null, primary key
|
8
|
-
# rmp_profiled_request_id :
|
8
|
+
# rmp_profiled_request_id :integer not null
|
9
9
|
# name :string
|
10
|
-
# start :
|
11
|
-
# finish :
|
10
|
+
# start :integer
|
11
|
+
# finish :integer
|
12
12
|
# duration :integer
|
13
|
-
# allocations :
|
13
|
+
# allocations :integer
|
14
14
|
# payload :json
|
15
15
|
# backtrace :json
|
16
16
|
# created_at :datetime not null
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class CreateRmp < ActiveRecord::Migration[6.0]
|
4
4
|
def change
|
5
|
-
create_table :rmp_profiled_requests do |t|
|
5
|
+
create_table :rmp_profiled_requests, charset: 'utf8' do |t|
|
6
6
|
t.string :user_id
|
7
7
|
t.bigint :start
|
8
8
|
t.bigint :finish
|
@@ -23,7 +23,7 @@ class CreateRmp < ActiveRecord::Migration[6.0]
|
|
23
23
|
t.index :created_at
|
24
24
|
end
|
25
25
|
|
26
|
-
create_table :rmp_traces do |t|
|
26
|
+
create_table :rmp_traces, charset: 'utf8' do |t|
|
27
27
|
t.belongs_to :rmp_profiled_request, null: false, foreign_key: true
|
28
28
|
t.string :name
|
29
29
|
t.bigint :start
|
@@ -36,7 +36,7 @@ class CreateRmp < ActiveRecord::Migration[6.0]
|
|
36
36
|
t.timestamps
|
37
37
|
end
|
38
38
|
|
39
|
-
create_table :rmp_flamegraphs do |t|
|
39
|
+
create_table :rmp_flamegraphs, charset: 'utf8' do |t|
|
40
40
|
t.belongs_to :rmp_profiled_request, null: false, foreign_key: true
|
41
41
|
t.binary :data
|
42
42
|
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module RailsMiniProfiler
|
4
4
|
module Tracers
|
5
5
|
class Tracer
|
6
|
+
TIMESTAMP_MULTIPLIER = Rails::VERSION::MAJOR < 7 ? 100 : 1
|
7
|
+
|
6
8
|
class << self
|
7
9
|
def subscribes_to
|
8
10
|
[]
|
@@ -28,13 +30,18 @@ module RailsMiniProfiler
|
|
28
30
|
private
|
29
31
|
|
30
32
|
def event_data(event)
|
31
|
-
start
|
32
|
-
|
33
|
+
# Rails 7 changes event timings and now uses CPU milliseconds as float for start and end. We multiply by 100
|
34
|
+
# to convert the float with precision of 2 digits to integer, because integers are just easier to store and
|
35
|
+
# process than floats.
|
36
|
+
#
|
37
|
+
# See https://github.com/rails/rails/commit/81d0dc90becfe0b8e7f7f26beb66c25d84b8ec7f
|
38
|
+
start = (event.time.to_f * TIMESTAMP_MULTIPLIER).to_i
|
39
|
+
finish = (event.end.to_f * TIMESTAMP_MULTIPLIER).to_i
|
33
40
|
{
|
34
41
|
name: event.name,
|
35
42
|
start: start,
|
36
43
|
finish: finish,
|
37
|
-
duration:
|
44
|
+
duration: (event.duration.to_f * 100).to_i,
|
38
45
|
allocations: event.allocations,
|
39
46
|
backtrace: Rails.backtrace_cleaner.clean(caller),
|
40
47
|
payload: event.payload
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_mini_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hschne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inline_svg
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
- !ruby/object:Gem::Version
|
258
258
|
version: '0'
|
259
259
|
requirements: []
|
260
|
-
rubygems_version: 3.
|
260
|
+
rubygems_version: 3.3.7
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Performance profiling for your Rails app, made simple
|