Skip to content

Commit 2ea3553

Browse files
committed
rm width_ratio_relative
seems more plausible to me
1 parent 4a5258f commit 2ea3553

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

debug_toolbar/panels/sql/panel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,8 @@ def duplicate_key(query):
215215
query["rgb_color"] = self._databases[alias]["rgb_color"]
216216
try:
217217
query["width_ratio"] = (query["duration"] / self._sql_time) * 100
218-
query["width_ratio_relative"] = (
219-
100.0 * query["width_ratio"] / (100.0 - width_ratio_tally)
220-
)
221218
except ZeroDivisionError:
222219
query["width_ratio"] = 0
223-
query["width_ratio_relative"] = 0
224220
query["start_offset"] = width_ratio_tally
225221
query["end_offset"] = query["width_ratio"] + query["start_offset"]
226222
width_ratio_tally += query["width_ratio"]

debug_toolbar/templates/debug_toolbar/panels/sql.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</td>
5959
<td class="djdt-timeline">
6060
<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 }}%">
61-
<rect x="{{ query.start_offset|unlocalize }}" y="0" height="5" width="{{ query.width_ratio_relative|unlocalize }}" fill="{{ query.trace_color }}" />
61+
<rect x="{{ query.start_offset|unlocalize }}" y="0" height="5" width="{{ query.width_ratio|unlocalize }}" fill="{{ query.trace_color }}" />
6262
{% if query.starts_trans %}
6363
<line x1="{{ query.start_offset|unlocalize }}" y1="0" x2="{{ query.start_offset|unlocalize }}" y2="5" />
6464
{% endif %}

0 commit comments

Comments
 (0)