vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Microstats (only for admin) - load times, server loads, queries, uncached templates! (https://vborg.vbsupport.ru/showthread.php?t=59700)

Alien 01-07-2004 02:31 PM

How exactly would I adjust this so ANYONE can view it, not just admins?

Serge 01-07-2004 06:17 PM

Quote:

Originally Posted by Alien
How exactly would I adjust this so ANYONE can view it, not just admins?

I don't know if I'm allowed to repost but this is what you would do.

PHP Code:

    // Microstats hack 
   
$pageendtime microtime(); 
   
$starttime explode(' '$pagestarttime); 
   
$endtime explode(' '$pageendtime); 
   
$totaltime vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5); 
   if (
$stats=@exec('uptime')) { 
       
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs); 
       
$serverload=' [Server Loads: <b>'.$regs[1].'</b> ? '.$regs[2].' : '.$regs[3].']'
       } 
 
$debughtml "<center><span class=\"smallfont\">Page generated in <b>$totaltime</b> seconds with <b>$query_count</b> queries" iif($_TEMPLATEQUERIES" (<b>" sizeof($_TEMPLATEQUERIES) . "</b> queries for uncached templates)"'') . "$serverload</span>"
   
$vartext str_replace('</body>'"$debughtml\n</body>"$vartext); 
   
//Microstats Hack 

Place that in the same EXACT place as you would have for the orginal hack all this did was took out the check for the admin part.

Serge 01-07-2004 06:19 PM

Actually if you know what I'm talking about just take the frist if line out and then delete the } at the very end before the comment. That will do it I will work on that post although I have no clue why that happened might be a bug.

EDIT: I fixed the post above when I copied Erwin's code it came though with the color on it as well in the WYSISWG and it left it on there as well and then when I changed everything to black it didn't work but in the end I got it fixed.

Alex 01-08-2004 02:13 PM

Could you add gzip stats to it? please!

TECK 01-08-2004 03:59 PM

Quote:

Originally Posted by Serge
I don't know if I'm allowed to repost but this is what you would do.

PHP Code:

    // Microstats hack 
   
$pageendtime microtime(); 
   
$starttime explode(' '$pagestarttime); 
   
$endtime explode(' '$pageendtime); 
   
$totaltime vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5); 
   if (
$stats=@exec('uptime')) { 
       
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs); 
       
$serverload=' [Server Loads: <b>'.$regs[1].'</b> ? '.$regs[2].' : '.$regs[3].']'
       } 
 
$debughtml "<center><span class=\"smallfont\">Page generated in <b>$totaltime</b> seconds with <b>$query_count</b> queries" iif($_TEMPLATEQUERIES" (<b>" sizeof($_TEMPLATEQUERIES) . "</b> queries for uncached templates)"'') . "$serverload</span>"
   
$vartext str_replace('</body>'"$debughtml\n</body>"$vartext); 
   
//Microstats Hack 

Place that in the same EXACT place as you would have for the orginal hack all this did was took out the check for the admin part.

If you show the server load for everyone, you will kill your server.
Is for a reason I released originally this hack part for admins only...

Hope, this helps.

PS. Yes Erwin, you have my permission to publish any modifications for MicroStats and port it to VB3 software.
Thank you for asking.

Dark_Wizard 01-08-2004 04:06 PM

Nice hack Erwin! Great to have while developing my vbWar 3.0. Thanks!

Alien 01-09-2004 04:15 AM

Ahh, so this and even the one for vB2x were server killers, TECK? :)

I honestly never saw a difference in the server hmm.

I guess I can just set it up for admins to view if so...

Serge: Thanks for that help tho, much appreciated.

coKe67 01-10-2004 10:52 AM

Thanks Erwin,
nice & easy:squareeyed:

Vigile 01-11-2004 11:06 AM

Page generated in 0.25738 seconds with 12 queries (3 queries for uncached templates)

Ok.. call me a knob if ya want, but what is the '3 queries for uncached templates' part trying to tell me? I'm presuming its something I need to fix.

Erwin 01-11-2004 11:20 AM

Quote:

Originally Posted by Vigile
Page generated in 0.25738 seconds with 12 queries (3 queries for uncached templates)

Ok.. call me a knob if ya want, but what is the '3 queries for uncached templates' part trying to tell me? I'm presuming its something I need to fix.

You have 3 uncached templates, which is causing that page to have 3 extra unnecessary queries. You need to add these templates to the template cache by editing that PHP file. To know which templates, you need to switch debug to on. My hack tells you how many templates are uncached, but not which ones.


All times are GMT. The time now is 09:50 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01416 seconds
  • Memory Usage 1,766KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete