2011-05-10 Ramon Novoa <rnovoa@artica.es>

* include/functions_reporting.php: Do not count the empty start of an
	  interval as 0 (affects AVG and SLA).



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4329 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2011-05-10 10:57:28 +00:00
parent 4d1ee91c4e
commit 6f69b11d14
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-05-10 Ramon Novoa <rnovoa@artica.es>
* include/functions_reporting.php: Do not count the empty start of an
interval as 0 (affects AVG and SLA).
2011-05-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_visual_map.php

View File

@ -102,6 +102,11 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period, $dat
$count = 0;
if (! $uncompressed_module) {
$previous_data = array_shift ($interval_data);
// Do not count the empty start of an interval as 0
if ($previous_data['utimestamp'] != $datelimit) {
$period = $date - $previous_data['utimestamp'];
}
}
foreach ($interval_data as $data) {
if (! $uncompressed_module) {
@ -488,6 +493,12 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, $min_valu
// Set initial conditions
$bad_period = 0;
$first_data = array_shift ($interval_data);
// Do not count the empty start of an interval as 0
if ($first_data['utimestamp'] != $datelimit) {
$period = $date - $first_data['utimestamp'];
}
$previous_utimestamp = $first_data['utimestamp'];
if ((($max_value > $min_value AND ($first_data['datos'] > $max_value OR $first_data['datos'] < $min_value))) OR
($max_value <= $min_value AND $first_data['datos'] < $min_value)) {