]> granicus.if.org Git - php/commitdiff
Dont reset other counters when incrementing slow_rq
authorKarsten Schmidt <git@guggemand.dk>
Wed, 20 Feb 2013 17:53:17 +0000 (18:53 +0100)
committerKarsten Schmidt <git@guggemand.dk>
Wed, 20 Feb 2013 17:53:17 +0000 (18:53 +0100)
sapi/fpm/fpm/fpm_php_trace.c
sapi/fpm/fpm/fpm_scoreboard.c

index d95d66a754c3eecc3115805366318519e48af072..925f2de64e93f2e1555c9321acd465d6db67ec6b 100644 (file)
@@ -138,7 +138,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC
 void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
 {
        TSRMLS_FETCH();
-       fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard);
+       fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, child->wp->scoreboard);
        FILE *slowlog;
 
        zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid);
index 24463a90dddfdb739f1fef5d91e65a298e757efa..8d0868182d763d8d6717b530ee3c0c739319cdae 100644 (file)
@@ -111,7 +111,7 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
                        scoreboard->max_children_reached = max_children_reached;
                }
                if (slow_rq > 0) {
-                       scoreboard->slow_rq += slow_rq;
+                       scoreboard->slow_rq = slow_rq;
                }
        } else {
                if (scoreboard->idle + idle > 0) {
@@ -137,6 +137,12 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
                } else {
                        scoreboard->max_children_reached = 0;
                }
+
+               if (scoreboard->slow_rq + slow_rq > 0) {
+                       scoreboard->slow_rq += slow_rq;
+               } else {
+                       scoreboard->slow_rq = 0;
+               }
        }
 
        if (scoreboard->active > scoreboard->active_max) {