Bug 1283618

Summary: Uptime of host report does not report minutes correctly
Product: [Retired] ovirt-engine-reports Reporter: Lukas Svaty <lsvaty>
Component: ReportsAssignee: Shirly Radco <sradco>
Status: CLOSED NOTABUG QA Contact: Lukas Svaty <lsvaty>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: bugs, lsvaty, ylavi
Target Milestone: ovirt-3.6.2Flags: ylavi: ovirt-3.6.z?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: reports
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-20 12:33:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Reports RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
BR8 none

Description Lukas Svaty 2015-11-19 12:38:45 UTC
Created attachment 1096668 [details]
BR8

Description of problem:
In report regarding uptime of hosts uptime is displayed as hours and minutes, however minutes are all the time 0. And the uptime is moving only by hours.

Version-Release number of selected component (if applicable):
rhevm-reports-3.6.0-0.7.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Go to WA portal, hosts tab
2. Show report -> Single Host Uptime (BR8)
3. See minutes of report

Actual results:
11h 0m
12h 0m
13h 0m

Expected results:
11h 23m or just 11h.
Either display minutes correctly or remove 0m.

Comment 1 Shirly Radco 2015-11-22 09:13:20 UTC
Hi,

Since this does not reproduce in my environment, please help me to debug your report or give me access to the machine.

You can use https://wiki.icinga.org/display/howtos/Debugging+JasperServer
and follow step 2 (move sql query and input control values to DEBUG) and 3. 
Then run the sql query from the jasperserver.log and replace the ? with corresponding input control values.

Let me know what value you get for uptime_mins.

Comment 2 Red Hat Bugzilla Rules Engine 2015-11-24 11:48:50 UTC
This bug is not marked for z-stream, yet the milestone is for a z-stream version, therefore the milestone has been reset.
Please set the correct milestone or add the z-stream flag.

Comment 3 Red Hat Bugzilla Rules Engine 2015-11-27 05:43:35 UTC
This bug is not marked for z-stream, yet the milestone is for a z-stream version, therefore the milestone has been reset.
Please set the correct milestone or add the z-stream flag.

Comment 4 Lukas Svaty 2015-11-30 12:50:50 UTC
Minutes seems to be moved only by 60, which causes time to be in hours and no minutes.

 planned_downtime_mins | unplanned_downtime_mins | uptime_mins | total  
-----------------------+-------------------------+-------------+--------
                     0 |                       0 |      720.00 | 720.00

Comment 5 Shirly Radco 2015-11-30 13:19:56 UTC
How are testing this?
Did you stop the host for a while and then restarted it
and checked the data after a few days?

Can I log into your test env?

Comment 6 Lukas Svaty 2015-11-30 13:29:32 UTC
Test scenario:
Start DEBUG logs as per comment#2
Restart reportsd (just in case)
In webadmin portal rightclick host and show Uptime report.
Run sql command with 's/\?/$input_value/'
See output in comment#2

Setup used:
Hosts were in engine ~2 weeks, engine is older upgraded from older versions. 
So I believe whole uptime_mins is measured incorrectly as hosts are in engine longer.

I'll send you login credentials to the engine via email.

Comment 7 Lukas Svaty 2015-12-01 14:09:45 UTC
After some investigation with Shirley:

Report is working correctly however problem is within the difference in aggregation timing and displaying of time.

In report obviously it is possible to display time like:
Uptime today: 5m
Downtime today: 12h55

When it's currently 13:00 that would be specific for today and it is displaying correct values. 

However as aggregation of data which report BR8 is using is run hourly so the same 5m and 12h55, would be displayed if there would be at the moment 13:55 (in some cases even 14:05 as aggregation might be late for some reason ?!?) 

I believe this is working by design, but the design is not really user friendly. 

Possible solutions:
a) Get BR8 from data that are aggregated every minute. So the sum of uptime and downtime of host of today would be the current time.

b) Notify user in the report when was the aggregation run.

c) Show user only hours and trancate the minutes, so we will avoid confusion about missing time. (Still might get 1 missing hour and end of each hour because of the Sum of uptime and downtime)

Not sure if these are possible but I would prefer a > b, and considering C only if there is any other appropriate way how to get these values from other dashboards on current date (not historical data)

Comment 8 Shirly Radco 2015-12-20 12:33:38 UTC
This is by design.
We will address this request in the metrics on 4.0.