vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[ljcom] r10510: LJSUP-8793: log incoming to Apache reque...

Committer: vsukhanov
LJSUP-8793: log incoming to Apache request's start and stop to file
U   trunk/cgi-bin/LJ/Hooks/SUP.pm
Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm	2011-05-14 06:29:47 UTC (rev 10509)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm	2011-05-16 03:40:57 UTC (rev 10510)
@@ -1020,12 +1020,13 @@
     return unless LJ::is_enabled("log_requests_start_stop");
 
     my $rec = LJ::Request->header_in("Host") . LJ::Request->uri . "?" . LJ::Request->args;
+    my (undef, $swap, $it) = split /\s+/ => `cat /proc/meminfo|grep SwapFree`;
 
     ## write from all process to the same file may cause data corruption,
     ## but it is not critical here.
     local *FILE;
     open FILE, ">>", $LJ::REQUESTS_LOG_FILE or warn "Can't open $LJ::REQUESTS_LOG_FILE: $!";
-    print FILE "S $$ " . time() . " " . $rec . "\n";
+    print FILE "S $$ " . time() . " " . $rec . " $swap $it\n";
     close FILE;
 
  });
@@ -1033,12 +1034,13 @@
     return unless LJ::is_enabled("log_requests_start_stop");
 
     my $rec = LJ::Request->header_in("Host") . LJ::Request->uri . "?" . LJ::Request->args;
+    my (undef, $swap, $it) = split /\s+/ => `cat /proc/meminfo|grep SwapFree`;
 
     ## write from all process to the same file may cause data corruption,
     ## but it is not critical here.
     local *FILE;
     open FILE, ">>", $LJ::REQUESTS_LOG_FILE or warn "Can't open $LJ::REQUESTS_LOG_FILE: $!";
-    print FILE "E $$ " . time() . " " . $rec . "\n";
+    print FILE "E $$ " . time() . " " . $rec . " $swap $it\n";
     close FILE;
 
  });

Tags: ljcom, 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