Changeset 874 for trunk/Modules/TimeMeasure
- Timestamp:
- Apr 6, 2020, 11:56:19 PM (5 years ago)
- Location:
- trunk/Modules/TimeMeasure
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/TimeMeasure/Graph.php
r873 r874 20 20 { 21 21 $this->ClearPage = true; 22 return ($this->Render());22 return $this->Render(); 23 23 } 24 24 -
trunk/Modules/TimeMeasure/Main.php
r873 r874 111 111 $Output .= '</form>'; 112 112 113 return ($Output);113 return $Output; 114 114 } 115 115 … … 179 179 180 180 $Output .= '<br/>'.$this->MeasureTable(); 181 return ($Output);181 return $Output; 182 182 } 183 183 … … 191 191 $Output .= '<a href="?Measure='.$_SESSION['Measure'].'&TimeStart='. 192 192 $_SESSION['TimeStart'].'&TimeEnd='.$_SESSION['TimeEnd'].'&TimeSpecify=1&Differential='.$_SESSION['Differential'].'">Odkaz na vybraný graf</a><br>'; 193 return ($Output);193 return $Output; 194 194 } 195 195 … … 260 260 //echo($PrefixMultiplier->Add('-0.000000071112345', 'B')); 261 261 $Output .= '</div>'; 262 return ($Output);262 return $Output; 263 263 } 264 264 } … … 271 271 272 272 $Output = ''; 273 if (!array_key_exists('MeasureId', $_GET)) return ('Nebylo zadáno Id měření.');274 if (!array_key_exists('Value', $_GET)) return ('Nebyla zadána hodnota.');273 if (!array_key_exists('MeasureId', $_GET)) return 'Nebylo zadáno Id měření.'; 274 if (!array_key_exists('Value', $_GET)) return 'Nebyla zadána hodnota.'; 275 275 $Measure = new Measure($this->System); 276 276 $Measure->Load($_GET['MeasureId']); 277 if (!isset($Measure->Data['Id'])) return ('Měření s Id '.$_GET['MeasureId'].' nenalezeno.');277 if (!isset($Measure->Data['Id'])) return 'Měření s Id '.$_GET['MeasureId'].' nenalezeno.'; 278 278 $Measure->AddValue(array('Min' => $_GET['Value'], 'Avg' => $_GET['Value'], 'Max' => $_GET['Value'])); 279 return ($Output);279 return $Output; 280 280 } 281 281 } -
trunk/Modules/TimeMeasure/Measure.php
r873 r874 25 25 function TimeSegment($Base, $Level) 26 26 { 27 return (pow($this->LevelReducing, $Level) * $Base);27 return pow($this->LevelReducing, $Level) * $Base; 28 28 } 29 29 30 30 function StatTableName($Level) 31 31 { 32 if ($Level == 0) return ('Data');33 else return ('DataCache');32 if ($Level == 0) return 'Data'; 33 else return 'DataCache'; 34 34 } 35 35 36 36 function AlignTime($Time, $TimeSegment) 37 37 { 38 return (round(($Time - $this->ReferenceTime) / $TimeSegment) * $TimeSegment + $this->ReferenceTime);38 return round(($Time - $this->ReferenceTime) / $TimeSegment) * $TimeSegment + $this->ReferenceTime; 39 39 } 40 40 … … 124 124 { 125 125 $Y = ($Y2 - $Y1) / ($X2 - $X1) * ($X - $X1) + $Y1; 126 return ($Y);126 return $Y; 127 127 } 128 128 … … 203 203 $NewValue['Avg'] = $NewValue['Avg'] / ($RightTime - $LeftTime); 204 204 } 205 return ($NewValue);205 return $NewValue; 206 206 } 207 207 … … 228 228 echo('AbsoluteRightTime: '.$AbsoluteRightTime.'('.TimeToMysqlDateTime($AbsoluteRightTime).')<br>'); 229 229 } 230 return (array('Left' => $AbsoluteLeftTime, 'Right' => $AbsoluteRightTime));230 return array('Left' => $AbsoluteLeftTime, 'Right' => $AbsoluteRightTime); 231 231 } 232 232 … … 239 239 $Row = $DbResult->fetch_assoc(); 240 240 $Row['Time'] = MysqlDateTimeToTime($Row['Time']); 241 return (array($Row));241 return array($Row); 242 242 } else 243 243 { … … 253 253 } 254 254 // if ($Debug) print_r($Result); 255 return ($Result);255 return $Result; 256 256 } 257 257 } … … 266 266 $Row = $DbResult->fetch_assoc(); 267 267 $Row['Time'] = MysqlDateTimeToTime($Row['Time']); 268 return (array($Row));268 return array($Row); 269 269 } else 270 270 { … … 280 280 array_push($Result, array('Time' => (MysqlDateTimeToTime($Row['Time']) - 10), 'Min' => 0, 'Avg' => 0, 'Max' => 0, 'Continuity' => 0)); 281 281 } 282 return ($Result);282 return $Result; 283 283 } 284 284 } … … 338 338 if ($this->Debug) print_r($Points); 339 339 } else $Points[] = array('Min' => 0, 'Avg' => 0, 'Max' => 0); 340 return ($Points);340 return $Points; 341 341 } 342 342 -
trunk/Modules/TimeMeasure/Measurement/System.php
r873 r874 14 14 { 15 15 fclose($Fp1); 16 return (TRUE);16 return TRUE; 17 17 } else 18 18 { 19 19 //echo($ERROR_NO.','.$ERROR_STR); 20 return (FALSE);20 return FALSE; 21 21 } 22 22 restore_error_handler(); … … 34 34 $Time = $Parts[7]; 35 35 $TimeParts = explode('=', $Time); 36 return ($TimeParts[1]);37 } else return (0);36 return $TimeParts[1]; 37 } else return 0; 38 38 } 39 39 … … 48 48 while (strpos($Row, ' ') !== false) $Row = str_replace(' ', ' ', $Row); 49 49 $RowParts2 = explode(' ', $Row); 50 return ($RowParts[2] + $RowParts2[2]);50 return $RowParts[2] + $RowParts2[2]; 51 51 } 52 52 … … 81 81 } 82 82 file_put_contents($CpuStateFileName, serialize($CpuUsage)); 83 return (100 - round($CpuUsagePercent['Idle'], 2));83 return 100 - round($CpuUsagePercent['Idle'], 2); 84 84 } 85 85 … … 114 114 } 115 115 file_put_contents($NetworkStateFile, serialize($NetworkState)); 116 return ($NetworkState);116 return $NetworkState; 117 117 } 118 118 … … 120 120 { 121 121 $NetworkState = $this->GetNetworkState(); 122 return ($NetworkState['Interface']['DownAverage']);122 return $NetworkState['Interface']['DownAverage']; 123 123 } 124 124 … … 126 126 { 127 127 $NetworkState = $this->GetNetworkState(); 128 return ($NetworkState['Interface']['UpAverage']);128 return $NetworkState['Interface']['UpAverage']; 129 129 } 130 130 … … 134 134 $Output = array(); 135 135 exec('cat /proc/net/nf_conntrack|grep "dst='.$HostIP.' "|grep "dport='.$Port.' "|grep "ASSURED"', $Output); 136 return (count($Output));136 return count($Output); 137 137 } 138 138 … … 145 145 $Parts = explode(' ', $Row); 146 146 $Value = str_replace(',', '.', $Parts[11]); 147 return ($Value);147 return $Value; 148 148 } 149 149 150 150 function DiskFree($Path) 151 151 { 152 return (disk_free_space($Path));152 return disk_free_space($Path); 153 153 } 154 154 … … 163 163 $Line = substr($Line, strpos($Line, '+') + 1); 164 164 $Line = substr($Line, 0, strpos($Line, '°')); 165 return ($Line);165 return $Line; 166 166 } 167 167 } 168 return (0);168 return 0; 169 169 } 170 170 … … 175 175 fclose($File); 176 176 $UptimeParts = explode(' ', $Uptime); 177 return ($UptimeParts[0]);177 return $UptimeParts[0]; 178 178 } 179 179 } -
trunk/Modules/TimeMeasure/Measurement/WoW.php
r873 r874 12 12 $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1'); 13 13 $Row = $DbResult->fetch_array(); 14 return ($Row[0]);14 return $Row[0]; 15 15 } 16 16 … … 20 20 $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0'); 21 21 $Row = $DbResult->fetch_array(); 22 return ($Row[0]);22 return $Row[0]; 23 23 } 24 24 … … 28 28 $DbResult = $Database->query('SELECT COUNT(*) FROM account'); 29 29 $Row = $DbResult->fetch_array(); 30 return ($Row[0]);30 return $Row[0]; 31 31 } 32 32 … … 36 36 $DbResult = $Database->query('SELECT COUNT(*) FROM guild'); 37 37 $Row = $DbResult->fetch_array(); 38 return ($Row[0]);38 return $Row[0]; 39 39 } 40 40 … … 44 44 $DbResult = $Database->query('SELECT COUNT(*) FROM `characters`'); 45 45 $Row = $DbResult->fetch_array(); 46 return ($Row[0]);46 return $Row[0]; 47 47 } 48 48 … … 52 52 $DbResult = $Database->query('SELECT COUNT(*) FROM uptime'); 53 53 $Row = $DbResult->fetch_array(); 54 return ($Row[0]);54 return $Row[0]; 55 55 } 56 56 57 57 function WoWEmulatorAvailability() 58 58 { 59 if (CheckPortStatus('localhost', 8085)) return (100); else return (0); 59 if (CheckPortStatus('localhost', 8085)) return 100; 60 else return 0; 60 61 } 61 62 … … 69 70 $Row = $DbResult->fetch_array(); 70 71 $Value = $Row[0]; 71 return ($Value);72 return $Value; 72 73 } 73 74 }
Note:
See TracChangeset
for help on using the changeset viewer.