builder_apm 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/builder_apm/shared/_header.html.erb +54 -50
- data/lib/builder_apm/doctor/bravo_chat_ai.rb +2 -5
- data/lib/builder_apm/engine.rb +1 -2
- data/lib/builder_apm/methods/instrumenter.rb +2 -1
- data/lib/builder_apm/middleware/timing.rb +3 -2
- data/lib/builder_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f271eed9dbe6ec02e632386f0b8bfff7bf561e37a025b25cc525a8c78c9b0d64
|
4
|
+
data.tar.gz: a3d8a65a0d8feac72e83b973602f76c6972099f85f01911a033d6f315a1b2b11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94923678e4c89d090943f120f6be815651f3ddd40145487bd57fd9da9133ad42154974b007c24d8685efc3cfe2444e8656384b6e47977b08a18f3b32ecbc7157
|
7
|
+
data.tar.gz: 0bddc6264bfbf56a491d6361fde504eaeff0912b18c6990ba472e29ed211de6fd78a39a50aa16e3fb4d0587dc44cdc8aa00793c3034a9c08a35590dd8fc39ecd
|
@@ -2,56 +2,60 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>BuilderApm Dashboard</title>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
<% if session.enabled? %>
|
6
|
+
<meta name="csrf-token" content="<%= form_authenticity_token%>">
|
7
|
+
<% end %>
|
8
|
+
<%= render 'builder_apm/css/main' %>
|
9
|
+
<%= render 'builder_apm/css/dark' %>
|
10
|
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
11
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.js"></script>
|
12
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.css"/>
|
13
|
+
<%= render 'builder_apm/js/data_fetcher' %>
|
14
|
+
<script>
|
15
|
+
$(document).ready(function () { // Check for saved 'darkMode' in localStorage
|
16
|
+
if (localStorage.getItem('darkMode') === 'true') {
|
17
|
+
$('body').addClass('dark');
|
18
|
+
}
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
$('#clearData').on('click', function () {
|
21
|
+
localStorage.removeItem('builder_apm_requests');
|
22
|
+
localStorage.removeItem('builder_apm_cursor');
|
23
|
+
alert('Local Data Cleared');
|
24
|
+
});
|
25
|
+
$('#darkModeToggle').on('click', function () {
|
26
|
+
$('body').toggleClass('dark');
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
});
|
33
|
-
$('body').show();
|
28
|
+
// Save the current mode in localStorage
|
29
|
+
if ($('body').hasClass('dark')) {
|
30
|
+
localStorage.setItem('darkMode', 'true');
|
31
|
+
} else {
|
32
|
+
localStorage.setItem('darkMode', 'false');
|
33
|
+
}
|
34
34
|
});
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
35
|
+
$('body').show();
|
36
|
+
});
|
37
|
+
</script>
|
38
|
+
</head>
|
39
|
+
<body>
|
40
|
+
<h1 id="header">BuilderApm Dashboard<span class="version">
|
41
|
+
(<%= BuilderApm::VERSION %>)</span>
|
42
|
+
</h1>
|
43
|
+
<nav id="navbar">
|
44
|
+
<ul>
|
45
|
+
<li><%= link_to 'Dashboard', dashboard_path, class: ("active" if current_page?(dashboard_path)) %></li>
|
46
|
+
<li><%= link_to 'Request Analysis', request_analysis_path, class: ("active" if current_page?(request_analysis_path)) %></li>
|
47
|
+
<li><%= link_to '500 Errors', errors_500_path, class: ("active" if current_page?(errors_500_path)) %></li>
|
48
|
+
<li><%= link_to 'Recent Requests', recent_requests_path, class: ("active" if current_page?(recent_requests_path)) %></li>
|
49
|
+
<li><%= link_to 'Slow Requests', slow_requests_path, class: ("active" if current_page?(slow_requests_path)) %></li>
|
50
|
+
<li><%= link_to 'N+1', n_plus_one_path, class: ("active" if current_page?(n_plus_one_path)) %></li>
|
51
|
+
<li id="dark-mode-toggle">
|
52
|
+
<button id="darkModeToggle" class="nav-button">Toggle Dark Mode</button>
|
53
|
+
</li>
|
54
|
+
</ul>
|
55
|
+
</nav>
|
56
|
+
<div id="options">
|
57
|
+
<input type="checkbox" id="autoUpdate" name="autoUpdate">
|
58
|
+
<label for="autoUpdate">Load Older data</label>
|
59
|
+
</div>
|
60
|
+
</body>
|
61
|
+
</html>
|
@@ -58,11 +58,8 @@ module BuilderApm
|
|
58
58
|
begin
|
59
59
|
JSON.parse(response.body)["choices"].first["message"]["content"]
|
60
60
|
rescue => e
|
61
|
-
|
62
|
-
|
63
|
-
output += "\n\nThis file is too large and should be looked at breaking it down into smaller files / services" if error["code"] == "context_length_exceeded"
|
64
|
-
|
65
|
-
output
|
61
|
+
puts e.message
|
62
|
+
response.body
|
66
63
|
end
|
67
64
|
end
|
68
65
|
|
data/lib/builder_apm/engine.rb
CHANGED
@@ -3,9 +3,8 @@ module BuilderApm
|
|
3
3
|
isolate_namespace BuilderApm
|
4
4
|
|
5
5
|
initializer 'builder_apm.start' do |app|
|
6
|
-
BuilderApm::Controllers::Instrumenter.new.start
|
6
|
+
BuilderApm::Controllers::Instrumenter.new.start
|
7
7
|
BuilderApm::Models::Instrumenter.start if BuilderApm.configuration.enable_active_record_profiler
|
8
|
-
BuilderApm::Methods::Instrumenter.new.start if BuilderApm.configuration.enable_methods_profiler
|
9
8
|
end
|
10
9
|
|
11
10
|
config.after_initialize do
|
@@ -10,6 +10,7 @@ module BuilderApm
|
|
10
10
|
def start
|
11
11
|
@trace = setup_trace
|
12
12
|
@trace.enable
|
13
|
+
self
|
13
14
|
end
|
14
15
|
|
15
16
|
def stop
|
@@ -32,7 +33,7 @@ module BuilderApm
|
|
32
33
|
return false unless Thread.current[:request_id]
|
33
34
|
|
34
35
|
start_controller = Thread.current[:stack]&.first
|
35
|
-
start_controller && "#{tp.defined_class}##{tp.method_id}"
|
36
|
+
start_controller && "#{tp.defined_class}##{tp.method_id}" != start_controller[:method]
|
36
37
|
|
37
38
|
# gems_to_track = BuilderApm.configuration.gems_to_track
|
38
39
|
# gems_to_track.any? { |gem| tp.path.include?(File::SEPARATOR + gem) }
|
@@ -15,11 +15,12 @@ module BuilderApm
|
|
15
15
|
Thread.current[:db_runtime] = 0
|
16
16
|
Thread.current[:method_tracing] = 0
|
17
17
|
Thread.current[:db_tracing] = 0
|
18
|
-
|
18
|
+
@trace = BuilderApm::Methods::Instrumenter.new.start if BuilderApm.configuration.enable_methods_profiler
|
19
|
+
|
19
20
|
@status, @headers, @response = @app.call(env)
|
20
21
|
|
21
22
|
ensure
|
22
|
-
|
23
|
+
@trace.stop if BuilderApm.configuration.enable_methods_profiler
|
23
24
|
end_time = Time.now.to_f * 1000
|
24
25
|
handle_timing(start_time, end_time, request_id)
|
25
26
|
|
data/lib/builder_apm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: builder_apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Ketelle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|