Merge pull request #3247 from mdetrano/feature/improve-eventgrid-performance-12732

Improve Event Grid performance
This commit is contained in:
Johannes Meyer 2019-05-24 07:53:21 +02:00 committed by GitHub
commit a063cc9dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 1 deletions

View File

@ -361,13 +361,16 @@ class ListController extends Controller
);
$orientationBox->applyRequest($this->getRequest());
*/
$objectType = $form->getValue('objecttype');
$from = $form->getValue('from');
$query = $this->backend->select()->from(
'eventgrid',
'eventgrid' . $objectType,
array('day', $form->getValue('state'))
);
$this->params->remove(array('objecttype', 'from', 'to', 'state', 'btn_submit'));
$this->view->filter = Filter::fromQuerystring((string) $this->params);
$query->applyFilter($this->view->filter);
$query->applyFilter(Filter::fromQuerystring('timestamp >= ' . $from));
$this->applyRestriction('monitoring/filter/objects', $query);
$this->view->summary = $query;
$this->view->column = $form->getValue('state');

View File

@ -0,0 +1,16 @@
<?php
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
class EventgridhostsQuery extends EventgridQuery
{
/**
* Join history related columns and tables, hosts only
*/
protected function joinHistory()
{
$this->fetchHistoryColumns = true;
$this->requireVirtualTable('hosts');
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
class EventgridservicesQuery extends EventgridQuery
{
/**
* Join history related columns and tables, services only
*/
protected function joinHistory()
{
$this->fetchHistoryColumns = true;
$this->requireVirtualTable('services');
}
}

View File

@ -0,0 +1,7 @@
<?php
namespace Icinga\Module\Monitoring\DataView;
class Eventgridhosts extends Eventgrid
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace Icinga\Module\Monitoring\DataView;
class Eventgridservices extends Eventgrid
{
}