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

djilou 05-20-2011 01:15 PM

WTF in CMS home I see :
Page generated in 1.03960 seconds with 1738 queries [Server Load Averages (1:5:15)

1738 queries :eek::eek:

BadgerDog 05-20-2011 01:25 PM

Works great ... thank you ... :up:

I've always wondered about what the math numbers of the Server Load Averages mean.

Does anyone have a simple definition?

Regards,
Doug

doctorsexy 05-20-2011 02:04 PM

cms home i get this
Page generated in 0.55868 seconds with 82 queries [Server Load Averages (1:5:15) 2.86 : 3.18 : 2.91]

Working ..smashin...thanks

AusPhotography 05-21-2011 12:06 AM

Load averages here http://blog.scoutapp.com/articles/20...-load-averages

They are 1, 5 and 15 minutes loads. The meaning of the numbers are very dependant on the number of cores (CPUs).
Very simplistically - If you're running 2 x quad core then anything under 8 is ok.

AusPhotography 05-21-2011 12:09 AM

Quote:

Originally Posted by djilou (Post 2197981)
WTF in CMS home I see :
Page generated in 1.03960 seconds with 1738 queries [Server Load Averages (1:5:15)

1738 queries :eek::eek:

What OS are you running?

BadgerDog 05-21-2011 09:18 AM

Quote:

Originally Posted by snoopytas (Post 2198195)
Load averages here http://blog.scoutapp.com/articles/20...-load-averages

They are 1, 5 and 15 minutes loads. The meaning of the numbers are very dependant on the number of cores (CPUs).
Very simplistically - If you're running 2 x quad core then anything under 8 is ok.

Thanks ... :up:

Regards,
Doug

COL NIL SATIS 05-21-2011 10:44 AM

tagged!!!! looks ace this does

djilou 05-21-2011 10:45 AM

Quote:

Originally Posted by snoopytas (Post 2198196)
What OS are you running?

CentOs 5

COL NIL SATIS 05-21-2011 10:55 AM

Installed

Page generated in 0.71467 seconds with 57 queries [Server Load Averages (1:5:15) 0.65 : 0.81 : 0.73]

works ace too !!!

Alan_SP 05-22-2011 12:41 AM

Is there a guide how many queries are normal for Forum, CMS, Blog? Or at least average.

For me first load of CMS was about 250, Forum index is 24-25. CMS reloaded is 170-200.

AusPhotography 05-22-2011 07:52 AM

We are forum only,I have no idea what is normal for CMS

But hundreds seems high, i.e. I reckon some tuning by vB.com is needed for future versions

Boofo 05-22-2011 08:38 AM

Quote:

Originally Posted by snoopytas (Post 2198607)
We are forum only,I have no idea what is normal for CMS

But hundreds seems high, i.e. I reckon some tuning by vB.com is needed for future versions

That has been the norm for the CMS for a while now, IIRC. They need to do some work on that.

sisterhood 05-22-2011 08:57 AM

extra nice thx you

MarceloS 05-24-2011 06:41 PM

It shows on my site but not the averages. It stops at "(1:5:15)"

Is it an error?

Boofo 05-24-2011 06:55 PM

snoopytas, when are you going to add the server uptime to this? ;)

AusPhotography 05-25-2011 08:48 AM

Quote:

Originally Posted by Boofo (Post 2199544)
snoopytas, when are you going to add the server uptime to this? ;)

Just for you mate!! (Aussie accent)

Kym

Boofo 05-25-2011 10:20 AM

You are da man! ;)

doctorsexy 05-25-2011 06:47 PM

is it possible to have it a different colour..
what is it under in the stylevars....

AusPhotography 05-26-2011 12:00 AM

Quote:

Originally Posted by doctorsexy (Post 2199913)
is it possible to have it a different colour..
what is it under in the stylevars....

I'll look into it and come up with something next week

Alan_SP 05-26-2011 02:38 AM

Could you phrase output of mod?

MarceloS 06-01-2011 10:32 PM

Quote:

Originally Posted by MarceloS (Post 2199541)
It shows on my site but not the averages. It stops at "(1:5:15)"

Is it an error?

Can anyone help me on this?

My server is LINUX. Latest version of the mod.

My board shows:
"Page generated in 0.12074 seconds with 20 queries [Server Load Averages (1:5:15)"

AusPhotography 06-01-2011 11:33 PM

@MarceloS You will need to see if either of the two methods are active for the Apache account.

I.e.
1. Can the file /proc/loadavg be accessed by the Apache account?
-or-
2. Does uptime run?

If neither work, then its a Linux permissions/shell problem.

If you are running security enhanced linux then you may need to adjust the security profile.

Kym

EasyEazy 06-01-2011 11:37 PM

Installed on 4.1.1 and working great.

Thanks

AusPhotography 06-02-2011 03:45 AM

Quote:

Originally Posted by doctorsexy (Post 2199913)
is it possible to have it a different colour..
what is it under in the stylevars....

Quote:

Originally Posted by Alan_SP (Post 2200052)
Could you phrase output of mod?

I've phrased it so you can more easily change the words and/or colours etc.
It uses the default colours per class="smallfont" at the footer.

Alan_SP 06-03-2011 01:54 AM

Thank you! :up:

MarceloS 06-03-2011 10:58 AM

Quote:

Originally Posted by snoopytas (Post 2202513)
@MarceloS You will need to see if either of the two methods are active for the Apache account.

I.e.
1. Can the file /proc/loadavg be accessed by the Apache account?
-or-
2. Does uptime run?

If neither work, then its a Linux permissions/shell problem.

If you are running security enhanced linux then you may need to adjust the security profile.

Kym

1. Support says that "The file "/proc/loadavg" is under the ownership of root. So Apache user cannot access it." They say that it can't be changed.

2. Uptime not working. After the update, I get only this: "Page generated in 0.10525 seconds with 19 queries"

AusPhotography 06-08-2011 09:24 AM

@MarceloS, it seems your hosting provider has more limits than mine. Not much i can do about that.

AusPhotography 06-21-2011 06:33 AM

Updated !

It now optionally shows the MySQL uptime.
This adds one query per page, is off by default, and needs MySQL 5.1.12 or higher

RedDevil 06-21-2011 04:21 PM

Added seems to work fine on VB 4.1.3 and 4.1.4, maybe add colour change in settings rather than edit phrases.

Nice addon

AusPhotography 06-22-2011 07:16 AM

The colour is not something I want as this mod is intended to be light, fast and only for site staff.
It's not really intended for all your forum members as it really aimed at performance monitoring.


All times are GMT. The time now is 02:46 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.01345 seconds
  • Memory Usage 1,808KB
  • 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
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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