Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[HACK] New Server Load
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-04-14 20:35:19
Hi all.

Add to index.php:

begin_frame("Szerver terhelts
Unknown User
2008-04-14 20:43:16
Missing the images but not too bad...

new_stats.jpg
new_stats.jpg
Unknown User
2008-04-14 20:48:04
Images...  :)

New:

begin_frame("Server Load");
?>

<table width=100% border=0 cellspacing=0 cellpadding=10><tr><td align=center>

<table class=interiortable border=0 width=500><tr><td style='padding: 0px; background-repeat: repeat-x'>

<?

$percent = min(100, round(exec('ps ax | grep -c apache') / 256 * 150));

echo "<br>Server load: ($percent %)<table class=interiortable border=0 width=400><tr><td style='padding: 0px; background-image: url(images/loadbarbg.gif); background-repeat: repeat-x'>";

if ($percent <= 70) $pic = "images/loadbargreen.gif";

elseif ($percent <= 90) $pic = "images/loadbaryellow.gif";

else $pic = "images/loadbarred.gif";

$width = $percent * 8;

echo "<img height=15 width=$width src=\"$pic\" alt='$percent%'></td></tr></table>";

echo "" . trim(exec('uptime')) . "";?>

</td></tr></table>

</td></tr></table>

<?

end_frame();







loadbarbg.gif
loadbarbg.gif
loadbargreen.gif
loadbargreen.gif
loadbarred.gif
loadbarred.gif
loadbaryellow.gif
loadbaryellow.gif
Unknown User
2008-04-14 20:54:28
can people stop using codebox, IPB sometimes breaks the contents when you edit it
Unknown User
2008-04-14 21:07:15
thank you
Unknown User
2008-04-15 14:50:29
New code. (FIX and mod)

//Server load by wolfnet | www.exanova.eu
begin_frame("Szerver terhelts
Unknown User
2008-04-15 16:41:17
thanks
Unknown User
2008-04-15 18:50:03
The results between the "new code with images" and your "New code. (FIX and mod)" display extreme differences in percentages.  Just curious what your reasoning is for making the changes you did and why you feel the grep method isn't accurate enough.  I do like the idea of using getmicrotime() minus $time_start as this represents the server load based on the users connection to the server.
Unknown User
2008-04-15 20:04:50
$time_start = getmicrotime();

$time = round(getmicrotime() - $time_start,4);

that will come out as like 0.00002 seconds

if you're going to do it like that you need to use $GLOBALS["tstart"]
Unknown User
2008-04-15 20:17:29
He works for me.
Unknown User
2008-04-15 20:50:55
i never said it didn't work... i just said it will always give the wrong time since those 2 lines will be executed within 0.1seconds
Unknown User
2008-05-11 15:56:41
which is the best code now?
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728