rename long-running pages > PROFILE s
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 26 Jun 2010 22:20:03 +0000 (00:20 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 26 Jun 2010 22:20:03 +0000 (00:20 +0200)
lib/MojoFacets/Plugin/NYTProf.pm

index 7604a19..7cf729a 100644 (file)
@@ -28,7 +28,9 @@ sub register {
                        my $duration = Time::HiRes::gettimeofday() - $id;
                        if ( $duration > $p ) {
                                my $path = "/tmp/nytprof.$id";
-                               warn "profile $path $duration ", -s $path, " bytes\n";
+                               my $new  = "/tmp/MojoFacets.profile-$id-$duration";
+                               rename $path, $new;
+                               warn "profile $new $duration ", -s $new, " bytes\n";
                        } else {
                                warn "profile $path $duration < $p unlink\n";
                                unlink $path;