Changeset 44 for trunk/Application
- Timestamp:
- Nov 24, 2009, 5:19:21 PM (15 years ago)
- Location:
- trunk/Application
- Files:
-
- 1 added
- 3 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 -
trunk/Application/View/Main.php
r43 r44 206 206 if($Measure['Info'] == '') $Measure['Info'] = ' '; 207 207 $GenerationTime = floor(($this->System->GetMicrotime() - $StopWatchStart) * 1000 ) / 1000; 208 $Output .= '<tr><td><a href="?Measure='.$Measure['Id'].'&Differential=0">'.$Measure[' Description'].'</a></td><td align="center">'.$LastMeasureValue.'</td><td align="center">'.$LastMeasureTime.'</td><td align="center">'.$Interpolate.'</td><td>'.$Measure['Info'].'</td>';208 $Output .= '<tr><td><a href="?Measure='.$Measure['Id'].'&Differential=0">'.$Measure['Name'].'</a></td><td align="center">'.$LastMeasureValue.'</td><td align="center">'.$LastMeasureTime.'</td><td align="center">'.$Interpolate.'</td><td>'.$Measure['Description'].'</td>'; 209 209 if(array_key_exists('Debug', $_GET)) $Output .= '<td>'.$RowCount.'</td><td>'.$GenerationTime.'</td>'; 210 210 $Output .= '</tr>';
Note:
See TracChangeset
for help on using the changeset viewer.