Changeset 44 for trunk/Application/Model
- Timestamp:
- Nov 24, 2009, 5:19:21 PM (15 years ago)
- Location:
- trunk/Application/Model/Measurement
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Model/Measurement/MeasureClient.php
r43 r44 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../../Base/Model.php'); 2 4 3 5 class MeasureClient extends Model … … 8 10 while($MeasureClient = $DbResult->fetch_assoc()) 9 11 { 10 if(class_exists($MeasureClient['MeasureClass'])) 12 $DbResult2 = $this->Database->select('MeasureMethod', '*', 'Id='.$MeasureClient['Method']); 13 $MeasureMethod = $DbResult2->fetch_assoc(); 14 echo($MeasureClient['MeasureId'].','); 15 include_once(dirname(__FILE__).'/'.$MeasureMethod['MeasureClass'].'.php'); 16 $MeasureMethod['MeasureClass'] .= 'Measurement'; 17 if(class_exists($MeasureMethod['MeasureClass'])) 11 18 { 12 $MeasureClass = new $Measure Client['MeasureClass']();13 if(method_exists($MeasureClass, $Measure Class['Method']))19 $MeasureClass = new $MeasureMethod['MeasureClass']($this->System); 20 if(method_exists($MeasureClass, $MeasureMethod['Method'])) 14 21 { 15 if($MeasureClient['Parameter'] != '') $Value = $Measure->$MeasureClient['Method']($MeasureClient['Parameter']); 16 else $Value = $Measure->$MeasureClient['Method'](); 17 file_get_contents($MeasureClient['Host'].$MeasureClient['Path'].'/?MeasureId='.$MeasureClient['MeasureId'].'&Value='.addslashes($Value)); 18 } else echo('Metoda '.$MeasureClient['Method'].' neexistuje.'); 19 } else echo('Třída '.$MeasureClient['MeasureClass'].' neexistuje.'); 20 22 if($MeasureClient['Parameter'] != '') $Value = $Measure->$MeasureMethod['Method']($MeasureClient['Parameter']); 23 else $Value = $MeasureClass->$MeasureMethod['Method'](); 24 echo(file_get_contents('http://'.$MeasureClient['Host'].$MeasureClient['Path'].'/?M=Add&MeasureId='.$MeasureClient['MeasureId'].'&Value='.addslashes($Value))); 25 } else echo('Metoda '.$MeasureMethod['Method'].' neexistuje.'); 26 } else echo('Třída '.$MeasureMethod['MeasureClass'].' neexistuje.'); 21 27 } 22 28 } -
trunk/Application/Model/Measurement/System.php
r43 r44 2 2 3 3 // Funkce pro získání stavových informací o systému 4 5 function ErrorHandler($errno,$errmsg,$filename,$linenum,$vars)6 {7 }8 4 9 5 include_once(dirname(__FILE__).'/Measurement.php'); … … 54 50 } 55 51 56 function C puUsage()52 function CPUUsage() 57 53 { 58 54 $CpuStateFileName = '/tmp/LastCpuUsage'; 59 $LastCpuUsage = unserializ a(file_get_contents($CpuStateFileName));55 $LastCpuUsage = unserialize(file_get_contents($CpuStateFileName)); 60 56 //$cpuIDLEprev, $cpuSYSTprev, $cpuUSERprev; 61 57
Note:
See TracChangeset
for help on using the changeset viewer.