Source
$start_time = 'INSERT INTO events (eventid, objectid, clock, value) VALUES (%1$d, %2$d, %3$d, '.TRIGGER_VALUE_TRUE.')';
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__).'/../include/CLegacyWebTest.php';
use Facebook\WebDriver\WebDriverBy;
/**
* @backup events
*/
class testPageAvailabilityReport extends CLegacyWebTest {
/**
* SLA calculated events data in format: triggerid, starttime, duration.
* Triggers created via import of data/data_test.sql
* @var array
*/
public static $SLA_events = [
[100001, '01.01.2016 00:00:00', '+1 second'],
[100001, '01.01.2017 22:59:00', '+1 hour 59 second'],
[100001, '02.01.2017 22:50:00', '+1 hour 11 minutes'],
[100002, '01.01.2017 22:59:10', '+1 hour 5 minutes 59 second'],
[100002, '10.10.2017 00:00:00', '+1 second'],
[100002, '31.12.2017 22:00:00', '+1 hour'],
[100003, '31.12.2017 23:00:00', '+1 hour']
];
/**
* Data provider for testPageAvailabilityReportSLA. Array have following schema:
* - SLA availability report filter start time
* - SLA availability report filter end time
* - SLA availability report result table row values. Only 3 first cells of every row are defined.
*
* @return array
*/
public function dataProviderSLA() {
return [
['01.01.2016 00:00:00', '30.01.2016 00:00:00', [
['A trigger', '', '100.0000%'],
['B trigger', '', '100.0000%'],
['C trigger', '', '100.0000%']
]],
['01.01.2016 00:00:00', '20.01.2016 00:00:00', [
['A trigger', '0.0001%', '99.9999%'],
['B trigger', '', '100.0000%'],
['C trigger', '', '100.0000%']