Skip to content

Commit 4a5258f

Browse files
committed
fix slow and transactions
1 parent cb71d17 commit 4a5258f

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

debug_toolbar/static/debug_toolbar/css/toolbar.css

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,15 @@
427427
height: 1.5em;
428428
}
429429

430-
#djDebug div.djDebugLineChartWarning strong {
431-
background-color: #900;
430+
#djDebug svg.djDebugLineChartWarning rect {
431+
fill: #900;
432432
}
433433

434-
#djDebug .djDebugInTransaction div.djDebugLineChart strong {
435-
background-color: #d3ff82;
436-
}
437-
#djDebug .djDebugStartTransaction div.djDebugLineChart strong {
438-
border-left: 1px solid #94b24d;
434+
#djDebug svg.djDebugLineChartInTransaction rect {
435+
fill: #d3ff82;
439436
}
440-
#djDebug .djDebugEndTransaction div.djDebugLineChart strong {
441-
border-right: 1px solid #94b24d;
437+
#djDebug svg.djDebugLineChart line {
438+
stroke: #94b24d;
442439
}
443440

444441
#djDebug .djdt-panelContent ul.djdt-stats {

debug_toolbar/templates/debug_toolbar/panels/sql.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</thead>
3535
<tbody>
3636
{% for query in queries %}
37-
<tr class="{% if query.is_slow %} djDebugRowWarning{% endif %}{% if query.starts_trans %} djDebugStartTransaction{% endif %}{% if query.ends_trans %} djDebugEndTransaction{% endif %}{% if query.in_trans %} djDebugInTransaction{% endif %}" id="sqlMain_{{ forloop.counter }}">
37+
<tr class="{% if query.is_slow %} djDebugRowWarning{% endif %}" id="sqlMain_{{ forloop.counter }}">
3838
<td class="djdt-color"><span style="background-color:rgb({{ query.rgb_color|join:', '}})">&#160;</span></td>
3939
<td class="djdt-toggle">
4040
<a class="djToggleSwitch" data-toggle-name="sqlMain" data-toggle-id="{{ forloop.counter }}" data-toggle-open="+" data-toggle-close="-" href="">+</a>
@@ -57,8 +57,14 @@
5757
{% endif %}
5858
</td>
5959
<td class="djdt-timeline">
60-
<svg class="djDebugLineChart" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 5" preserveAspectRatio="none" aria-label="{{ query.width_ratio }}%">
60+
<svg class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}{% if query.in_trans %} djDebugLineChartInTransaction{% endif %}" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 5" preserveAspectRatio="none" aria-label="{{ query.width_ratio }}%">
6161
<rect x="{{ query.start_offset|unlocalize }}" y="0" height="5" width="{{ query.width_ratio_relative|unlocalize }}" fill="{{ query.trace_color }}" />
62+
{% if query.starts_trans %}
63+
<line x1="{{ query.start_offset|unlocalize }}" y1="0" x2="{{ query.start_offset|unlocalize }}" y2="5" />
64+
{% endif %}
65+
{% if query.ends_trans %}
66+
<line x1="{{ query.end_offset|unlocalize }}" y1="0" x2="{{ query.end_offset|unlocalize }}" y2="5" />
67+
{% endif %}
6268
</svg>
6369
</td>
6470
<td class="djdt-time">

0 commit comments

Comments
 (0)