diff --git a/debug_toolbar/panels/sql/panel.py b/debug_toolbar/panels/sql/panel.py index aaea2e648..5e61b0aee 100644 --- a/debug_toolbar/panels/sql/panel.py +++ b/debug_toolbar/panels/sql/panel.py @@ -215,12 +215,8 @@ def duplicate_key(query): query["rgb_color"] = self._databases[alias]["rgb_color"] try: query["width_ratio"] = (query["duration"] / self._sql_time) * 100 - query["width_ratio_relative"] = ( - 100.0 * query["width_ratio"] / (100.0 - width_ratio_tally) - ) except ZeroDivisionError: query["width_ratio"] = 0 - query["width_ratio_relative"] = 0 query["start_offset"] = width_ratio_tally query["end_offset"] = query["width_ratio"] + query["start_offset"] width_ratio_tally += query["width_ratio"] diff --git a/debug_toolbar/static/debug_toolbar/css/toolbar.css b/debug_toolbar/static/debug_toolbar/css/toolbar.css index e0a0f21ae..ef26b7e69 100644 --- a/debug_toolbar/static/debug_toolbar/css/toolbar.css +++ b/debug_toolbar/static/debug_toolbar/css/toolbar.css @@ -421,39 +421,21 @@ #djDebug .djdt-timeline { width: 30%; } -#djDebug .djDebugTimeline { - position: relative; - height: 100%; - min-height: 100%; -} -#djDebug div.djDebugLineChart { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - vertical-align: middle; -} -#djDebug div.djDebugLineChart strong { - text-indent: -10000em; - display: block; - font-weight: normal; - vertical-align: middle; - background-color: #ccc; -} -#djDebug div.djDebugLineChartWarning strong { - background-color: #900; +#djDebug svg.djDebugLineChart { + width: 100%; + height: 1.5em; } -#djDebug .djDebugInTransaction div.djDebugLineChart strong { - background-color: #d3ff82; +#djDebug svg.djDebugLineChartWarning rect { + fill: #900; } -#djDebug .djDebugStartTransaction div.djDebugLineChart strong { - border-left: 1px solid #94b24d; + +#djDebug svg.djDebugLineChartInTransaction rect { + fill: #d3ff82; } -#djDebug .djDebugEndTransaction div.djDebugLineChart strong { - border-right: 1px solid #94b24d; +#djDebug svg.djDebugLineChart line { + stroke: #94b24d; } #djDebug .djdt-panelContent ul.djdt-stats { diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js b/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js index fe8ee7310..517994115 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js @@ -15,17 +15,17 @@ function addRow(stat, endStat) { if (endStat) { // Render a start through end bar row.innerHTML = '' + stat.replace('Start', '') + '' + - '
 
' + + '' + '' + (performance.timing[stat] - timingOffset) + ' (+' + (performance.timing[endStat] - performance.timing[stat]) + ')'; - row.querySelector('strong').style.width = getCSSWidth(stat, endStat); + row.querySelector('rect').setAttribute('width', getCSSWidth(stat, endStat)); } else { // Render a point in time row.innerHTML = '' + stat + '' + - '
 
' + + '' + '' + (performance.timing[stat] - timingOffset) + ''; - row.querySelector('strong').style.width = '2px'; + row.querySelector('rect').setAttribute('width', 2); } - row.querySelector('.djDebugLineChart').style.left = getLeft(stat) + '%'; + row.querySelector('rect').setAttribute('x', getLeft(stat)); document.querySelector('#djDebugBrowserTimingTableBody').appendChild(row); } diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html index e0072d157..81e88e7b3 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html @@ -34,7 +34,7 @@ {% for query in queries %} - +   + @@ -57,7 +57,15 @@ {% endif %} -
{{ query.width_ratio }}%
+ + + {% if query.starts_trans %} + + {% endif %} + {% if query.ends_trans %} + + {% endif %} + {{ query.duration|floatformat:"2" }} diff --git a/debug_toolbar/templates/debug_toolbar/panels/versions.html b/debug_toolbar/templates/debug_toolbar/panels/versions.html index c6f7ae1f7..d0ade6cfb 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/versions.html +++ b/debug_toolbar/templates/debug_toolbar/panels/versions.html @@ -1,8 +1,8 @@ {% load i18n %} - - + +