vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vbMicroStats: page load time, queries, GZIP and PHP version (https://vborg.vbsupport.ru/showthread.php?t=35811)

Bison 11-24-2002 02:51 PM

Must be a "server thing" ... it was working B-fore!

Asendin 11-24-2002 05:45 PM

since installing this hack on 2.2.9, my 5 min server load stat shows up in red. this happen to anyone else?

not that it matters, i kinda like it this way, just wondering

http://www.asendtechnologies.com/misc/microstats.jpg

TECK 11-25-2002 11:25 AM

You probably removed the space between brackets, as suggested in the readme file...
That will make the server stats to show colored, otherwise they will show in black. :)

Julio 11-26-2002 11:13 AM

To "call" microstats, I simply use:

{getmicrostats} $trimmedtime $percentphp $percentsql $query_count $serverload ?

Sebastian 12-01-2002 11:31 PM

TECK, How do I get it to show the server uptime right below the load?

Right now mines show:

Page generated in 0.15713799 seconds (81.58% PHP - 18.42% MySQL) with 15 queries.
[Debug Mode OFF] [PHP v4.3.0RC] [GZIP enabled - level 1] [Server Load: 0.01 ยป 0.02 : 0.00]

I would like to see uptime right below the load.

/me installed

TECK 12-02-2002 08:50 AM

Code:

function serveruptime() {
  $fd = fopen( '/proc/uptime' , 'r' );
  $ar_buf = split( ' ' , fgets( $fd , 4096 ) );
  fclose( $fd );
  $sys_ticks = trim( $ar_buf[0] );
  $min = $sys_ticks / 60;
  $hours = $min / 60;
  $days = floor( $hours / 24 );
  $hours = floor( $hours - ( $days * 24 ) );
  $min = floor( $min - ( $days * 60 * 24 ) - ( $hours * 60 ) );

  if ( $days != 1 ) {
    $value = $days . ' days, ';
  } else {
    $value = $days . ' day, ';
  }
  if ( $hours != 1 ) {
    $value .= $hours . ' hours and ';
  } else {
    $value .= $hours . ' hour and ';
  }
  if ( $min != 1 ) {
    $value .= $min . ' minutes';
  } else {
    $value .= $min . ' minute';
  }

  return $value;
}


snout 12-02-2002 11:09 AM

cool thanks mate, sounds useful ;) ill give it a try........

bahamut0 12-02-2002 03:27 PM

installed very nice helpfull in seeing quickly how many queries im getting. which is 22

Sebastian 12-05-2002 09:57 AM

TECK.

you have already added: @exec('uptime')

so I cannot redeclare that code you posted, you are parsing the @exec('uptime') to only show the load averages right? if so how do I un parse the code below so it shows the uptime right near the load?

thanks.

Code:

    if ($stats=@exec('uptime')) {
      preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
      $serverload=' [Server Load: '.$regs[1].' : '.$regs[2].' : '.$regs[3].']';
    } else {
      $serverload='';
    }


TECK 12-05-2002 10:26 AM

Code:

    function serveruptime() {
      $fd = fopen( '/proc/uptime' , 'r' );
      $ar_buf = split( ' ' , fgets( $fd , 4096 ) );
      fclose( $fd );
      $sys_ticks = trim( $ar_buf[0] );
      $min = $sys_ticks / 60;
      $hours = $min / 60;
      $days = floor( $hours / 24 );
      $hours = floor( $hours - ( $days * 24 ) );
      $min = floor( $min - ( $days * 60 * 24 ) - ( $hours * 60 ) );

      if ( $days != 1 ) {
        $value = $days . ' days, ';
      } else {
        $value = $days . ' day, ';
      }
      if ( $hours != 1 ) {
        $value .= $hours . ' hours and ';
      } else {
        $value .= $hours . ' hour and ';
      }
      if ( $min != 1 ) {
        $value .= $min . ' minutes';
      } else {
        $value .= $min . ' minute';
      }

      return $value;
    }

    if ( $stats = @exec( 'uptime' ) ) {
      preg_match( '/averages?: ([0-9\.]+),[\s]+([0-9\.]+) , [\s]+([0-9\.]+)/' , $stats , $regs );
      $serveruptime = serveruptime();
      $serverload = ' [Server Load: '.$regs[1].' : '.$regs[2].' : '.$regs[3].'][Server Uptime: ' . $serveruptime . ']';
    } else {
      $serverload = '';
    }



All times are GMT. The time now is 11:05 PM.

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.01918 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)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