]> git.wh0rd.org Git - tt-rss.git/commitdiff
daemon: show feeds/minute stats
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 12:23:34 +0000 (16:23 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 12:25:10 +0000 (16:25 +0400)
include/rssfuncs.php
update_daemon2.php

index 49d9e6009c448a8ab7d7e33281602b37df9a701c..01a11da6b535183096cb04158c82834575942160 100644 (file)
                expire_cached_files($debug);
                expire_lock_files($debug);
 
+               $nf = 0;
+
                // For each feed, we call the feed update function.
                foreach ($feeds_to_update as $feed) {
                        if($debug) _debug("Base feed: $feed");
                                while ($tline = db_fetch_assoc($tmp_result)) {
                                        if($debug) _debug(" => " . $tline["last_updated"] . ", " . $tline["id"]);
                                        update_rss_feed($link, $tline["id"], true);
+                                       ++$nf;
                                }
                        }
                }
                // Send feed digests by email if needed.
                send_headlines_digests($link, $debug);
 
+               return $nf;
+
        } // function update_daemon_common
 
        // ignore_daemon is not used
index 6f493b9b580ceea25a321bd61eea869df9d29a9d..c8534af06c7db56327a099010f28d597440126f3 100755 (executable)
                                        // Call to the feed batch update function
                                        // or regenerate feedbrowser cache
 
+                                       $nf = 0;
+
                                        if (rand(0,100) > 30) {
                                                _debug("Waiting before update..");
                                                sleep(rand(5,15));
-                                               update_daemon_common($link);
+                                               $nf = update_daemon_common($link);
                                        } else {
                                                $count = update_feedbrowser_cache($link);
                                                _debug("Feedbrowser updated, $count feeds processed.");
 
                                        _debug("Elapsed time: " . (time() - $start_timestamp) . " second(s)");
 
+                                       if ($nf > 0) {
+                                               _debug("Feeds processed: $nf; feeds/minute: " . sprintf("%.2d", $nf/((time()-$start_timestamp)/60)));
+                                       }
+
                                        db_close($link);
 
                                        // We are in a fork.