From 57d6ae5c8bf17f9707c8830024b3e10112a0b222 Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Mon, 4 Apr 2016 15:43:51 +0900 Subject: [PATCH] Fix reporting format for exportdata - for 'data', timestamp should be timestamp of data - for 'avg', timestamp should be averaging period --- pandora_console/operation/agentes/exportdata.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index 5a9fdc7369..7c16ac5623 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -124,7 +124,7 @@ if (!empty ($export_btn) && !empty ($module)) { } $work_end = $end - $period + $work_period; - $work_start = $end - $work_period; + $work_start = $work_end - $work_period; //Buffer to get data, anyway this will report a memory exhaustin $flag_last_time_slice = false; @@ -166,7 +166,14 @@ if (!empty ($export_btn) && !empty ($module)) { $output .= $divider; $output .= $module['data']; $output .= $divider; - $output .= date ("Y-m-d G:i:s", $work_start ) . ' - ' . date ("Y-m-d G:i:s", $module['utimestamp']); + switch($export_type) { + case "data": + $output .= date("Y-m-d G:i:s", $module['utimestamp']); + break; + case "avg": + $output .= date ("Y-m-d G:i:s", $work_start) . ' - ' . date ("Y-m-d G:i:s", $work_end); + break; + } $output .= $rowend; } @@ -196,6 +203,7 @@ if (!empty ($export_btn) && !empty ($module)) { else { $work_end = $work_end + $work_period; } + $work_start = $work_end - $work_period; } unset ($output); $output = "";