mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Collection and output of db and snmp stats (#5049)
This commit is contained in:
committed by
Neil Lathwood
parent
6708c7cb81
commit
db240cb4eb
@@ -15,7 +15,6 @@ $init_modules = array('discovery');
|
||||
require __DIR__ . '/includes/init.php';
|
||||
|
||||
$start = microtime(true);
|
||||
$runtime_stats = array();
|
||||
$sqlparams = array();
|
||||
$options = getopt('h:m:i:n:d::v::a::q', array('os:','type:'));
|
||||
|
||||
@@ -133,8 +132,7 @@ $string = $argv[0]." $doing ".date($config['dateformat']['compact'])." - $discov
|
||||
d_echo("$string\n");
|
||||
|
||||
if (!isset($options['q'])) {
|
||||
echo ('MySQL: Cell['.($db_stats['fetchcell'] + 0).'/'.round(($db_stats['fetchcell_sec'] + 0), 2).'s]'.' Row['.($db_stats['fetchrow'] + 0).'/'.round(($db_stats['fetchrow_sec'] + 0), 2).'s]'.' Rows['.($db_stats['fetchrows'] + 0).'/'.round(($db_stats['fetchrows_sec'] + 0), 2).'s]'.' Column['.($db_stats['fetchcol'] + 0).'/'.round(($db_stats['fetchcol_sec'] + 0), 2).'s]'.' Update['.($db_stats['update'] + 0).'/'.round(($db_stats['update_sec'] + 0), 2).'s]'.' Insert['.($db_stats['insert'] + 0).'/'.round(($db_stats['insert_sec'] + 0), 2).'s]'.' Delete['.($db_stats['delete'] + 0).'/'.round(($db_stats['delete_sec'] + 0), 2).'s]');
|
||||
echo "\n";
|
||||
printStats();
|
||||
}
|
||||
|
||||
logfile($string);
|
||||
|
Reference in New Issue
Block a user