Revision: 345 http://opencsw.svn.sourceforge.net/opencsw/?rev=345&view=rev Author: wbonnet Date: 2011-02-27 22:23:33 +0000 (Sun, 27 Feb 2011)
Log Message: ----------- Add uwatch statistics Modified Paths: -------------- web/wordpresscsw/tools/statistics/db-common.php Added Paths: ----------- web/wordpresscsw/tools/statistics/qaActiveMaintainers.php web/wordpresscsw/tools/statistics/qaBugStatistics.php web/wordpresscsw/tools/statistics/qaGarMissing.php web/wordpresscsw/tools/statistics/qaGarPending.php web/wordpresscsw/tools/statistics/qaOrphanedPackages.php web/wordpresscsw/tools/statistics/qaRetiredMaintainers.php web/wordpresscsw/tools/statistics/qaUpgradeGar.php web/wordpresscsw/tools/statistics/qaUpgradeStable.php web/wordpresscsw/tools/statistics/qaUpgradeTesting.php web/wordpresscsw/tools/statistics/qaUpgradeUnstable.php Modified: web/wordpresscsw/tools/statistics/db-common.php =================================================================== --- web/wordpresscsw/tools/statistics/db-common.php 2011-02-27 22:22:54 UTC (rev 344) +++ web/wordpresscsw/tools/statistics/db-common.php 2011-02-27 22:23:33 UTC (rev 345) @@ -337,5 +337,284 @@ return $statUwatch ; } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of packages missing in GAR for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getGarMissingOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_GAR_MISSING_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of packages pending in GAR for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getGarPendingOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_GAR_PENDING_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of orphaned packages for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getOrphanedPackagesOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_PKG_ORPHANED_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of active maintainers for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getActiveMaintainersOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_ACTIVE_MAINTAINER_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of retired maintainers with packages for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getRetiredMaintainersOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_RETIRED_MAINTAINER_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of stable package which can be upgraded for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getUpgradablePackagesInStableOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_STABLE_UPGRADABLE_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of unstable package which can be upgraded for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getUpgradablePackagesInUnstableOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_UNSTABLE_UPGRADABLE_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of testing package which can be upgraded for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getUpgradablePackagesInTestingOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_TESTING_UPGRADABLE_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } + + // ----------------------------------------------------------------------------------------------------------------------- + // + // Get the number of gar package which can be upgraded for the last 12 rolling months + // + // ----------------------------------------------------------------------------------------------------------------------- + function getUpgradablePackagesInGarOverLastYear() { + + // Initialize the variables + $statUwatch = array(); // array of data that will be returned to caller + $statIndex = 0; // current index + + for ($i = 0 ; $i < 52 ; $i ++) { + $statUwatch[$i][0] = 0; + $statUwatch[$i][1] = 2; + $statUwatch[$i][2] = 2011; + } + + // Define the query used to retrieve the packages from the database + $sqlQuery = "select STU_GAR_UPGRADABLE_COUNT, STU_MONTH, STU_YEAR from QA_STATS_UWATCH order by ID_STU desc limit 0,52;" ; + + // Execute the query to retrieve the row to update + $this->execQuery($sqlQuery); + + // Check if there is a result + while ($row = mysql_fetch_array($this->result)) { + $statUwatch[$statIndex++] = $row; // Yes there is a record, thus copy it to the array + } + + return $statUwatch ; + } } ?> Added: web/wordpresscsw/tools/statistics/qaActiveMaintainers.php =================================================================== --- web/wordpresscsw/tools/statistics/qaActiveMaintainers.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaActiveMaintainers.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getActiveMaintainersOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of active maintainers", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaBugStatistics.php =================================================================== --- web/wordpresscsw/tools/statistics/qaBugStatistics.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaBugStatistics.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getUwatchErrorsOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Green()); + $plot->setFillColor(new LightGreen(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidGreen); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of available packages", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Property changes on: web/wordpresscsw/tools/statistics/qaBugStatistics.php ___________________________________________________________________ Added: svn:executable + * Added: web/wordpresscsw/tools/statistics/qaGarMissing.php =================================================================== --- web/wordpresscsw/tools/statistics/qaGarMissing.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaGarMissing.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getGarMissingOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of packages missing in GAR", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaGarPending.php =================================================================== --- web/wordpresscsw/tools/statistics/qaGarPending.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaGarPending.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getGarPendingOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of packages pending in GAR", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaOrphanedPackages.php =================================================================== --- web/wordpresscsw/tools/statistics/qaOrphanedPackages.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaOrphanedPackages.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getOrphanedPackagesOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of orphaned packages", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaRetiredMaintainers.php =================================================================== --- web/wordpresscsw/tools/statistics/qaRetiredMaintainers.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaRetiredMaintainers.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getRetiredMaintainersOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of retired maintainers", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaUpgradeGar.php =================================================================== --- web/wordpresscsw/tools/statistics/qaUpgradeGar.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaUpgradeGar.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getUpgradablePackagesInGarOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of packages", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaUpgradeStable.php =================================================================== --- web/wordpresscsw/tools/statistics/qaUpgradeStable.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaUpgradeStable.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getUpgradablePackagesInStableOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of packages", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaUpgradeTesting.php =================================================================== --- web/wordpresscsw/tools/statistics/qaUpgradeTesting.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaUpgradeTesting.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getUpgradablePackagesInTestingOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of packages", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> Added: web/wordpresscsw/tools/statistics/qaUpgradeUnstable.php =================================================================== --- web/wordpresscsw/tools/statistics/qaUpgradeUnstable.php (rev 0) +++ web/wordpresscsw/tools/statistics/qaUpgradeUnstable.php 2011-02-27 22:23:33 UTC (rev 345) @@ -0,0 +1,94 @@ +<?php + + // Includes the graphics library + require_once "Artichow/LinePlot.class.php"; + + // Include the database parameters + require("db-common.php"); + + // Defines the function to call for label output + function setMonth($value) { + global $stats, $labelHashMap; + + date_default_timezone_set('Europe/Paris'); + $str = date('M', mktime(0,0,0, $stats[51 - $value][1], 1)) . " '"; + $str .= date('y', mktime(0,0,0,0,1, $stats[51 - $value][2] + 1)); + + if (array_key_exists( $str, $labelHashMap)) { + return ""; + } else { + $labelHashMap["$str"] = "1"; + return $str; + } + } + + function setNumber($value) { + return round($value); + } + + function labelFormat($value) { + return $value; + } + + // Initialize the array hashmap + $labelHashMap = array() ; + + // Initialization of the graphics + $graph = new Graph(800, 480); + $graph->setAntiAliasing(FALSE); + + $group = new PlotGroup; + $group->grid->setType(Line::DASHED); + + $group->setPadding(40, NULL, 20, NULL); + + $group->axis->left->setLabelNumber(8); + $group->axis->left->setLabelPrecision(1); + $group->axis->left->setTickStyle(Tick::OUT); + + // Statistics array population + $statPackage = array(); // Initialize the number of packages array + + // Create the DAO object + $statDAO = new mysqlDAO(); + + // Connect to database + $statDAO->connect(); + + // Retrieve the statistics from the database + $stats = $statDAO->getUpgradablePackagesInUnstableOverLastYear(); + + // Disconnect from database + $statDAO->disconnect(); + + for ($idxCounter = 51 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data + $statPackage[$idxCounter] = $stats[51 - $idxCounter][0]; // into the creation array + } + + $plot = new LinePlot($statPackage); + + $plot->label->setFont(new Tuffy(7)); + $plot->label->setPadding(1, 1, 1, 1); + $plot->label->setCallbackFunction("labelFormat"); + $plot->label->setBackgroundColor( + new Color(227, 223, 241, 15) + ); + $plot->setColor(new Red()); + $plot->setFillColor(new LightRed(80)); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $group->legend->add($plot, "Number of packages", Legend::MARK); + $group->legend->setPosition(0.35, 0.15); + $group->add($plot); + + $group->axis->bottom->label->setCallbackFunction('setMonth'); + $group->axis->left->label->setCallbackFunction('setNumber'); + + $graph->add($group); + + $graph->draw(); + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ devel mailing list devel@lists.opencsw.org https://lists.opencsw.org/mailman/listinfo/devel