size_census.php: avoid divide by zero

This commit is contained in:
David Anderson 2015-04-28 00:32:01 -07:00
parent 2d8fd11fac
commit 452fe458a7
1 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,7 @@ error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
require_once("../inc/boinc_db.inc");
require_once("../inc/util.inc");
function do_app($app) {
// enumerate the host_app_versions for this app,
@ -41,7 +41,7 @@ function do_app($app) {
" from DBNAME.host_app_version, DBNAME.host, DBNAME.app_version " .
" where host_app_version.app_version_id = app_version.id " .
" and app_version.appid = $app->id " .
" and et_n > 0 " .
" and et_n > 0 and et_avg > 0 " .
" and host.id = host_app_version.host_id";
$result = $db->do_query($query);
$a = array();
@ -69,6 +69,8 @@ function do_app($app) {
fclose($f);
}
echo "Starting: ", time_str(time()), "\n";
if ($argc == 2 && $argv[1]=="--all_apps") {
$apps = BoincApp::enum("deprecated=0");
} else {
@ -78,5 +80,6 @@ if ($argc == 2 && $argv[1]=="--all_apps") {
foreach ($apps as $app) {
do_app($app);
}
echo "Finished: ", time_str(time()), "\n";
?>