#At bzr+ssh://bk-internal.mysql.com/bzrroot/mysql-falcon/
209 Hakan Kuecuekyilmaz 2008-06-24
Added Falcon Bug Statistic.
HTML overview is ready. Text only view is not finished yet.
added:
falcon_bug_statistic/
falcon_bug_statistic/falcon_bug_statistic.php
falcon_bug_statistic/falcon_bug_statistic.png
falcon_bug_statistic/fbs.css
falcon_bug_statistic/include/
falcon_bug_statistic/include/config.inc.php
=== added directory 'falcon_bug_statistic'
=== added file 'falcon_bug_statistic/falcon_bug_statistic.php'
--- a/falcon_bug_statistic/falcon_bug_statistic.php 1970-01-01 00:00:00 +0000
+++ b/falcon_bug_statistic/falcon_bug_statistic.php 2008-06-24 16:37:22 +0000
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Bug statistic for MySQL/Falcon.
+ *
+ * Hakan Kuecuekyilmaz, <hakan at mysql dot com>, 2008-06-24.
+ * $Id$
+ */
+
+require_once './include/config.inc.php';
+
+$dbh = @mysql_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS);
+
+if (!$dbh) {
+ echo '[ERROR]: Could not connect to database.';
+ exit;
+}
+
+mysql_select_db(DATABASE_NAME);
+
+// Sample data.
+$sql_prio = "SELECT priority, count(*) AS count FROM bugdb
+ WHERE status IN (
+ 'In progress',
+ 'In review',
+ 'Patch approved',
+ 'Patch pending',
+ 'Patch queued',
+ 'Post-fix test fail',
+ 'QA review',
+ 'Verified'
+ )
+ AND severity <> 4
+ AND bug_type = 'Server: Falcon'
+ GROUP BY priority";
+
+$sql_stat = "SELECT status, count(*) AS count FROM bugdb
+ WHERE status IN (
+ 'In progress',
+ 'In review',
+ 'Patch approved',
+ 'Patch pending',
+ 'Patch queued',
+ 'Post-fix test fail',
+ 'QA review',
+ 'Verified'
+ )
+ AND severity <> 4
+ AND bug_type = 'Server: Falcon'
+ GROUP BY status";
+
+
+$res_prio = mysql_query($sql_prio);
+$res_stat = mysql_query($sql_stat);
+
+/**
+ * HTML output.
+ */
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Falcon Bug Statstic</title>
+ <link href="./fbs.css" rel="stylesheet" type="text/css" />
+ </head>
+<body>
+
+<div class="fbs_head">
+ <div class="fbs_head_img">
+ <!-- Image generated at http://www.creatr.cc/creatr/ -->
+ <img src="./falcon_bug_statistic.png" />
+ </div>
+</div>
+
+<div class="fbs">
+ <table style="width: 90%;">
+ <tr>
+ <td style="border: none;">
+ <table>
+ <tr>
+ <td><h2>Priority</h2></td>
+ <td><h2>Count</h2></td>
+ </tr>
+ <?php
+ $sum = 0;
+ while ($row = mysql_fetch_assoc($res_prio)) {
+ $sum += $row['count'];
+ echo '<tr>' . "\n";
+ echo ' <td>' . $row['priority'] . '</td>' . "\n";
+ echo ' <td>' . $row['count'] . '</td>' . "\n";
+ echo '</tr>' . "\n";
+ }
+ echo '<tr>' . "\n";
+ echo ' <td><b>All</b></td>' . "\n";
+ echo ' <td><b>' . $sum . '</b></td>' . "\n";
+ echo '</tr>' . "\n";
+ ?>
+ </table></td>
+
+ <td style="border: none;">
+ <table>
+ <tr>
+ <td><h2>Status</h2></td>
+ <td><h2>Count</h2></td>
+ </tr>
+ <?php
+ $sum = 0;
+ while ($row = mysql_fetch_assoc($res_stat)) {
+ $sum += $row['count'];
+ echo '<tr>' . "\n";
+ echo ' <td>' . $row['status'] . '</td>' . "\n";
+ echo ' <td>' . $row['count'] . '</td>' . "\n";
+ echo '</tr>' . "\n";
+ }
+ echo '<tr>' . "\n";
+ echo ' <td><b>All</b></td>' . "\n";
+ echo ' <td><b>' . $sum . '</b></td>' . "\n";
+ echo '</tr>' . "\n";
+
+ ?>
+ </table></td>
+ </tr>
+ </table>
+</div>
+
+</body>
+</html>
+
+<?php
+/**
+ * Text output.
+ */
+?>
=== added file 'falcon_bug_statistic/falcon_bug_statistic.png'
Binary files a/falcon_bug_statistic/falcon_bug_statistic.png 1970-01-01 00:00:00 +0000 and
b/falcon_bug_statistic/falcon_bug_statistic.png 2008-06-24 16:37:22 +0000 differ
=== added file 'falcon_bug_statistic/fbs.css'
--- a/falcon_bug_statistic/fbs.css 1970-01-01 00:00:00 +0000
+++ b/falcon_bug_statistic/fbs.css 2008-06-24 16:37:22 +0000
@@ -0,0 +1,92 @@
+/**
+ * Hakan Kuecuekyilmaz <hakan at mysql dot com>, 2008-06-24.
+ *
+ * $Id$
+ */
+
+body {
+ background-color: #ECEDEE;
+ font-family: Verdana, Arial, Helvetica, Sans-Serif;
+ font-size: 1em;
+ margin: 0px;
+ padding: 0px;
+}
+
+h1 {
+ color: white;
+ display: inline;
+ font-size: 1.6em;
+ font-weight: bold;
+}
+
+h2 {
+ color: black;
+ font-size: 1.4em;
+ font-style: italic;
+ font-weight: bold;
+ text-align: center;
+}
+
+h3 {
+ color: black;
+ display: inline;
+ font-size: 1.2em;
+ font-weight: bold;
+}
+
+h4 {
+ color: black;
+ display: inline;
+ font-size: 1.0em;
+ font-weight: bold;
+}
+
+img {
+ border: none;
+}
+
+div.fbs_head {
+ background: #FEFEFE;
+ border: 1px dashed black;
+ color: black;
+ font-family: Verdana, Arial, Helvetica, Sans-Serif;
+ margin: 23px 11% 10px 11%;
+ padding: 20px 20px 20px 20px;
+ position: relative;
+ width: auto;
+}
+
+div.fbs_head_img {
+ text-align: center;
+}
+
+div.fbs {
+ background: #C6C6CF;
+ border: 1px dashed black;
+ color: black;
+ font-family: Verdana, Arial, Helvetica, Sans-Serif;
+ margin: 23px 11% 10px 11%;
+ padding: 20px 20px 20px 20px;
+ position: relative;
+ width: auto;
+}
+
+
+div.fbs table {
+ border-collapse: collapse;
+ margin: auto;
+}
+
+div.fbs td {
+ border: 1px solid #000000;
+ padding: 0.1em 0.2em;
+ vertical-align: bottom;
+}
+
+div.fbs tr.even {
+ background-color:#E1E1E1;
+}
+
+div.fbs tr.odd {
+ background-color:#EFFFFA
+}
=== added directory 'falcon_bug_statistic/include'
=== added file 'falcon_bug_statistic/include/config.inc.php'
--- a/falcon_bug_statistic/include/config.inc.php 1970-01-01 00:00:00 +0000
+++ b/falcon_bug_statistic/include/config.inc.php 2008-06-24 16:37:22 +0000
@@ -0,0 +1,22 @@
+<?php
+ /**
+ * Global configuration for Falcon statistics collection.
+ *
+ * Hakan Kuecuekyilmaz <hakan at mysql dot com>, 2008-06-24.
+ * $Id$
+ */
+
+/**
+ * Connection data to the MySQL database and table prefix.
+ */
+define('DATABASE_HOST', 'bugs.mysql.com');
+define('DATABASE_NAME', 'bugs');
+define('DATABASE_USER', 'readonly');
+define('DATABASE_PASS', '');
+
+/**
+ * Array of email addresses who will get a report.
+ */
+$receiver[] = 'hakan@stripped';
+$receiver[] = 'klewis@stripped';
+?>
| Thread |
|---|
| • bzr commit into mysql-falcon branch (hakan:209) | Hakan Kuecuekyilmaz | 24 Jun |