Bug 1274679

Summary: [userinterface_public_525]Number indicating used cpu/memroy is incorrect if client's time is ahead of the server's time.
Product: OKD Reporter: Yanping Zhang <yanpzhan>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Yanping Zhang <yanpzhan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-23 21:18:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
incorrent-number
none
30minutes
none
1hour
none
4hours none

Description Yanping Zhang 2015-10-23 10:52:36 UTC
Description of problem:
If local time on client host is ahead of the time on server host, such as client time is 17:46, and server time is 17.44, View pod's metrics on browser(Firefox/Chrome/Safari), the number in the circle icon of metrics chart is incorrect, it's always 0 or a negative number. And "Available number" would changed accordingly.

Version-Release number of selected component (if applicable):
openshift v1.0.6-880-g5f33e54
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2

How reproducible:
Always

Steps to Reproduce:
1.Create pod with cpu/memory request/limits set.
$oc create -f origin/examples/project-quota/application-template-with-resources.json -n pro1
$oc new-app ruby-helloworld-sample-with-resources -n pro1
2.On host whose local time is ahead of server time.View pod's metrics on browser.
3.

Actual results:
2.the number in the circle icon of metrics chart is incorrect, it's always 0 or a negative number. And "Available number" would changed accordingly. Pls refer to the attachment.

Expected results:
2.Number should be correct.

Additional info:

Comment 1 Yanping Zhang 2015-10-23 10:53:48 UTC
Created attachment 1085812 [details]
incorrent-number

Comment 2 Samuel Padgett 2015-10-23 12:23:15 UTC
https://github.com/openshift/origin/pull/5356

Comment 3 Samuel Padgett 2015-10-23 18:02:18 UTC
(In reply to Samuel Padgett from comment #2)
> https://github.com/openshift/origin/pull/5356

Please try with this fix.

Comment 4 Yanping Zhang 2015-10-26 08:02:43 UTC
Tested with latest origin code containing the pr5356.
openshift v1.0.6-946-g5954394
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2

When client host local time is ahead of the time on server host, view the pod's metrics.
1.Choose Time Range"last 30 minutes".
The used memory/cpu would always show number 0, but from chart it exactly consumed memory/cpu.S o the number in the circle icon has less meaning to reflect the usage.
Most of the time, it has the same result when choose Time Range "Last hour".
2.Choose Time Range "Last 4 hours".
It would show the used memory number, not 0 now, but the available number is still the total number.
Pls refer to the attachment.

Comment 5 Yanping Zhang 2015-10-26 08:03:29 UTC
Created attachment 1086405 [details]
30minutes

Comment 6 Yanping Zhang 2015-10-26 08:04:17 UTC
Created attachment 1086406 [details]
1hour

Comment 7 Yanping Zhang 2015-10-26 08:04:48 UTC
Created attachment 1086407 [details]
4hours

Comment 8 Samuel Padgett 2015-10-26 12:59:30 UTC
The fix is working as intended -- we no longer show negative values for CPU usage when there are gaps in the data -- but I understand why this is still a problem.

It's difficult to know whether there is a clock skew or just no data because the container or Hawkular is stopped. Let me see if there is a way to use server time for the chart.

Comment 9 Samuel Padgett 2015-10-26 13:18:49 UTC
Related to https://github.com/openshift/origin/issues/2568

Comment 10 Samuel Padgett 2015-10-26 18:17:20 UTC
https://github.com/openshift/origin/pull/5402

Comment 11 Yanping Zhang 2015-10-27 04:31:53 UTC
Will test after pr5402 is merged.

Comment 12 Samuel Padgett 2015-10-27 17:02:18 UTC
(In reply to Yanping Zhang from comment #11)
> Will test after pr5402 is merged.

Thanks, the fix just merged in origin.

Comment 13 Yanping Zhang 2015-10-28 06:34:16 UTC
Tested on latest origin code.
openshift v1.0.6-997-gff3b522
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2

There is still issue that available number is not matched with used number when choose different Time Range.

Since the original issue has been fixed, so move the bug to Verified, and file another bug to track the latter issue. https://bugzilla.redhat.com/show_bug.cgi?id=1275918