/debug/loaded/stats dumping
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 8 Jul 2010 18:00:43 +0000 (20:00 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 8 Jul 2010 18:00:43 +0000 (20:00 +0200)
This is useful to get one more level of introspection into data
strcutures in memory

lib/MojoFacets/Debug.pm
templates/debug/loaded.html.ep [new file with mode: 0644]

index 4a888fe..b5e0471 100644 (file)
@@ -24,4 +24,17 @@ sub _ref_size {
        tell($fh);
 }
 
+sub loaded {
+       my $self = shift;
+
+       my $path = $self->session('path');
+       my $key  = $self->param('id');
+
+       my $loaded = $MojoFacets::Data::loaded->{$path}->{$key} || die "no $path $key in loaded";
+
+       $self->render(
+               loaded => $loaded,
+       );
+}
+
 1
diff --git a/templates/debug/loaded.html.ep b/templates/debug/loaded.html.ep
new file mode 100644 (file)
index 0000000..67f9cc5
--- /dev/null
@@ -0,0 +1,3 @@
+% layout 'default';
+
+<pre class=debug><%= dumper $loaded %></pre>