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:
Tony Murray 2021-02-09 12:47:05 -06:00 committed by GitHub
parent 4126663b3a
commit 0d61deb8f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 36 additions and 78 deletions

View File

@ -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';
}

View File

@ -379,7 +379,6 @@ main () {
"syslog"
"eventlog"
"authlog"
"perf_times"
"callback"
"device_perf"
"purgeusers"

View File

@ -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');
});
}
}

View File

@ -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();

View File

@ -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

View File

@ -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;

View File

@ -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",

View File

@ -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 }

View File

@ -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)!");
}

View File

@ -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");

View File

@ -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',
],

View File

@ -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' => [

View File

@ -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' => [

View File

@ -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' => [

View File

@ -585,10 +585,6 @@ return [
'help' => '起用 PeeringDB lookup (资料将于由 daily.sh 进行下载)',
],
],
'perf_times_purge' => [
'description' => '轮询器效能记录项目大于 (天)',
'help' => 'Cleanup done by daily.sh',
],
'ping' => [
'description' => 'ping 路径',
],

View File

@ -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' => [