[IMPROVED] Statistics log format
This commit is contained in:
parent
e46036325c
commit
35910ef097
@ -25,27 +25,28 @@ chdir(dirname(__FILE__));
|
|||||||
// Include all settings and classes
|
// Include all settings and classes
|
||||||
require_once('shared.inc.php');
|
require_once('shared.inc.php');
|
||||||
|
|
||||||
|
// Header
|
||||||
|
$log->logInfo('Running statistical queries, errors may just mean no shares were available');
|
||||||
|
$strLogMask = "| %-26.26s | %8.8s | %-6.6s |";
|
||||||
|
$log->logInfo(sprintf($strLogMask, 'Method', 'Runtime', 'Status'));
|
||||||
|
|
||||||
// Per user share statistics based on all shares submitted
|
// Per user share statistics based on all shares submitted
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
if ( ! $statistics->getAllUserShares() )
|
$statistics->getAllUserShares() ? $status = 'OK' : $status = 'ERROR';
|
||||||
$log->logError('getAllUserShares update failed');
|
$log->logInfo(sprintf($strLogMask, 'getAllUserShares', number_format(microtime(true) - $start, 3), $status));
|
||||||
$log->logInfo("getAllUserShares " . number_format(microtime(true) - $start, 2) . " seconds");
|
|
||||||
|
|
||||||
// Get all user hashrate statistics for caching
|
// Get all user hashrate statistics for caching
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
if ( ! $statistics->getAllUserMiningStats() )
|
$statistics->getAllUserMiningStats() ? $status = 'OK' : $status = 'ERROR';
|
||||||
$log->logError('getAllUserMiningStats update failed');
|
$log->logInfo(sprintf($strLogMask, 'getAllUserMiningStats', number_format(microtime(true) - $start, 3), $status));
|
||||||
$log->logInfo("getAllUserMiningStats " . number_format(microtime(true) - $start, 2) . " seconds");
|
|
||||||
|
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
if (!$statistics->getTopContributors('hashes'))
|
$statistics->getTopContributors('hashes') ? $status = 'OK' : $status = 'ERROR';
|
||||||
$log->logError("getTopContributors hashes update failed");
|
$log->logInfo(sprintf($strLogMask, 'getTopContributors(hashes)', number_format(microtime(true) - $start, 3), $status));
|
||||||
$log->logInfo("getTopContributors hashes " . number_format(microtime(true) - $start, 2) . " seconds");
|
|
||||||
|
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
if (!$statistics->getCurrentHashrate())
|
$statistics->getCurrentHashrate() ? $status = 'OK' : $status = 'ERROR';
|
||||||
$log->logError("getCurrentHashrate update failed");
|
$log->logInfo(sprintf($strLogMask, 'getTopContributors(shares)', number_format(microtime(true) - $start, 3), $status));
|
||||||
$log->logInfo("getCurrentHashrate " . number_format(microtime(true) - $start, 2) . " seconds");
|
|
||||||
|
|
||||||
require_once('cron_end.inc.php');
|
require_once('cron_end.inc.php');
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user