rack-mini-profiler 0.1.26 → 0.1.31
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.
- checksums.yaml +4 -4
- data/Ruby/CHANGELOG +28 -2
- data/Ruby/README.md +11 -0
- data/Ruby/lib/html/includes.js +82 -67
- data/Ruby/lib/html/includes.tmpl +2 -0
- data/Ruby/lib/mini_profiler/client_settings.rb +11 -11
- data/Ruby/lib/mini_profiler/config.rb +10 -9
- data/Ruby/lib/mini_profiler/context.rb +1 -1
- data/Ruby/lib/mini_profiler/gc_profiler_ruby_head.rb +40 -0
- data/Ruby/lib/mini_profiler/page_timer_struct.rb +4 -4
- data/Ruby/lib/mini_profiler/profiler.rb +98 -121
- data/Ruby/lib/mini_profiler/profiling_methods.rb +31 -11
- data/Ruby/lib/mini_profiler/request_timer_struct.rb +5 -5
- data/Ruby/lib/mini_profiler/sql_timer_struct.rb +1 -1
- data/Ruby/lib/mini_profiler/storage/abstract_store.rb +4 -3
- data/Ruby/lib/mini_profiler/storage/redis_store.rb +3 -3
- data/Ruby/lib/mini_profiler/version.rb +1 -1
- data/Ruby/lib/patches/sql_patches.rb +6 -1
- data/rack-mini-profiler.gemspec +2 -1
- metadata +6 -6
- data/Ruby/lib/html/flamegraph.html +0 -325
- data/Ruby/lib/mini_profiler/flame_graph.rb +0 -54
@@ -1,54 +0,0 @@
|
|
1
|
-
# inspired by https://github.com/brendangregg/FlameGraph
|
2
|
-
|
3
|
-
class Rack::MiniProfiler::FlameGraph
|
4
|
-
def initialize(stacks)
|
5
|
-
@stacks = stacks
|
6
|
-
end
|
7
|
-
|
8
|
-
def graph_data
|
9
|
-
height = 0
|
10
|
-
|
11
|
-
table = []
|
12
|
-
prev = []
|
13
|
-
|
14
|
-
# a 2d array makes collapsing easy
|
15
|
-
@stacks.each_with_index do |stack, pos|
|
16
|
-
col = []
|
17
|
-
|
18
|
-
stack.reverse.map{|r| r.to_s}.each_with_index do |frame, i|
|
19
|
-
|
20
|
-
if !prev[i].nil?
|
21
|
-
last_col = prev[i]
|
22
|
-
if last_col[0] == frame
|
23
|
-
last_col[1] += 1
|
24
|
-
col << nil
|
25
|
-
next
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
prev[i] = [frame, 1]
|
30
|
-
col << prev[i]
|
31
|
-
end
|
32
|
-
prev = prev[0..col.length-1].to_a
|
33
|
-
table << col
|
34
|
-
end
|
35
|
-
|
36
|
-
data = []
|
37
|
-
|
38
|
-
# a 1d array makes rendering easy
|
39
|
-
table.each_with_index do |col, col_num|
|
40
|
-
col.each_with_index do |row, row_num|
|
41
|
-
next unless row && row.length == 2
|
42
|
-
data << {
|
43
|
-
:x => col_num + 1,
|
44
|
-
:y => row_num + 1,
|
45
|
-
:width => row[1],
|
46
|
-
:frame => row[0]
|
47
|
-
}
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
data
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|