version 1.127, 2003/05/08 21:25:31
|
version 1.129, 2003/05/08 22:07:48
|
Line 2071 sub version {
|
Line 2071 sub version {
|
return "version:$VERSION"; |
return "version:$VERSION"; |
} |
} |
|
|
|
#There is a copy of this in lonnet.pm |
sub userload { |
sub userload { |
my $numusers=0; |
my $numusers=0; |
{ |
{ |
Line 2080 sub userload {
|
Line 2081 sub userload {
|
while ($filename=readdir(LONIDS)) { |
while ($filename=readdir(LONIDS)) { |
if ($filename eq '.' || $filename eq '..') {next;} |
if ($filename eq '.' || $filename eq '..') {next;} |
my ($atime)=(stat($perlvar{'lonIDsDir'}.'/'.$filename))[8]; |
my ($atime)=(stat($perlvar{'lonIDsDir'}.'/'.$filename))[8]; |
if ($curtime-$atime < 3600) { $num_users++; } |
if ($curtime-$atime < 3600) { $numusers++; } |
} |
} |
closedir(LONIDS); |
closedir(LONIDS); |
} |
} |
my $userloadpercent=0; |
my $userloadpercent=0; |
my $maxuserload=$perlvar{'lonUserLoadLim'}; |
my $maxuserload=$perlvar{'lonUserLoadLim'}; |
if ($maxuserload) { |
if ($maxuserload) { |
$userloadpercent=100*$num_users/$maxuserload; |
$userloadpercent=100*$numusers/$maxuserload; |
} |
} |
return $userloadpercent; |
return $userloadpercent; |
} |
} |