From c521ede323a948ab48c18a9c42a28b730ae51030 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 27 May 2010 18:19:05 +0200 Subject: [PATCH] display storable size This allows us to identify which dumps are available and how much memory will they use when loaded (or even compare file size between source file format and our storable serialization) --- lib/MojoFacets/Data.pm | 4 ++++ public/mojo_facets.css | 6 ++++++ templates/data/index.html.ep | 7 +++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index 6286671..78a6da0 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -37,11 +37,15 @@ sub index { my $size; $size->{$_} = -s "$path/$_" foreach @files; + my $dump_path; + $dump_path->{$_} = $self->_dump_path( $_ ) foreach @files; + $self->render( files => [ @files ], size => $size, loaded => $loaded, filters => $filters, + dump_path => $dump_path, ); } diff --git a/public/mojo_facets.css b/public/mojo_facets.css index 80c8c76..13402f0 100644 --- a/public/mojo_facets.css +++ b/public/mojo_facets.css @@ -150,3 +150,9 @@ span.d { form.action_filter { float: right; } + +.bytes { + text-align: right; + font-family: monospace; + color: #444; +} diff --git a/templates/data/index.html.ep b/templates/data/index.html.ep index d0272b4..bc7216e 100644 --- a/templates/data/index.html.ep +++ b/templates/data/index.html.ep @@ -6,14 +6,16 @@ - + + % foreach my $n ( @$files ) {
namebytesitemsmcolumns
namesizeitemsmcolumns
diskstorable
-<%= $size->{$n} %> +<%= $size->{$n} %> +<%= -s $dump_path->{$n} %> <%= defined $loaded->{$n}->{data} ? $#{ $loaded->{$n}->{data}->{items} } + 1 : '' %> {$n}->{stats} ? 'checked' : '' %>> @@ -33,3 +35,4 @@
<%= dumper $loaded %>
<%= dumper $filters %>
+
<%= dumper $dump_path %>
-- 2.20.1