forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Statistics => Topic started by: luchtzak on July 18, 2006, 10:18:48 am

Title: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: luchtzak on July 18, 2006, 10:18:48 am
Does this exist for the coppermine gallery?

 [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]

or

 Script Execution Time: 0.20084 | SQL Queries: 10

many of the popular softwares have this, perhaps it can be programmed for coppermine too?

any suggestion where to find?
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Abbas Ali on July 18, 2006, 11:57:18 am
Best suggestion is reading the docs...

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_misc
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Nibbler on July 18, 2006, 12:14:59 pm
It's not visible to regular users, is that what you are requesting ?
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: luchtzak on July 26, 2006, 12:19:23 pm
it's not that what I am looking for.

I would like to see on the bottom of every page a message saying:

this page has been generated in xxx seconds with xx db queries made. e.g. on the bottom of my website: www.luchtzak.be or http://top-100.luchtzak.be/
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Abbas Ali on July 26, 2006, 01:26:39 pm
If you are using cpg1.4.x then you can do the following ...

Create a new script called 'customFooter.php' with code given below and place it in your coppermine folder.

Code: [Select]
<?php
    
global $cpg_time_start$query_stats;

    
$time_end cpgGetMicroTime();
    
$time round($time_end $cpg_time_start3);
    
$query_count count($query_stats);
    
$total_query_time array_sum($query_stats);
    echo 
'<p align="center">[ Page generation: '.$time.'s ][ DB Queries: '.$query_count.' ('.$total_query_time.'s)]</p>';
?>


then log in to the gallery, go to config page and change the value of Path to custom footer include to customFooter.php

This should show the stats at the bottom of every page to every user.
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Sami on July 26, 2006, 01:30:21 pm
nice work abbas ;)
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Paver on July 26, 2006, 02:16:35 pm
From the first post, this sounded like a support request rather than a feature request.

And now with Abbas' code contribution, maybe this thread belongs on the Mods/Add-ons board under Stats.
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: luchtzak on July 27, 2006, 12:14:54 am
Nice programming abbas!

1 item though is the database queries are not shown: http://coppermine.luchtzak.be/displayimage.php?pos=-9043

running 1.4.8 stable
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Nibbler on July 27, 2006, 12:28:04 am
functions.inc.php, change

Code: [Select]
        if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
                $duration = round($query_end - $query_start, 3);
                $query_stats[] = $duration;
                $queries[] = "$query ({$duration}s)";
        }

to

Code: [Select]
        //if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
                $duration = round($query_end - $query_start, 3);
                $query_stats[] = $duration;
                $queries[] = "$query ({$duration}s)";
        //}

Shame about that, would have been an easy plugin otherwise. Moving to mods board.
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: filmman on August 05, 2007, 01:18:46 pm
nice one that worked for me, been looking for something like that
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Joachim Müller on August 06, 2007, 06:56:34 am
@Nibbler: maybe we should add another plugin hook for cpg1.5.x to allow a full pluginized version?
Title: Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
Post by: Nibbler on August 06, 2007, 02:04:48 pm
Yes, would be useful to have a hook in cpg_db_query.