Beispiel #1
0
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
init_session();
$USER->mustHavePerm("admin");
$smarty = new GeographPage();
$db = NewADOConnection($GLOBALS['DSN']);
dump_sql_table('SHOW ' . (empty($_GET['full']) ? '' : 'FULL ') . 'PROCESSLIST', 'Current mySQL Process List');
function dump_sql_table($sql, $title, $autoorderlimit = false)
{
    $result = mysql_query($sql . ($autoorderlimit ? " order by count desc limit 25" : '')) or die("Couldn't select photos : {$sql} " . mysql_error() . "\n");
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    print "<H3>{$title}</H3>";
    print "<TABLE border='1' cellspacing='0' cellpadding='2'><TR>";
    foreach ($row as $key => $value) {
        print "<TH>{$key}</TH>";
    }
    print "</TR>";
    do {
        print "<TR>";
        $align = "left";
        foreach ($row as $key => $value) {
            print "<TD ALIGN={$align}>" . htmlentities($value) . "</TD>";
    dump_sql_table($sql, 'Most Used Classification');
    $sql = "select limit3,count(distinct user_id) as users,count(*) as count from queries where {$datecrit} group by limit3";
    dump_sql_table($sql, 'Most Used Image Category');
    $sql = "select limit4,count(distinct user_id) as users,count(*) as count from queries where {$datecrit} group by limit4";
    dump_sql_table($sql, 'Most Used Reference Index');
    $sql = "select limit5,count(distinct user_id) as users,count(*) as count from queries where {$datecrit} group by limit5";
    dump_sql_table($sql, 'Most Used Grid Square');
    $sql = "select displayclass,count(distinct user_id) as users,count(*) as count from queries where {$datecrit} group by displayclass";
    dump_sql_table($sql, 'Most Used View Class');
    $sql = "select orderby,count(distinct user_id) as users,count(*) as count from queries where {$datecrit} group by orderby";
    dump_sql_table($sql, 'Most Used Order');
    print "<HR/><H2>Search Stats for whole time</H2>";
    $sql = "select searchclass,count(distinct user_id) as users,count(*) as count from queries group by searchclass";
    dump_sql_table($sql, 'Most Used Search Class');
    $sql = "select searchq,count(distinct user_id) as users,count(*) as count from queries group by searchq";
    dump_sql_table($sql, 'Most Used Query Strings');
}
$smarty->display('_std_end.tpl');
exit;
function dump_sql_table($sql, $title, $autoorderlimit = true)
{
    $result = mysql_query($sql . ($autoorderlimit ? " order by count desc limit 25" : '')) or die("Couldn't select photos : {$sql} " . mysql_error() . "\n");
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    print "<H3>{$title}</H3>";
    print "<TABLE border='1' cellspacing='0' cellpadding='2'><TR>";
    foreach ($row as $key => $value) {
        print "<TH>{$key}</TH>";
    }
    print "</TR><TR>";
    foreach ($row as $key => $value) {
        print "<TD>{$value}</TD>";
Beispiel #3
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
init_session();
$USER->mustHavePerm("admin");
$smarty = new GeographPage();
$db = NewADOConnection($GLOBALS['DSN']);
dump_sql_table('select rendered,level,url,filename,count(*),min(ts),max(ts) from kmlcache group by  rendered,level order by level,rendered', 'KML - Superlayer Rendering Progress');
dump_sql_table('select now()', '');
dump_sql_table("select substring(ts,1,10),count(*),count(distinct level),sum(rendered=1),sum(rendered=0) from kmlcache group by substring(ts,1,10) order by ts desc limit 20", 'Last few days');
function dump_sql_table($sql, $title, $autoorderlimit = false)
{
    $result = mysql_query($sql . ($autoorderlimit ? " order by count desc limit 25" : '')) or die("Couldn't select photos : {$sql} " . mysql_error() . "\n");
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    print "<H3>{$title}</H3>";
    print "<TABLE border='1' cellspacing='0' cellpadding='2'><TR>";
    foreach ($row as $key => $value) {
        print "<TH>{$key}</TH>";
    }
    print "</TR>";
    do {
        print "<TR>";
        $align = "left";
        foreach ($row as $key => $value) {
            print "<TD ALIGN={$align}>" . htmlentities($value) . "</TD>";