Remove perf_times table (#12517)
the data is never used... This type of data is better to store in rrd anyway
This commit is contained in:
parent
4126663b3a
commit
0d61deb8f0
|
@ -103,11 +103,6 @@ if ($options['f'] === 'authlog') {
|
|||
exit($ret);
|
||||
}
|
||||
|
||||
if ($options['f'] === 'perf_times') {
|
||||
$ret = lock_and_purge('perf_times', 'start < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL ? DAY))');
|
||||
exit($ret);
|
||||
}
|
||||
|
||||
if ($options['f'] === 'callback') {
|
||||
include_once 'includes/callback.php';
|
||||
}
|
||||
|
|
1
daily.sh
1
daily.sh
|
@ -379,7 +379,6 @@ main () {
|
|||
"syslog"
|
||||
"eventlog"
|
||||
"authlog"
|
||||
"perf_times"
|
||||
"callback"
|
||||
"device_perf"
|
||||
"purgeusers"
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RemovePerfTimes extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::drop('perf_times');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::create('perf_times', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('type', 8)->index();
|
||||
$table->string('doing', 64);
|
||||
$table->unsignedInteger('start');
|
||||
$table->float('duration');
|
||||
$table->unsignedInteger('devices');
|
||||
$table->string('poller');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -121,14 +121,6 @@ $run = ($end - $start);
|
|||
$proctime = substr($run, 0, 5);
|
||||
|
||||
if ($discovered_devices) {
|
||||
dbInsert([
|
||||
'type' => 'discover',
|
||||
'doing' => $doing,
|
||||
'start' => $start,
|
||||
'duration' => $proctime,
|
||||
'devices' => $discovered_devices,
|
||||
'poller' => \LibreNMS\Config::get('distributed_poller_name'),
|
||||
], 'perf_times');
|
||||
if ($doing === 'new') {
|
||||
// We have added a new device by this point so we might want to do some other work
|
||||
oxidized_reload_nodes();
|
||||
|
|
|
@ -17,7 +17,6 @@ Cleanup Options are set in ```config.php```
|
|||
$config['syslog_purge'] = 30;
|
||||
$config['eventlog_purge'] = 30;
|
||||
$config['authlog_purge'] = 30;
|
||||
$config['perf_times_purge'] = 30;
|
||||
$config['device_perf_purge'] = 7;
|
||||
$config['rrd_purge'] = 90;// Not set by default
|
||||
$config['ports_purge'] = true;// Set to false by default
|
||||
|
|
|
@ -824,7 +824,6 @@ These options rely on daily.sh running from cron as per the installation instruc
|
|||
$config['syslog_purge'] = 30;
|
||||
$config['eventlog_purge'] = 30;
|
||||
$config['authlog_purge'] = 30;
|
||||
$config['perf_times_purge'] = 30;
|
||||
$config['device_perf_purge'] = 7;
|
||||
$config['alert_log_purge'] = 365;
|
||||
$config['port_fdb_purge'] = 10;
|
||||
|
|
|
@ -4128,13 +4128,6 @@
|
|||
"value": "integer|between:0,100"
|
||||
}
|
||||
},
|
||||
"perf_times_purge": {
|
||||
"default": 30,
|
||||
"group": "system",
|
||||
"section": "cleanup",
|
||||
"order": 6,
|
||||
"type": "integer"
|
||||
},
|
||||
"permission.device_group.allow_dynamic": {
|
||||
"default": false,
|
||||
"group": "authorization",
|
||||
|
|
|
@ -1309,18 +1309,6 @@ pdb_ix_peers:
|
|||
- { Field: timestamp, Type: 'int unsigned', 'Null': true, Extra: '' }
|
||||
Indexes:
|
||||
PRIMARY: { Name: PRIMARY, Columns: [pdb_ix_peers_id], Unique: true, Type: BTREE }
|
||||
perf_times:
|
||||
Columns:
|
||||
- { Field: id, Type: 'int unsigned', 'Null': false, Extra: auto_increment }
|
||||
- { Field: type, Type: varchar(8), 'Null': false, Extra: '' }
|
||||
- { Field: doing, Type: varchar(64), 'Null': false, Extra: '' }
|
||||
- { Field: start, Type: 'int unsigned', 'Null': false, Extra: '' }
|
||||
- { Field: duration, Type: 'double(8,2)', 'Null': false, Extra: '' }
|
||||
- { Field: devices, Type: 'int unsigned', 'Null': false, Extra: '' }
|
||||
- { Field: poller, Type: varchar(255), 'Null': false, Extra: '' }
|
||||
Indexes:
|
||||
PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE }
|
||||
perf_times_type_index: { Name: perf_times_type_index, Columns: [type], Unique: false, Type: BTREE }
|
||||
plugins:
|
||||
Columns:
|
||||
- { Field: plugin_id, Type: 'int unsigned', 'Null': false, Extra: auto_increment }
|
||||
|
|
|
@ -151,14 +151,6 @@ $poller_end = microtime(true);
|
|||
$poller_run = ($poller_end - $poller_start);
|
||||
$poller_time = substr($poller_run, 0, 5);
|
||||
|
||||
dbInsert([
|
||||
'type' => 'pollbill',
|
||||
'doing' => $doing,
|
||||
'start' => $poller_start,
|
||||
'duration' => $poller_time,
|
||||
'devices' => 0,
|
||||
'poller' => \LibreNMS\Config::get('distributed_poller_name'),
|
||||
], 'perf_times');
|
||||
if ($poller_time > 300) {
|
||||
logfile("BILLING: polling took longer than 5 minutes ($poller_time seconds)!");
|
||||
}
|
||||
|
|
11
poller.php
11
poller.php
|
@ -160,17 +160,6 @@ $poller_end = microtime(true);
|
|||
$poller_run = ($poller_end - $poller_start);
|
||||
$poller_time = substr($poller_run, 0, 5);
|
||||
|
||||
if ($polled_devices) {
|
||||
dbInsert([
|
||||
'type' => 'poll',
|
||||
'doing' => $doing,
|
||||
'start' => $poller_start,
|
||||
'duration' => $poller_time,
|
||||
'devices' => $polled_devices,
|
||||
'poller' => Config::get('base_url'),
|
||||
], 'perf_times');
|
||||
}
|
||||
|
||||
$string = $argv[0] . " $doing " . date(Config::get('dateformat.compact')) . " - $polled_devices devices polled in $poller_time secs";
|
||||
d_echo("$string\n");
|
||||
|
||||
|
|
|
@ -578,10 +578,6 @@ return [
|
|||
'help' => 'Aktiviere PeeringDB lookup (Daten werden mit daily.sh heruntergeladen)',
|
||||
],
|
||||
],
|
||||
'perf_times_purge' => [
|
||||
'description' => 'Poller Performanz Daten älter als (Tage)',
|
||||
'help' => 'Bereinigung wird erledigt durch daily.sh',
|
||||
],
|
||||
'ping' => [
|
||||
'description' => 'Pfad zu ping',
|
||||
],
|
||||
|
|
|
@ -957,10 +957,6 @@ return [
|
|||
'help' => 'Enable PeeringDB lookup (data is downloaded with daily.sh)',
|
||||
],
|
||||
],
|
||||
'perf_times_purge' => [
|
||||
'description' => 'Poller performance log entries older than (days)',
|
||||
'help' => 'Cleanup done by daily.sh',
|
||||
],
|
||||
'permission' => [
|
||||
'device_group' => [
|
||||
'allow_dynamic' => [
|
||||
|
|
|
@ -752,10 +752,6 @@ return [
|
|||
'help' => 'Les données sont mises à jour via daily.sh',
|
||||
],
|
||||
],
|
||||
'perf_times_purge' => [
|
||||
'description' => 'Journaux de performances des sondeurs (jours)',
|
||||
'help' => 'Nettoyage effectué par daily.sh',
|
||||
],
|
||||
'permission' => [
|
||||
'device_group' => [
|
||||
'allow_dynamic' => [
|
||||
|
|
|
@ -868,10 +868,6 @@ return [
|
|||
'help' => 'Enable PeeringDB lookup (data is downloaded with daily.sh)',
|
||||
],
|
||||
],
|
||||
'perf_times_purge' => [
|
||||
'description' => 'Poller performance log entries older than (days)',
|
||||
'help' => 'Cleanup done by daily.sh',
|
||||
],
|
||||
'permission' => [
|
||||
'device_group' => [
|
||||
'allow_dynamic' => [
|
||||
|
|
|
@ -585,10 +585,6 @@ return [
|
|||
'help' => '起用 PeeringDB lookup (资料将于由 daily.sh 进行下载)',
|
||||
],
|
||||
],
|
||||
'perf_times_purge' => [
|
||||
'description' => '轮询器效能记录项目大于 (天)',
|
||||
'help' => 'Cleanup done by daily.sh',
|
||||
],
|
||||
'ping' => [
|
||||
'description' => 'ping 路径',
|
||||
],
|
||||
|
|
|
@ -658,10 +658,6 @@ return [
|
|||
'help' => '起用 PeeringDB lookup (資料將於由 daily.sh 進行下載)',
|
||||
],
|
||||
],
|
||||
'perf_times_purge' => [
|
||||
'description' => '輪詢器效能記錄項目大於 (天)',
|
||||
'help' => 'Cleanup done by daily.sh',
|
||||
],
|
||||
'permission' => [
|
||||
'device_group' => [
|
||||
'allow_dynamic' => [
|
||||
|
|
Loading…
Reference in New Issue