vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r16413: Added some debug warnings to investigate...

Committer: vsukhanov
Added some debug warnings to investigate time of getting friends page data.
U   trunk/cgi-bin/LJ/S2/FriendsPage.pm
Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/FriendsPage.pm	2010-03-22 04:24:44 UTC (rev 16412)
+++ trunk/cgi-bin/LJ/S2/FriendsPage.pm	2010-03-22 08:59:32 UTC (rev 16413)
@@ -127,6 +127,9 @@
         $p->{'friends_mode'} = "friendsfriends";
     }
 
+    use Time::HiRes qw//;
+    my $t0 = [Time::HiRes::gettimeofday];
+
     ## load the itemids
     my %friends;
     my %friends_row;
@@ -148,6 +151,8 @@
         'events_date'       => $events_date,
     });
 
+    warn "[FriendsPage=$user] Items loaded. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec";
+
     while ($_ = each %friends) {
         # we expect fgcolor/bgcolor to be in here later
         $friends{$_}->{'fgcolor'} = $friends_row{$_}->{'fgcolor'} || '#ffffff';
@@ -160,12 +165,18 @@
     my %logprops = ();  # key is "$owneridOrZero $[j]itemid"
     LJ::load_log_props2multi(\%idsbycluster, \%logprops);
 
+    warn "[FriendsPage=$user] items props loaded. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec";
+
     # load the text of the entries
     my $logtext = LJ::get_logtext2multi(\%idsbycluster);
 
+    warn "[FriendsPage=$user] items logtext2multi loaded. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec";
+
     # load tags on these entries
     my $logtags = LJ::Tags::get_logtagsmulti(\%idsbycluster);
 
+    warn "[FriendsPage=$user] LJ::Tags::get_logtagsmulti loaded. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec";
+
     my %posters;
     {
         my @posterids;
@@ -345,6 +356,8 @@
         LJ::run_hook('notify_event_displayed', $eobj);
     } # end while
 
+    warn "[FriendsPage=$user] items prepared. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec";
+
     # set the new_day and end_day members.
     if ($eventnum) {
         for (my $i = 0; $i < $eventnum; $i++) {
@@ -367,6 +380,8 @@
     my %userpics;
     LJ::load_userpics(\%userpics, \@userpic_load);
 
+    warn "[FriendsPage=$user] userpics loaded. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec";
+
     foreach my $picid (keys %userpics) {
         my $up = Image("$LJ::USERPIC_ROOT/$picid/$userpics{$picid}->{'userid'}",
                        $userpics{$picid}->{'width'},
@@ -429,6 +444,9 @@
     if ($get->{'mode'} eq "framed") {
         $p->{'head_content'} .= "<base target='_top' />";
     }
+    
+    warn "[FriendsPage=$user] page prepared. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec";
+
     return $p;
 }
 

Tags: livejournal, pm, vadvs
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments