mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-19 21:03:54 -07:00
Removed sys_getloadavg() (#1188)
This commit is contained in:
parent
8e5b0ff13e
commit
ff46ec48a4
8 changed files with 2 additions and 35 deletions
|
@ -9,7 +9,6 @@
|
|||
- Improved cookie management 🍪 [\#1171](https://github.com/torrentpier/torrentpier/pull/1171) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Replaced strpos() with simplified realization [\#1172](https://github.com/torrentpier/torrentpier/pull/1172) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Replaced some 'switch' with the 'match' expression [\#1173](https://github.com/torrentpier/torrentpier/pull/1173) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Replaced some time() with TIMENOW constant [\#1174](https://github.com/torrentpier/torrentpier/pull/1174) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Feature to ban specific torrent clients [\#1175](https://github.com/torrentpier/torrentpier/pull/1175) ([kovalensky](https://github.com/kovalensky))
|
||||
- Code re-formatting [\#1176](https://github.com/torrentpier/torrentpier/pull/1176) ([kovalensky](https://github.com/kovalensky))
|
||||
- Removed useless width for BBCode buttons [\#1180](https://github.com/torrentpier/torrentpier/pull/1180) ([belomaxorka](https://github.com/belomaxorka))
|
||||
|
|
|
@ -38,14 +38,6 @@ foreach ($sql as $i => $query) {
|
|||
echo '</table>';
|
||||
echo '<div align="center"><pre>';
|
||||
|
||||
if ($l = sys('la')) {
|
||||
$l = explode(' ', $l);
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$l[$i] = round($l[$i], 1);
|
||||
}
|
||||
echo "\n\n<b>loadavg: </b>$l[0] $l[1] $l[2]\n\n";
|
||||
}
|
||||
|
||||
echo 'gen time: <b>' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . "</b> sec\n";
|
||||
|
||||
echo '</pre></div>';
|
||||
|
|
|
@ -174,14 +174,6 @@ echo '</table>';
|
|||
echo !$client_full ? '<p style = "text-align:right;">Simple stats for clients are being cached for one hour.</p>' : '';
|
||||
echo '<div align="center"><pre>';
|
||||
|
||||
if ($l = sys('la')) {
|
||||
$l = explode(' ', $l);
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$l[$i] = round($l[$i], 1);
|
||||
}
|
||||
echo "\n\n<b>loadavg: </b>$l[0] $l[1] $l[2]\n\n";
|
||||
}
|
||||
|
||||
echo 'gen time: <b>' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . "</b> sec\n";
|
||||
echo '</pre></div>';
|
||||
echo '</body></html>';
|
||||
|
|
|
@ -334,18 +334,13 @@ function hide_bb_path(string $path): string
|
|||
return ltrim(str_replace(BB_PATH, '', $path), '/\\');
|
||||
}
|
||||
|
||||
function sys($param)
|
||||
function sys(string $param)
|
||||
{
|
||||
switch ($param) {
|
||||
case 'la':
|
||||
return function_exists('sys_getloadavg') ? implode(' ', sys_getloadavg()) : 0;
|
||||
break;
|
||||
case 'mem':
|
||||
return memory_get_usage();
|
||||
break;
|
||||
case 'mem_peak':
|
||||
return memory_get_peak_usage();
|
||||
break;
|
||||
default:
|
||||
trigger_error("invalid param: $param", E_USER_ERROR);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,6 @@ foreach ($cron_jobs as $job) {
|
|||
$msg[] = 'start';
|
||||
$msg[] = date('m-d');
|
||||
$msg[] = date('H:i:s');
|
||||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
||||
$msg[] = sprintf('%05d', getmypid());
|
||||
$msg[] = $job['cron_title'];
|
||||
$msg = implode(LOG_SEPR, $msg);
|
||||
|
@ -78,7 +77,6 @@ foreach ($cron_jobs as $job) {
|
|||
$msg[] = ' end';
|
||||
$msg[] = date('m-d');
|
||||
$msg[] = date('H:i:s');
|
||||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
||||
$msg[] = sprintf('%05d', getmypid());
|
||||
$msg[] = round(utime() - $cron_start_time) . '/' . round(utime() - TIMESTART) . ' sec';
|
||||
$msg = implode(LOG_SEPR, $msg);
|
||||
|
|
|
@ -53,14 +53,6 @@ if ($show_dbg_info) {
|
|||
$stat .= humn_size(sys('mem_peak'), 2) . ' / ';
|
||||
$stat .= humn_size(sys('mem'), 2);
|
||||
|
||||
if ($l = sys('la')) {
|
||||
$l = explode(' ', $l);
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$l[$i] = round($l[$i], 1);
|
||||
}
|
||||
$stat .= " | " . $lang['LIMIT'] . " $l[0] $l[1] $l[2]";
|
||||
}
|
||||
|
||||
$stat .= ' ]';
|
||||
|
||||
if (SQL_DEBUG) {
|
||||
|
|
|
@ -891,7 +891,6 @@ class SqlDb
|
|||
$msg[] = round($this->sql_starttime);
|
||||
$msg[] = date('m-d H:i:s', $this->sql_starttime);
|
||||
$msg[] = sprintf('%-6s', $q_time);
|
||||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
||||
$msg[] = sprintf('%05d', getmypid());
|
||||
$msg[] = $this->db_server;
|
||||
$msg[] = Dev::short_query($this->cur_query);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue