Author: tim.bunce
Date: Thu Nov 13 04:27:18 2008
New Revision: 600

Modified:
    trunk/NYTProf.xs
    trunk/bin/nytprofhtml
    trunk/demo/demo-run.pl

Log:
Add summary sentance to index page given overall time and other stats.
Pass-thru existing $ENV{NYTPROF} in demo/demo-run.pl
Return time() instead of 0.0 in gettimeofday_nv() if neither gettimeofday  
nor u2time is available.


Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs    (original)
+++ trunk/NYTProf.xs    Thu Nov 13 04:27:18 2008
@@ -790,7 +790,7 @@
          (*u2time)(aTHX_ &time_of_day);
          return time_of_day[0] + (time_of_day[1] / 1000000.0);
      }
-    return 0.0;
+    return (NV)time();
  #endif
  }


Modified: trunk/bin/nytprofhtml
==============================================================================
--- trunk/bin/nytprofhtml       (original)
+++ trunk/bin/nytprofhtml       Thu Nov 13 04:27:18 2008
@@ -459,6 +459,21 @@
          <div class="body_content"><br />
      };

+    # overall description
+    my @all_fileinfos = $profile->all_fileinfos;
+    my $eval_fileinfos = grep { $_->eval_line } @all_fileinfos;
+    my $summary = sprintf "Profile of %s for %s,",
+        $profile->{attribute}{application},
+        fmt_time($profile->{attribute}{profiler_duration});
+    $summary .= sprintf " executing %d statements",
+         $profile->{attribute}{total_stmts_measured}
+        -$profile->{attribute}{total_stmts_discounted};
+    $summary .= sprintf " in %d source files",
+        @all_fileinfos - $eval_fileinfos;
+    $summary .= sprintf " and %d string evals",
+        $eval_fileinfos if $eval_fileinfos;
+    printf OUT qq{<div class="index_summary">%s.</div>},  
_escape_html($summary);
+
      # generate name-sorted select options for files, if there are many
      if (keys %$stats > 30) {
          print OUT

Modified: trunk/demo/demo-run.pl
==============================================================================
--- trunk/demo/demo-run.pl      (original)
+++ trunk/demo/demo-run.pl      Thu Nov 13 04:27:18 2008
@@ -1,6 +1,8 @@
  #!/bin/env perl -w
  use strict;

+my $NYTPROF = ($ENV{NYTPROF}) ? "$ENV{NYTPROF}:" : "";
+
  my %runs = (
      start_begin => {
          skip => 0,
@@ -20,7 +22,7 @@
  for my $run (keys %runs) {

      next if $runs{$run}{skip};
-    $ENV{NYTPROF}      = $runs{$run}{NYTPROF} || '';
+    $ENV{NYTPROF}      = $NYTPROF . $runs{$run}{NYTPROF} || '';
      $ENV{NYTPROF_HTML} = $runs{$run}{NYTPROF_HTML} || '';

      system("perl -Mblib -MDevel::NYTProf demo/demo-code.pl @ARGV") == 0

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to