[Jifty-commit] r639 - jifty/trunk/lib/Jifty/Mason
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Mar 1 02:58:34 EST 2006
Author: jesse
Date: Wed Mar 1 02:58:33 2006
New Revision: 639
Modified:
/ (props changed)
jifty/trunk/lib/Jifty/Mason/Halo.pm
jifty/trunk/share/web/static/css/halos.css
Log:
r24814 at truegrounds: jesse | 2006-03-01 02:58:29 -0500
* Halos now show SQL statements executed in each component
Modified: jifty/trunk/lib/Jifty/Mason/Halo.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Mason/Halo.pm (original)
+++ jifty/trunk/lib/Jifty/Mason/Halo.pm Wed Mar 1 02:58:33 2006
@@ -3,7 +3,7 @@
package Jifty::Mason::Halo;
use base qw/HTML::Mason::Plugin/;
use Time::HiRes ();
-
+Jifty->handle->log_sql_statements(1);
=head1 NAME
@@ -36,8 +36,10 @@
my $halo_base = Jifty->web->serial;
$context->request->notes('_halo_depth' => ++$DEPTH);
-
-
+ if ($STACK->[-1]) {
+ push @{$STACK->[-1]->{sql_statements}}, Jifty->handle->sql_statement_log;
+ Jifty->handle->clear_sql_statement_log;
+ }
push @$STACK,
{
@@ -79,6 +81,12 @@
my $frame = $STACK->[$FRAME_ID];
$frame->{'render_time'} = int((Time::HiRes::time - $frame->{'start_time'}) * 1000)/1000;
+
+
+ push @{$frame->{sql_statements}}, Jifty->handle->sql_statement_log;
+ Jifty->handle->clear_sql_statement_log;
+
+
$context->request->notes('_halo_depth' => $DEPTH-1 );
# If
@@ -119,8 +127,9 @@
Jifty->web->mason->out(qq{</dt>
<dt>Variables</dt>
-<dd><pre>@{[YAML::Dump($stack_frame->{'args'})]}</pre></dd>
-
+<dd><textarea rows="5" cols="80">@{[YAML::Dump($stack_frame->{'args'})]}</textarea></dd>
+<dt>SQL Statements</dt>
+<dd><textarea rows="5" cols="80">@{[YAML::Dump($stack_frame->{'sql_statements'})]}</textarea></dd>
</dl>
</div>
})
Modified: jifty/trunk/share/web/static/css/halos.css
==============================================================================
--- jifty/trunk/share/web/static/css/halos.css (original)
+++ jifty/trunk/share/web/static/css/halos.css Wed Mar 1 02:58:33 2006
@@ -31,7 +31,7 @@
div#render_info_tree {
display: none;
position: fixed;
- font-size: 0.5em;
+ background: white;
border: 1px solid yellow;
right: 1em;
bottom: 1em;
More information about the Jifty-commit
mailing list