[Cpan-forum-commit] rev 228 - in trunk: . bin

svn at pti.co.il svn at pti.co.il
Sun Sep 17 21:46:01 IDT 2006


Author: gabor
Date: 2006-09-17 14:45:56 -0400 (Sun, 17 Sep 2006)
New Revision: 228

Added:
   trunk/bin/profile.pl
Modified:
   trunk/
Log:
add profiler



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:11163
   + 8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:11336

Added: trunk/bin/profile.pl
===================================================================
--- trunk/bin/profile.pl	2006-09-08 11:00:07 UTC (rev 227)
+++ trunk/bin/profile.pl	2006-09-17 18:45:56 UTC (rev 228)
@@ -0,0 +1,42 @@
+#!/usr/bin/perl -d:DProf;
+use strict;
+use warnings;
+
+# perl bin/profile.pl --url threads/1130      big
+# perl bin/profile.pl --url threads/2840  small
+
+use Getopt::Long;
+my $url;
+my $verbose;
+GetOptions(
+        "urls=s" => \$url, 
+        "verbose" => \$verbose,
+) or usage();
+usage() if not $url;
+
+use lib 'lib', 't/lib';
+use CPAN::Forum::Test;
+use File::Copy qw(copy);
+
+copy 't/forum.db', 'blib/db/forum.db';
+
+
+my $mech     = CPAN::Forum::Test::get_mech();
+my $base_url = CPAN::Forum::Test::get_url();
+CPAN::Forum::Test::init_db();
+
+$mech->get("$base_url/$url");
+if ($verbose) {
+    print $mech->content;
+}
+
+sub usage {
+    print <<"END_USAGE";
+Usage: $0
+        --url   URL    (e.g. therads/1130)
+        --verbose
+END_USAGE
+
+    exit;
+}
+



More information about the Cpan-forum-commit mailing list