wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r11626: LJSUP-11381: Create counters for monitor...

Committer: wisest-owl
LJSUP-11381: Create counters for monitoring

U   trunk/cgi-bin/LJ/Hooks/SUP.pm
Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm	2012-03-26 08:37:11 UTC (rev 11625)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm	2012-03-26 08:48:42 UTC (rev 11626)
@@ -12,15 +12,16 @@
 my $udp_log;
 
 LJ::register_hook('update_counter', sub {
-    my $args = shift;
+    my $args   = shift;
+    my $value  = $args->{'value'} || 1;
 
     my $counter = $args->{'counter'};
     my @timers = qw/ 1 5 30 60 /;
     foreach my $time (@timers) {
         my $minute_number = int (time / (60 * $time));
         my $stat_memkey = "stat:$counter:$minute_number";
-        unless (LJ::MemCache::incr($stat_memkey)) {
-            LJ::MemCache::add($stat_memkey, 1, 3600);
+        unless (LJ::MemCache::incr($stat_memkey, $value)) {
+            LJ::MemCache::add($stat_memkey, $value, 3600);
         }
     }
 
@@ -367,6 +368,11 @@
     LJ::run_hook ("update_counter", {
         counter => "request_duration_$ext",
     });
+
+    LJ::run_hook ("update_counter", {
+        counter => "load_props_multi",
+        value   => $LJ::COUNT_LOAD_PROPS_MULTI,
+    });
 });
 
 LJ::register_hook('notify_event_displayed', sub{

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