-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Containers Dashboard: Show hourly and realtime trends #33
Conversation
@miq-bot add_label enhancement, providers/containers |
@zakiva Cannot apply the following label because they are not recognized: providers/containers |
@zakiva any way to fix the warnings? |
Fixed most of them. |
9a7a71b
to
199fac0
Compare
@zakiva please have this reviewed. cc @zeari @cben @yaacov @moolitayer |
@miq-bot assign zakiva |
LGTM 👍 p.s. |
@himdel Can you take a look here? |
"dates", | ||
$scope.memoryUsageConfig.units); | ||
if (data.daily_ems_utilization.cpu != undefined) { | ||
$scope.cpuUsageData = chartsMixin.processUtilizationData(data.daily_ems_utilization.cpu, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broken formatting, please set your editor to 2 spaces, not 4
(multiple places with the same issue..)
$scope.cpuUsageData = chartsMixin.processUtilizationData(data.hourly_ems_utilization.cpu, | ||
"dates", | ||
$scope.cpuUsageConfig.units); | ||
$scope.cpuUsageConfig.timeFrame = 'Last 24 hours'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing i18n .. you probably want __('Last 24 hours')
(double underscore)
(multiple places with the same issue..)
@@ -78,7 +78,7 @@ | |||
"pf-utilization-trend-chart" => "", | |||
"sparkline-config" => "cpuUsageSparklineConfig"} | |||
%span.trend-footer-pf{"ng-class" => "{ 'chart-transparent-text': !cpuUsageData }"} | |||
= _("Last 30 Days") | |||
= _("{{cpuUsageConfig.timeFrame}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No point in translating "{{cpuUsageConfig.timeFrame}}"
.. the only thing this can accomplish is that the translators will break your code ;).
If the actual string is defined in the frontend, you can't very well translate in on the backend..
(multiple places with the same issue..)
Sorry @zakiva , I have skipped reviewing most of the JS code because of broken formatting, please let me know when this is fixed and I'll give it another spin. But.. from what I can tell, seems like there's too much code duplication.. it seems like you're uselessly copying all the code into both branches of those conditions, instead of simply picking the right field in the if, and keeping the rest of code outside.. Another thing, |
Sorry @zakiva , but I'm going to spam this thread to test the bot. Apologies for the emails. |
@miq-bot assign zakiva |
@Fryguy zakiva is an invalid user, ignoring... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broken formatting and i18n, see comments please :)
204c4c2
to
1bd2bf7
Compare
@himdel I made some fixes: pulled out the date parsing out of the if branches and tried to make the code more consistent and with less code duplication. The data is not necessarily available, server-side code may return daily/hourly/realtime data or no data at all, so I had to check for null before parsing the dates. |
@miq-bot remove_label wip |
692b81d
to
5a75e26
Compare
@zakiva can you handle the travis failures? |
4cc3968
to
5e8facf
Compare
@simon3z I tried to look into the Travis failures but it seems like they not related to this PR, I also rebased but they are still there :\ |
@zakiva I had a similar problem - Travis is actually testing a commit not related to the PR (look at the Travis page it writes which commit it tests. it should be a commit merging master and your commit but in this case it is something else entirely). My only solution was to keep rebasing or opening a new PR. |
Checked commit zakiva@6902ba8 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/services/container_dashboard_service.rb
|
Yup, looks like travis is doing it again :( ... If this is something we want merged soon, @zakiva can you open a new PR please? (The code looks much more consistent now, thanks! I'll test in the UI and merge if everything works..) |
(tried to clean travis' cache for this PR and restart the specs, we'll see if that works..) EDIT: apparently not :( .. so.. the new pr thing.. |
Also, @zakiva please update the PR description with instructions on how to find the thing in the UI. EDIT: (although, now that I read the title, "container dashboard" is probably descriptive enough, just not where I expected to find it) |
In case that daily trends are not available, we would like to display hourly trends (last 24 hours) if available, or realtime trends (last 10 minutes) instead.
For Image Usage and Pod Creation and Deletion cards I added only hourly trends as we still don't collect the relevant realtime data in the Metric table. This can be added in a follow-up PR once we have the backend functionality.