builder_apm 0.4.1 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/builder_apm/diagnose_request_controller.rb +79 -0
- data/app/controllers/builder_apm/request_details_controller.rb +3 -2
- data/app/views/builder_apm/css/_dark.html.erb +161 -118
- data/app/views/builder_apm/css/_main.html.erb +342 -272
- data/app/views/builder_apm/js/_data_fetcher.html.erb +229 -236
- data/app/views/builder_apm/js/_request_details.html.erb +368 -164
- data/builder_apm.gemspec +1 -1
- data/config/routes.rb +3 -0
- data/lib/builder_apm/configuration.rb +6 -0
- data/lib/builder_apm/doctor/ai_doctor.rb +170 -0
- data/lib/builder_apm/doctor/backtrace_reducer.rb +104 -0
- data/lib/builder_apm/doctor/bravo_chat_ai.rb +85 -0
- data/lib/builder_apm/doctor/openai_chat_gpt.rb +84 -0
- data/lib/builder_apm/methods/instrumenter.rb +33 -6
- data/lib/builder_apm/middleware/timing.rb +6 -0
- data/lib/builder_apm/models/instrumenter.rb +15 -3
- data/lib/builder_apm/version.rb +1 -1
- data/lib/generators/builder_apm/install_generator.rb +2 -2
- data/lib/generators/builder_apm/templates/builder_apm_config.rb +7 -4
- metadata +8 -4
- data/README.md +0 -29
@@ -1,273 +1,343 @@
|
|
1
1
|
<style>
|
2
|
-
body {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
.version {
|
15
|
-
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
#navbar li a,
|
55
|
-
#navbar .nav-button {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
}
|
67
|
-
td.long_text{
|
68
|
-
|
69
|
-
|
70
|
-
}
|
71
|
-
th.sortable {
|
72
|
-
|
73
|
-
}
|
74
|
-
#navbar #dark-mode-toggle {
|
75
|
-
|
76
|
-
}
|
77
|
-
|
78
|
-
#navbar li a:hover,
|
79
|
-
#navbar .nav-button:hover {
|
80
|
-
|
81
|
-
|
82
|
-
}
|
83
|
-
|
84
|
-
#navbar li a.active,
|
85
|
-
#navbar .nav-button.active {
|
86
|
-
|
87
|
-
|
88
|
-
}
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
#details_div .
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
#details_div .
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
#details_div .
|
189
|
-
#details_div .
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
}
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
2
|
+
body {
|
3
|
+
font-family: Arial, sans-serif;
|
4
|
+
display: none;
|
5
|
+
}
|
6
|
+
|
7
|
+
#header {
|
8
|
+
background-color: #4CAF50;
|
9
|
+
color: white;
|
10
|
+
text-align: center;
|
11
|
+
padding: 10px;
|
12
|
+
margin-bottom: 20px;
|
13
|
+
}
|
14
|
+
.version {
|
15
|
+
font-size: 14px;
|
16
|
+
}
|
17
|
+
#navbar {
|
18
|
+
background-color: #333;
|
19
|
+
overflow: hidden;
|
20
|
+
list-style-type: none;
|
21
|
+
margin: 0;
|
22
|
+
padding: 0;
|
23
|
+
}
|
24
|
+
|
25
|
+
#navbar ul {
|
26
|
+
margin: 0;
|
27
|
+
padding: 0;
|
28
|
+
overflow: hidden;
|
29
|
+
background-color: #333;
|
30
|
+
}
|
31
|
+
|
32
|
+
#navbar li {
|
33
|
+
float: left;
|
34
|
+
display: block;
|
35
|
+
}
|
36
|
+
|
37
|
+
#navbar li a {
|
38
|
+
display: block;
|
39
|
+
color: #f2f2f2;
|
40
|
+
text-align: center;
|
41
|
+
padding: 14px 16px;
|
42
|
+
text-decoration: none;
|
43
|
+
}
|
44
|
+
|
45
|
+
#navbar li a:hover {
|
46
|
+
background-color: #ddd;
|
47
|
+
color: black;
|
48
|
+
}
|
49
|
+
|
50
|
+
#navbar li a.active {
|
51
|
+
background-color: #4CAF50;
|
52
|
+
color: white;
|
53
|
+
}
|
54
|
+
#navbar li a,
|
55
|
+
#navbar .nav-button {
|
56
|
+
display: block;
|
57
|
+
color: #f2f2f2;
|
58
|
+
text-align: center;
|
59
|
+
padding: 14px 16px;
|
60
|
+
text-decoration: none;
|
61
|
+
background-color: #333;
|
62
|
+
border: none; /* Removes the default button border */
|
63
|
+
cursor: pointer; /* Makes the button cursor appear as a hand */
|
64
|
+
font-size: 1em; /* Adjust to match your anchors */
|
65
|
+
transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
|
66
|
+
}
|
67
|
+
td.long_text {
|
68
|
+
max-width: 400px;
|
69
|
+
overflow-wrap: break-word;
|
70
|
+
}
|
71
|
+
th.sortable {
|
72
|
+
cursor: pointer; /* Makes the button cursor appear as a hand */
|
73
|
+
}
|
74
|
+
#navbar #dark-mode-toggle {
|
75
|
+
float: right;
|
76
|
+
}
|
77
|
+
|
78
|
+
#navbar li a:hover,
|
79
|
+
#navbar .nav-button:hover {
|
80
|
+
background-color: #ddd;
|
81
|
+
color: black;
|
82
|
+
}
|
83
|
+
|
84
|
+
#navbar li a.active,
|
85
|
+
#navbar .nav-button.active {
|
86
|
+
background-color: #4CAF50;
|
87
|
+
color: white;
|
88
|
+
}
|
89
|
+
|
90
|
+
table {
|
91
|
+
border-collapse: collapse;
|
92
|
+
width: 100%;
|
93
|
+
margin-top: 20px;
|
94
|
+
}
|
95
|
+
th,
|
96
|
+
td {
|
97
|
+
border: 1px solid #ddd;
|
98
|
+
padding: 8px;
|
99
|
+
text-align: left;
|
100
|
+
}
|
101
|
+
tr:nth-child(even) {
|
102
|
+
background-color: #f2f2f2;
|
103
|
+
}
|
104
|
+
th {
|
105
|
+
background-color: #4CAF50;
|
106
|
+
color: white;
|
107
|
+
padding-top: 12px;
|
108
|
+
padding-bottom: 12px;
|
109
|
+
}
|
110
|
+
|
111
|
+
#gannt_div {
|
112
|
+
overflow: display;
|
113
|
+
height: 2000px;
|
114
|
+
width: 100%;
|
115
|
+
}
|
116
|
+
#details_div .bounding-box {
|
117
|
+
border: 1px solid #333;
|
118
|
+
margin: 2px -1px 3px 0;
|
119
|
+
padding: 10px 0 10px 10px;
|
120
|
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
|
121
|
+
border-radius: 5px;
|
122
|
+
}
|
123
|
+
|
124
|
+
#details_div div.has-children {
|
125
|
+
cursor: pointer;
|
126
|
+
color: #444;
|
127
|
+
font-weight: bold;
|
128
|
+
}
|
129
|
+
|
130
|
+
#details_div span {
|
131
|
+
display: inline-block;
|
132
|
+
}
|
133
|
+
|
134
|
+
#details_div div {
|
135
|
+
padding: 5px 0 5px 5px;
|
136
|
+
font-size: 14px;
|
137
|
+
line-height: 1.5;
|
138
|
+
color: #333;
|
139
|
+
background-color: #f9f9f9;
|
140
|
+
}
|
141
|
+
|
142
|
+
#details_div .sql-event {
|
143
|
+
background-color: #e1f5fe;
|
144
|
+
color: #01579b;
|
145
|
+
}
|
146
|
+
|
147
|
+
#details_div .children {
|
148
|
+
display: none;
|
149
|
+
margin-top: 10px;
|
150
|
+
border-left: 1px solid #ccc;
|
151
|
+
padding-left: 10px;
|
152
|
+
}
|
153
|
+
|
154
|
+
#details_div .has_children {
|
155
|
+
border: 1px solid #aaa;
|
156
|
+
width: 20px;
|
157
|
+
height: 20px;
|
158
|
+
text-align: center;
|
159
|
+
margin-right: 10px;
|
160
|
+
}
|
161
|
+
|
162
|
+
#details_div .date {
|
163
|
+
color: #607d8b;
|
164
|
+
margin-right: 10px;
|
165
|
+
width: 135px;
|
166
|
+
text-align: right;
|
167
|
+
}
|
168
|
+
|
169
|
+
#details_div .duration {
|
170
|
+
color: #009688;
|
171
|
+
margin-right: 10px;
|
172
|
+
width: 120px;
|
173
|
+
}
|
174
|
+
|
175
|
+
#details_div .description,
|
176
|
+
#details_div .sql {
|
177
|
+
color: #3f51b5;
|
178
|
+
margin-right: 10px;
|
179
|
+
}
|
180
|
+
|
181
|
+
#details_div .method_line,
|
182
|
+
#details_div .trigger_line {
|
183
|
+
color: #8d6e63;
|
184
|
+
margin-right: 10px;
|
185
|
+
width: 100%;
|
186
|
+
}
|
187
|
+
|
188
|
+
#details_div .cached,
|
189
|
+
#details_div .record_count,
|
190
|
+
#details_div .params {
|
191
|
+
color: #3f51b5;
|
192
|
+
margin-right: 10px;
|
193
|
+
width: 100px;
|
194
|
+
}
|
195
|
+
|
196
|
+
#details_div .minor_call {
|
197
|
+
display: none;
|
198
|
+
background: #e5efe5;
|
199
|
+
}
|
200
|
+
|
201
|
+
#details_div .params {
|
202
|
+
width: auto;
|
203
|
+
}
|
204
|
+
#details_div .error_status {
|
205
|
+
border: 1px solid red;
|
206
|
+
padding: 10px;
|
207
|
+
margin-bottom: 10px;
|
208
|
+
background-color: rgb(255, 238, 238);
|
209
|
+
}
|
210
|
+
|
211
|
+
.duration-circle {
|
212
|
+
display: inline-block;
|
213
|
+
width: 10px;
|
214
|
+
height: 10px;
|
215
|
+
border-radius: 50%;
|
216
|
+
border: 1px solid #333;
|
217
|
+
margin-right: 5px;
|
218
|
+
}
|
219
|
+
|
220
|
+
.green-circle {
|
221
|
+
background-color: #0f0;
|
222
|
+
border-color: #0c0;
|
223
|
+
}
|
224
|
+
|
225
|
+
.amber-circle {
|
226
|
+
background-color: #ff0;
|
227
|
+
border-color: #cc0;
|
228
|
+
}
|
229
|
+
|
230
|
+
.red-circle {
|
231
|
+
background-color: #f00;
|
232
|
+
border-color: #c00;
|
233
|
+
}
|
234
|
+
|
235
|
+
.image-container {
|
236
|
+
position: absolute;
|
237
|
+
width: 600px; /* Change to the width of your image */
|
238
|
+
height: 600px; /* Change to the height of your image */
|
239
|
+
overflow: hidden;
|
240
|
+
left: 50%;
|
241
|
+
margin-left: -300px;
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
.image-container::before {
|
246
|
+
content: '';
|
247
|
+
position: absolute;
|
248
|
+
top: 0;
|
249
|
+
right: 0;
|
250
|
+
bottom: 0;
|
251
|
+
left: 0;
|
252
|
+
background: radial-gradient(ellipse at center, rgba(255,255,255,0) 57%, rgba(255,255,255,1) 71%);
|
253
|
+
}
|
254
|
+
|
255
|
+
.image-container img {
|
256
|
+
width: 100%;
|
257
|
+
height: 100%;
|
258
|
+
}
|
259
|
+
|
260
|
+
#error_table td p {
|
261
|
+
font-size: 10px;
|
262
|
+
margin: 2px;
|
263
|
+
}
|
264
|
+
|
265
|
+
@keyframes blink {
|
266
|
+
0% {
|
267
|
+
opacity: 1;
|
268
|
+
}
|
269
|
+
50% {
|
270
|
+
opacity: 0;
|
271
|
+
}
|
272
|
+
100% {
|
273
|
+
opacity: 1;
|
274
|
+
}
|
275
|
+
}
|
276
|
+
|
277
|
+
pre {
|
278
|
+
outline: 1px solid;
|
279
|
+
padding: 10px;
|
280
|
+
background: rgba(0, 0, 0, 0.1);
|
281
|
+
white-space: pre-wrap;
|
282
|
+
}
|
283
|
+
|
284
|
+
#details_div .n_plus_one {
|
285
|
+
color: #ff6347;
|
286
|
+
}
|
287
|
+
#details_div .request-summary,
|
288
|
+
#details_div .diagnosis-section {
|
289
|
+
background-color: #f7f7f7;
|
290
|
+
border: 1px solid #e0e0e0;
|
291
|
+
padding: 10px;
|
292
|
+
margin-bottom: 20px;
|
293
|
+
border-radius: 5px;
|
294
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
295
|
+
}
|
296
|
+
#details_div .status-message {
|
297
|
+
margin-top: 20px;
|
298
|
+
}
|
299
|
+
#details_div .highlight-results {
|
300
|
+
background-color: #e6e6e6; /* A subtle light gray, opposite of the dark theme's background. */
|
301
|
+
border: 1px solid #aaaaaa; /* A slightly darker border for contrast. */
|
302
|
+
border-radius: 4px; /* Maintaining consistency with other styles. */
|
303
|
+
padding: 2px 4px; /* Consistent padding. */
|
304
|
+
cursor: help; /* Show a hint that there's a tooltip. */
|
305
|
+
color: #333333; /* Dark text for better visibility against the light background. */
|
306
|
+
}
|
307
|
+
|
308
|
+
#details_div .request-summary span {
|
309
|
+
display: inline-block;
|
310
|
+
margin-bottom: 8px;
|
311
|
+
font-size: 14px;
|
312
|
+
color: #333;
|
313
|
+
width: 50%;
|
314
|
+
margin-right: 0;
|
315
|
+
}
|
316
|
+
|
317
|
+
#details_div .ai-doctor-button,
|
318
|
+
#details_div .deeper-analysis-button {
|
319
|
+
background-color: #3498db;
|
320
|
+
color: #fff;
|
321
|
+
padding: 8px 16px;
|
322
|
+
border: none;
|
323
|
+
border-radius: 4px;
|
324
|
+
cursor: pointer;
|
325
|
+
transition: background-color 0.3s ease;
|
326
|
+
font-size: 14px;
|
327
|
+
display: flex;
|
328
|
+
align-items: center;
|
329
|
+
}
|
330
|
+
|
331
|
+
#details_div .ai-doctor-button:hover,
|
332
|
+
#details_div .deeper-analysis-button:hover {
|
333
|
+
background-color: #2980b9;
|
334
|
+
}
|
335
|
+
|
336
|
+
#details_div .ai-doctor-button.disabled,
|
337
|
+
#details_div .ai-doctor-button.disabled:hover,
|
338
|
+
#details_div .deeper-analysis-button.disabled,
|
339
|
+
#details_div .deeper-analysis-button.disabled:hover {
|
340
|
+
background-color: #aaa;
|
341
|
+
cursor: not-allowed;
|
342
|
+
}
|
343
|
+
</style>
|