mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Updated
This commit is contained in:
parent
bbcb50d46a
commit
e56ebf6754
@ -25,7 +25,15 @@ function tracker_exit ()
|
|||||||
$str[] = sprintf('%.4f'. LOG_SEPR .'%02d%%', $DBS->sql_inittime, $sql_init_perc);
|
$str[] = sprintf('%.4f'. LOG_SEPR .'%02d%%', $DBS->sql_inittime, $sql_init_perc);
|
||||||
$str[] = sprintf('%.4f'. LOG_SEPR .'%02d%%', $DBS->sql_timetotal, $sql_total_perc);
|
$str[] = sprintf('%.4f'. LOG_SEPR .'%02d%%', $DBS->sql_timetotal, $sql_total_perc);
|
||||||
$str[] = $DBS->num_queries;
|
$str[] = $DBS->num_queries;
|
||||||
$str[] = sprintf('%.1f', sys('la'));
|
if ($l = sys('la'))
|
||||||
|
{
|
||||||
|
$l = explode(' ', $l);
|
||||||
|
for ($i=0; $i < 3; $i++)
|
||||||
|
{
|
||||||
|
$l[$i] = round($l[$i], 1);
|
||||||
|
}
|
||||||
|
$str[] = "loadavg: $l[0] $l[1] $l[2]";
|
||||||
|
}
|
||||||
$str = join(LOG_SEPR, $str) . LOG_LF;
|
$str = join(LOG_SEPR, $str) . LOG_LF;
|
||||||
dbg_log($str, '!!gentime');
|
dbg_log($str, '!!gentime');
|
||||||
}
|
}
|
||||||
@ -414,7 +422,15 @@ class sql_db
|
|||||||
$msg = round($this->sql_starttime) . LOG_SEPR;
|
$msg = round($this->sql_starttime) . LOG_SEPR;
|
||||||
$msg .= date('m-d H:i:s', $this->sql_starttime) . LOG_SEPR;
|
$msg .= date('m-d H:i:s', $this->sql_starttime) . LOG_SEPR;
|
||||||
$msg .= sprintf('%-6s', $q_time);
|
$msg .= sprintf('%-6s', $q_time);
|
||||||
$msg .= LOG_SEPR . sprintf('%-4s', round(sys('la'), 1));
|
if ($l = sys('la'))
|
||||||
|
{
|
||||||
|
$l = explode(' ', $l);
|
||||||
|
for ($i=0; $i < 3; $i++)
|
||||||
|
{
|
||||||
|
$l[$i] = round($l[$i], 1);
|
||||||
|
}
|
||||||
|
$msg .= LOG_SEPR . "loadavg: $l[0] $l[1] $l[2]";
|
||||||
|
}
|
||||||
$msg .= LOG_SEPR . sprintf('%05d', getmypid());
|
$msg .= LOG_SEPR . sprintf('%05d', getmypid());
|
||||||
$msg .= LOG_SEPR . $this->db_server;
|
$msg .= LOG_SEPR . $this->db_server;
|
||||||
$msg .= LOG_SEPR . str_compact($this->cur_query);
|
$msg .= LOG_SEPR . str_compact($this->cur_query);
|
||||||
|
@ -855,7 +855,15 @@ class sql_db
|
|||||||
$msg[] = round($this->sql_starttime);
|
$msg[] = round($this->sql_starttime);
|
||||||
$msg[] = date('m-d H:i:s', $this->sql_starttime);
|
$msg[] = date('m-d H:i:s', $this->sql_starttime);
|
||||||
$msg[] = sprintf('%-6s', $q_time);
|
$msg[] = sprintf('%-6s', $q_time);
|
||||||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
if ($l = sys('la'))
|
||||||
|
{
|
||||||
|
$l = explode(' ', $l);
|
||||||
|
for ($i=0; $i < 3; $i++)
|
||||||
|
{
|
||||||
|
$l[$i] = round($l[$i], 1);
|
||||||
|
}
|
||||||
|
$msg[] = "loadavg: $l[0] $l[1] $l[2]";
|
||||||
|
}
|
||||||
$msg[] = sprintf('%05d', getmypid());
|
$msg[] = sprintf('%05d', getmypid());
|
||||||
$msg[] = $this->db_server;
|
$msg[] = $this->db_server;
|
||||||
$msg[] = short_query($this->cur_query);
|
$msg[] = short_query($this->cur_query);
|
||||||
|
@ -48,7 +48,15 @@ foreach ($cron_jobs as $job)
|
|||||||
$msg[] = 'start';
|
$msg[] = 'start';
|
||||||
$msg[] = date('m-d');
|
$msg[] = date('m-d');
|
||||||
$msg[] = date('H:i:s');
|
$msg[] = date('H:i:s');
|
||||||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
if ($l = sys('la'))
|
||||||
|
{
|
||||||
|
$l = explode(' ', $l);
|
||||||
|
for ($i=0; $i < 3; $i++)
|
||||||
|
{
|
||||||
|
$l[$i] = round($l[$i], 1);
|
||||||
|
}
|
||||||
|
$msg[] = "loadavg: $l[0] $l[1] $l[2]";
|
||||||
|
}
|
||||||
$msg[] = sprintf('%05d', getmypid());
|
$msg[] = sprintf('%05d', getmypid());
|
||||||
$msg[] = $job['cron_title'];
|
$msg[] = $job['cron_title'];
|
||||||
$msg = join(LOG_SEPR, $msg);
|
$msg = join(LOG_SEPR, $msg);
|
||||||
@ -75,7 +83,15 @@ foreach ($cron_jobs as $job)
|
|||||||
$msg[] = ' end';
|
$msg[] = ' end';
|
||||||
$msg[] = date('m-d');
|
$msg[] = date('m-d');
|
||||||
$msg[] = date('H:i:s');
|
$msg[] = date('H:i:s');
|
||||||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
if ($l = sys('la'))
|
||||||
|
{
|
||||||
|
$l = explode(' ', $l);
|
||||||
|
for ($i=0; $i < 3; $i++)
|
||||||
|
{
|
||||||
|
$l[$i] = round($l[$i], 1);
|
||||||
|
}
|
||||||
|
$msg[] = "loadavg: $l[0] $l[1] $l[2]";
|
||||||
|
}
|
||||||
$msg[] = sprintf('%05d', getmypid());
|
$msg[] = sprintf('%05d', getmypid());
|
||||||
$msg[] = round(utime() - $cron_start_time) .'/'. round(utime() - TIMESTART) . ' sec';
|
$msg[] = round(utime() - $cron_start_time) .'/'. round(utime() - TIMESTART) . ' sec';
|
||||||
$msg = join(LOG_SEPR, $msg);
|
$msg = join(LOG_SEPR, $msg);
|
||||||
@ -126,4 +142,4 @@ foreach ($cron_jobs as $job)
|
|||||||
$cron_err_msg = "Can not run \"{$job['cron_title']}\" : file \"$job_script\" not found". LOG_LF;
|
$cron_err_msg = "Can not run \"{$job['cron_title']}\" : file \"$job_script\" not found". LOG_LF;
|
||||||
bb_log($cron_err_msg, 'cron_error');
|
bb_log($cron_err_msg, 'cron_error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user