vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - AP Lightweight Performance Statistics (https://vborg.vbsupport.ru/showthread.php?t=263910)

AusPhotography 05-19-2011 10:00 PM

AP Lightweight Performance Statistics
 
1 Attachment(s)
This is a very lightweight hack that adds basic page performance statistics to each page display.

It only displays for Moderators and Admins, as we don't want the unwashed masses ;) to see this information.

Installation: Install the product file from AdminCP

Displays as the last line of the page:
Quote:

Uptime: 13 Days 0:58:17 MySQL Uptime: 0 Days 14:30:11 Page generated in 0.56116 seconds with 31 queries [Server Load Averages (1:5:15) 3.67 : 4.31 : 3.89]
I have this running on vB4.1.3 but it should run on any vB4.0.0 and up.

There are 3.x hacks like this that do more, the trade off being this is very low impact.

2.0.1 Removed can_moderate and added AdminCP option that allows you to set the user-groups that can see the statistics
2.0.2 Added uptime (Linux only)
2.0.3 Phrased and fixed to handle no available uptime in Linux
2.0.4 Added options MySQL uptime - optional - requires MySQL 5.1.12 or higher - off by default - adds one query per page if turned on
2.0.7 Minor updates as implemented on my site

Enjoy!

Kym

AusPhotography 05-20-2011 12:10 AM

1 Attachment(s)
Here is a screen shot...

Attachment 129287

AdminCP options: (2.0.4)

Attachment 130250

lapiervb 05-20-2011 12:53 AM

Do you have a demo or pics?

AusPhotography 05-20-2011 01:08 AM

I posted a screen shot in post 1 :D

ozzy47 05-20-2011 01:30 AM

Where is it coded to only show to Admin and Moderators?

Never mind I found it, if (can_moderate())

So this code is marked Re - Usable, can I take the code and add it to another mod I have on my forum, to display there instead?

AusPhotography 05-20-2011 01:51 AM

can_moderate is the condition. ;)

You can take it and change as you need.

ozzy47 05-20-2011 01:57 AM

Thank you sir, excellent codding btw.

Boofo 05-20-2011 01:58 AM

can_moderate adds a query, you do know that, right?

AusPhotography 05-20-2011 02:31 AM

Quote:

Originally Posted by Boofo (Post 2197835)
can_moderate adds a query, you do know that, right?

Fixed, thanks!

Sayid 05-20-2011 07:09 AM

nice mod, tagged


All times are GMT. The time now is 01:54 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.01096 seconds
  • Memory Usage 1,729KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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