aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels
diff options
context:
space:
mode:
authorTomasz Buchert2011-06-09 10:52:38 +0200
committerTomasz Buchert2011-06-09 10:52:38 +0200
commit9d32eb2c36f353565ee5738cd92805c1ea11d742 (patch)
tree8f9bf6eee9e0b7f0a6200f97d92cd04bc858c6b4 /debug_toolbar/panels
parenta27471c79a5b9552b76fc1d9fb1c5499ad5b1478 (diff)
downloaddjango-debug-toolbar-9d32eb2c36f353565ee5738cd92805c1ea11d742.tar.bz2
Timeline width in SQL panel properly scaled.
Diffstat (limited to 'debug_toolbar/panels')
-rw-r--r--debug_toolbar/panels/sql.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py
index c6b5996..bce769a 100644
--- a/debug_toolbar/panels/sql.py
+++ b/debug_toolbar/panels/sql.py
@@ -183,8 +183,10 @@ class SQLDebugPanel(DebugPanel):
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']