|
|
|
File: C:/usr/local/lib/php/blueshoes-4.2/core/util/Bs_System.class.php
BlueShoes Application Framework - util
Bs_System
Bs_Object | +-- Bs_System
This static class provides system functions.
|
private class Bs_System extends Bs_Object
This static class provides system functions.
dependencies: Bs_String
| Authors | |
| Version | 4.0.$id$ |
| Copyright | blueshoes.org |
|
| |
|
Methods inherited from Bs_Object |
| isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean |
|
|
|
|
|
|
|
Private Constant Summary |
| BS_SYSTEM_VERSION |
>>4.0.$x$<< |
Warning: documentation is missing. |
|
Public Method Details |
getOs |
|
public string getOs( )
|
| |
returns the os we're on.
|
| Returns |
string |
|
getSystemName |
|
public void getSystemName( )
|
| |
tells the systems name.
i think this only works on windows.
|
| Returns |
void |
| Throws |
bool FALSE (if not known) |
|
getCpuStat |
|
public array getCpuStat( [ integer $maxWaitTime ] )
|
| |
returns a hash with the following keys:
'user' => cpu usage for 'user' processes.'system' => cpu usage for 'system' processes.'nice' => cpu usage for low-priority processes.'idle' => free cpu'available' => idle + nice, because you can grab the nice cpu power for you aswell.the total *should* be 100%, but because of the rounding (all values are roundedto a max of 2 digits after the dot) there might be a little difference. the valuesare of type float.should work with multi-processor systems aswell.note: the method may take a while to return, because it has to wait until thefile with the cpu information (/proc/stat) has to be updated. see param$maxWaitTime.
|
| Parameter |
|
| integer |
$maxWaitTime |
= >>3000<< |
|
(time in milliseconds, default is 3000.) |
|
| Returns |
array (hash, see above) |
| Throws |
bool FALSE if not capable (windows) |
|
getCpuAvailable |
|
public float getCpuAvailable( )
|
| |
returns the available cpu, that is idle+nice together.
it is the 'available' of getCpuStat() so look there.
|
| Returns |
float |
| See Also |
getCpuStat() |
|
getLoadAvg |
|
public array getLoadAvg( )
|
| |
returns information about the load average.
the returned vector has at least 3 elements. on the machine i tested it therewere 5, like this:ELEMENT VALUE DESCRIPTION0 1.79 load average of the last minute1 1.21 load average of the last 5 minutes2 1.12 load average of the last 15 minutes3 2/130 don't know4 28638 don't knowimo a load average of >5 is high. everything <2 is fine.
|
| Returns |
array (vector, see above) |
| Throws |
bool FALSE if not capable (windows) |
|
getSerial |
|
public string getSerial( )
|
| |
returns the serial number of the system.
example: 4f00000756496301
|
| Returns |
string |
| Throws |
bool FALSE if not capable (windows) |
|
Bs_System |
|
public void Bs_System( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
|
Private Method Details |
isWindows |
|
private bool isWindows( )
|
| |
Tells if we're on a winblows box.
|
| Returns |
bool |
|
getOsVersion |
|
private void getOsVersion( )
|
| |
|
| Returns |
void |
|
systemCheckup |
|
private void systemCheckup( )
|
| |
Do some system checks
- check for full disks/devices- high load times?- low memory?
|
| Returns |
void |
|
getUptime |
|
private void getUptime( )
|
| |
is this possible on winblows at all?
|
| Returns |
void |
|
getCpuInfo |
|
private void getCpuInfo( )
|
| |
|
| Returns |
void |
|
getVersion |
|
private void getVersion( )
|
| |
|
| Returns |
void |
|
_getCpuStat_readData |
|
private void _getCpuStat_readData( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
_getCpuStat_fileChanged |
|
private void _getCpuStat_fileChanged( $compareTimestamp, $maxWaitTime )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$compareTimestamp |
|
|
Warning: documentation is missing. |
|
|
|
$maxWaitTime |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
getMemory |
|
private void getMemory( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
|
Private Field Details |
$_Bs_String |
|
private unknown $_Bs_String
>><<
|
|
$_isWindows |
|
private unknown $_isWindows
>><<
|
|
|
Private Constant Details |
BS_SYSTEM_VERSION
define( BS_SYSTEM_VERSION, >>4.0.$x$<< )
Case: default: case sensitive
|
|
|
|
|
|
| PHPDoc 1.0beta |