SVN: toys/stbr/stats: 10monthly.php daily.php index.html total_requests.php

shadzik shadzik at pld-linux.org
Tue Aug 31 11:04:36 CEST 2010


Author: shadzik
Date: Tue Aug 31 11:04:36 2010
New Revision: 11797

Modified:
   toys/stbr/stats/10monthly.php
   toys/stbr/stats/daily.php
   toys/stbr/stats/index.html
   toys/stbr/stats/total_requests.php
Log:
- add ti-dev support


Modified: toys/stbr/stats/10monthly.php
==============================================================================
--- toys/stbr/stats/10monthly.php	(original)
+++ toys/stbr/stats/10monthly.php	Tue Aug 31 11:04:36 2010
@@ -3,7 +3,7 @@
 require_once("php-ofc-library/open-flash-chart.php");
 require_once("db.dat");
 
-$pld_lines = array("th","ti");
+$pld_lines = array("th","ti","ti-dev");
 $year = "2010";
 $months = array("Jan", 
 		"Feb",
@@ -21,9 +21,11 @@
 
 $th_bar = new bar();
 $ti_bar = new bar();
+$ti_dev_bar = new bar();
 
 $thm = array();
 $tim = array();
+$tidm = array();
 foreach ($pld_lines as $line) {
 	for ($month=1; $month<=12; $month++) {
 		$month2 = $month+1;
@@ -39,14 +41,17 @@
 		}
 		if ($line == "th")
 			$thm[] = (int)$q->fetchSingle();
-		else
+		else if ($line == "ti")
 			$tim[] = (int)$q->fetchSingle();
+		else if ($line == "ti-dev")
+			$tidm[] = (int)$q->fetchSingle();
 	}
 	
 }
 
 $th_max = max($thm);
 $ti_max = max($tim);
+$tid_max = max($tidm);
 if ($th_max >= $ti_max)
 	$scale = $th_max;
 else
@@ -60,11 +65,15 @@
 $ti_bar->set_values($tim);
 $ti_bar->set_colour('#3366FF');
 $ti_bar->set_key('Titanium', 12);
+$ti_dev_bar->set_values($tidm);
+$ti_dev_bar->set_colour('#006600');
+$ti_dev_bar->set_key('Titanium Devel', 12);
 
 $chart = new open_flash_chart();
 $chart->set_title($title);
 $chart->add_element($th_bar);
 $chart->add_element($ti_bar);
+$chart->add_element($ti_dev_bar);
 
 $y = new y_axis();
 $y->set_range(0, $scale, 20);

Modified: toys/stbr/stats/daily.php
==============================================================================
--- toys/stbr/stats/daily.php	(original)
+++ toys/stbr/stats/daily.php	Tue Aug 31 11:04:36 2010
@@ -3,7 +3,7 @@
 require_once("php-ofc-library/open-flash-chart.php");
 require_once("db.dat");
 
-$pld_lines = array("th","ti");
+$pld_lines = array("th","ti","ti-dev");
 
 $year = date("Y");
 $month = date("m");
@@ -19,9 +19,11 @@
 
 $th_bar = new line();
 $ti_bar = new line();
+$ti_dev_bar = new line();
 
 $thm = array();
 $tim = array();
+$tidm = array();
 foreach ($pld_lines as $line) {
 	foreach($days as $day) {
 		$q = @$DBhandle->query('select count(*) from application where line="' . $line . '" and date >="'.$year.'-' . (string)$month . '-'.$day.' 00:00:00" and date < "'.$year.'-'. (string)$month .'-'.$day.' 23:59:59"');
@@ -39,12 +41,19 @@
 				else
 					$tim[] = $data;
 				break;
+			case "ti-dev":
+				if ($data == 0)
+					$tidm[] = null;
+				else
+					$tidm[] = $data;
+				break;
 		}
 	}
 }
 
 $th_max = max($thm);
 $ti_max = max($tim);
+$tid_max = max($tidm);
 if ($th_max >= $ti_max)
 	$scale = $th_max;
 else
@@ -59,11 +68,15 @@
 $ti_bar->set_values($tim);
 $ti_bar->set_colour('#3366FF');
 $ti_bar->set_key('Titanium', 12);
+$ti_dev_bar->set_values($tidm);
+$ti_dev_bar->set_colour('#006600');
+$ti_dev_bar->set_key('Titanium Devel', 12);
 
 $chart = new open_flash_chart();
 $chart->set_title($title);
 $chart->add_element($th_bar);
 $chart->add_element($ti_bar);
+$chart->add_element($ti_dev_bar);
 
 $y = new y_axis();
 $y->set_range(0, $scale, 1);

Modified: toys/stbr/stats/index.html
==============================================================================
--- toys/stbr/stats/index.html	(original)
+++ toys/stbr/stats/index.html	Tue Aug 31 11:04:36 2010
@@ -29,6 +29,9 @@
 		<script type="text/javascript">
 			swfobject.embedSWF("open-flash-chart.swf", "Top10_specTi", "700", "400", "9.0.0", "expressInstall.swf", {"data-file":"top10specTitanium.php"} );
 		</script>
+		<script type="text/javascript">
+			swfobject.embedSWF("open-flash-chart.swf", "Top10_specTi-dev", "700", "400", "9.0.0", "expressInstall.swf", {"data-file":"top10specTitanium-dev.php"} );
+		</script>
 	</head>
 	<body>
 		<div id="Total_requests"></div>
@@ -40,5 +43,6 @@
 		<div id="Top10_sender"></div>
 		<div id="Top10_specTh"></div>
 		<div id="Top10_specTi"></div>
+		<div id="Top10_specTi-dev"></div>
 	</body>
 </html>

Modified: toys/stbr/stats/total_requests.php
==============================================================================
--- toys/stbr/stats/total_requests.php	(original)
+++ toys/stbr/stats/total_requests.php	Tue Aug 31 11:04:36 2010
@@ -6,7 +6,7 @@
 $q = $DBhandle->query('select count(*) from application');
 $total = (int)$q->fetchSingle();
 
-$pld_lines = array("th","ti");
+$pld_lines = array("th","ti","ti-dev");
 
 $tmp = array();
 foreach ($pld_lines as $line) {
@@ -27,7 +27,7 @@
 $y->set_range(0, max($tmp), 100);
 
 $xlabels = new x_axis_labels();
-$xlabels->set_labels(array("Th", "Titanium"));
+$xlabels->set_labels(array("Th", "Titanium", "Titanium Devel"));
 
 $x = new x_axis();
 $x->set_labels($xlabels);


More information about the pld-cvs-commit mailing list