[Fusionforge-commits] r6823 - trunk/gforge/cronjobs

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Fri Jan 30 13:17:27 CET 2009


Author: aljeux
Date: 2009-01-30 13:17:27 +0100 (Fri, 30 Jan 2009)
New Revision: 6823

Modified:
   trunk/gforge/cronjobs/project_weekly_metric.php
Log:
Fixing formula for weekly stats

Modified: trunk/gforge/cronjobs/project_weekly_metric.php
===================================================================
--- trunk/gforge/cronjobs/project_weekly_metric.php	2009-01-30 11:32:35 UTC (rev 6822)
+++ trunk/gforge/cronjobs/project_weekly_metric.php	2009-01-30 12:17:27 UTC (rev 6823)
@@ -63,9 +63,9 @@
 #forum messages
 $sql="INSERT INTO project_counts_weekly_tmp ";
 if ($sys_database_type == 'mysql') {
-	$sql.="SELECT forum_group_list.group_id,'forum',log(3 * count(forum.msg_id)) AS count ";
+	$sql.="SELECT forum_group_list.group_id,'forum',3*log(1+count(forum.msg_id)) AS count ";
 } else {
-	$sql.="SELECT forum_group_list.group_id,'forum',log(3 * count(forum.msg_id)::float) AS count ";
+	$sql.="SELECT forum_group_list.group_id,'forum',3*log(1+count(forum.msg_id)::float) AS count ";
 }
 $sql.="
 FROM forum,forum_group_list 
@@ -82,9 +82,9 @@
 #project manager tasks
 $sql="INSERT INTO project_counts_weekly_tmp ";
 if ($sys_database_type == 'mysql') {
-	$sql.="SELECT project_group_list.group_id,'tasks',log(4 * count(project_task.project_task_id)) AS count ";
+	$sql.="SELECT project_group_list.group_id,'tasks',4*log(1+count(project_task.project_task_id)) AS count ";
 } else {
-	$sql.="SELECT project_group_list.group_id,'tasks',log(4 * count(project_task.project_task_id)::float) AS count ";
+	$sql.="SELECT project_group_list.group_id,'tasks',4*log(1+count(project_task.project_task_id)::float) AS count ";
 }
 $sql.="
 FROM project_task,project_group_list 
@@ -102,9 +102,9 @@
 #bugs
 $sql="INSERT INTO project_counts_weekly_tmp ";
 if ($sys_database_type == 'mysql') {
-	$sql.="SELECT agl.group_id,'bugs',log(3 * count(*)) AS count ";
+	$sql.="SELECT agl.group_id,'bugs',3*log(1+count(*)) AS count ";
 } else {
-	$sql.="SELECT agl.group_id,'bugs',log(3 * count(*)::float) AS count ";
+	$sql.="SELECT agl.group_id,'bugs',3*log(1+count(*)::float) AS count ";
 }
 $sql.="
 FROM artifact_group_list agl,artifact a
@@ -125,9 +125,9 @@
 #patches
 $sql="INSERT INTO project_counts_weekly_tmp ";
 if ($sys_database_type == 'mysql') {
-	$sql.="SELECT agl.group_id,'patches',log(10 * count(*)) AS count ";
+	$sql.="SELECT agl.group_id,'patches',10*log(1+count(*)) AS count ";
 } else {
-	$sql.="SELECT agl.group_id,'patches',log(10 * count(*)::float) AS count ";
+	$sql.="SELECT agl.group_id,'patches',10*log(1+count(*)::float) AS count ";
 }
 $sql.="
 FROM artifact_group_list agl,artifact a
@@ -148,9 +148,9 @@
 #support
 $sql="INSERT INTO project_counts_weekly_tmp ";
 if ($sys_database_type == 'mysql') {
-	$sql.="SELECT agl.group_id,'support',log(5 * count(*)) AS count ";
+	$sql.="SELECT agl.group_id,'support',5*log(1+count(*)) AS count ";
 } else {
-	$sql.="SELECT agl.group_id,'support',log(5 * count(*)::float) AS count ";
+	$sql.="SELECT agl.group_id,'support',5*log(1+count(*)::float) AS count ";
 }
 $sql.="
 FROM artifact_group_list agl,artifact a
@@ -171,9 +171,9 @@
 #cvs commits
 $sql="INSERT INTO project_counts_weekly_tmp ";
 if ($sys_database_type == 'mysql') {
-	$sql.="SELECT group_id,'cvs',log(sum(commits)) AS count ";
+	$sql.="SELECT group_id,'cvs',log(1+sum(commits)) AS count ";
 } else {
-	$sql.="SELECT group_id,'cvs',log(sum(commits)::float) AS count ";
+	$sql.="SELECT group_id,'cvs',log(1+sum(commits)::float) AS count ";
 }
 $sql.="
 FROM stats_cvs_group 
@@ -188,7 +188,7 @@
 
 #developers
 #$sql="INSERT INTO project_counts_weekly_tmp 
-#SELECT group_id,'developers',log(5.0*count(*)) AS count FROM user_group GROUP BY group_id";
+#SELECT group_id,'developers',5*log(1+count(*)) AS count FROM user_group GROUP BY group_id";
 #$err .= "\n\n".$sql;
 #$rel = db_query($sql);
 
@@ -217,9 +217,9 @@
 #file downloads
 $sql="INSERT INTO project_counts_weekly_tmp ";
 if ($sys_database_type == 'mysql') {
-	$sql.="SELECT group_id,'downloads', log(.3 * sum(downloads)) AS downloads ";
+	$sql.="SELECT group_id,'downloads', .3*log(1+sum(downloads)) AS downloads ";
 } else {
-	$sql.="SELECT group_id,'downloads', log(.3 * sum(downloads)::float) AS downloads ";
+	$sql.="SELECT group_id,'downloads', .3*log(1+sum(downloads)::float) AS downloads ";
 }
 $sql.="
 FROM frs_dlstats_group_vw




More information about the Fusionforge-commits mailing list