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):
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.
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.
2.Number should be correct.
Created attachment 1085812 [details]
(In reply to Samuel Padgett from comment #2)
Please try with this fix.
Tested with latest origin code containing the pr5356.
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.
Created attachment 1086405 [details]
Created attachment 1086406 [details]
Created attachment 1086407 [details]
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.
Related to https://github.com/openshift/origin/issues/2568
Will test after pr5402 is merged.
(In reply to Yanping Zhang from comment #11)
> Will test after pr5402 is merged.
Thanks, the fix just merged in origin.
Tested on latest origin code.
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