Skip to content

Commit

Permalink
Container dashboard does not show 'Aggregated Node Utilization' unles…
Browse files Browse the repository at this point in the history
…s appliance timezone is UTC

In the class MetricsRollup the column :time_profile is always utc, quering for a diferent time_profile will
always give no results.
We need to query the metrics table with time_profile == nil even if the user interface use different time_profile.

Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1362331
  • Loading branch information
Yaacov Zamir committed Aug 4, 2016
1 parent ade06dc commit 4ed4c32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/services/container_dashboard_service.rb
Expand Up @@ -259,7 +259,10 @@ def daily_image_metrics
end

def daily_provider_metrics
@daily_metrics ||= Metric::Helper.find_for_interval_name('daily', @controller.current_user.get_timezone)
current_user = @controller.current_user
tp = TimeProfile.profile_for_user_tz(current_user.id, current_user.get_timezone) || TimeProfile.default_time_profile

@daily_metrics ||= Metric::Helper.find_for_interval_name('daily', tp)
.where(:resource => (@ems || ManageIQ::Providers::ContainerManager.all))
.where('timestamp > ?', 30.days.ago.utc).order('timestamp')
end
Expand Down

0 comments on commit 4ed4c32

Please sign in to comment.