This repository was archived by the owner on Mar 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11from debug_toolbar .panels import Panel
22from debug_toolbar_sqlalchemy .operation_tracker import OperationTracker
3+
34from django .utils .translation import ugettext as _
45from django .template .loader import render_to_string
56
7+
68class SqlAlchemyDebugPanel (Panel ):
79 """ Panel that shows information about SQLAlchemy operations. """
810 name = 'SQLAlchemy'
@@ -20,7 +22,11 @@ def nav_title(self):
2022 def nav_subtitle (self ):
2123 if self .tracker :
2224 count = len (self .tracker .queries )
23- return "%d %s" % (count , "query" if count == 1 else "queries" )
25+ return "%d %s in %.2fms" % (
26+ count ,
27+ "query" if count == 1 else "queries" ,
28+ sum (map (lambda query : query .duration , self .tracker .queries )),
29+ )
2430
2531 return "Unavailable"
2632
@@ -36,4 +42,3 @@ def content(self):
3642 self .template ,
3743 {'queries' : self .tracker .queries }
3844 )
39-
Original file line number Diff line number Diff line change 2222 </ div >
2323 </ td >
2424 < td class ="time ">
25- {{ query.duration|floatformat:"0" }}
25+ {{ query.duration|floatformat:2 }}
2626 </ td >
2727 </ tr >
2828 {% endfor %}
You can’t perform that action at this time.
0 commit comments