Skip to content

Commit

Permalink
Merge pull request #5256 from PanSpagetka/add-amazon-memory-chart
Browse files Browse the repository at this point in the history
Add Memory for Amazon Availability Zones
  • Loading branch information
h-kataria authored Feb 20, 2019
2 parents acbc8c2 + 83ef3c0 commit 9b3dc8a
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions app/controllers/application_controller/performance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ def perf_gen_tag_data_after_wait
end

chart_layout = perf_get_chart_layout(layout_name, @perf_options[:model])
perf_filter_charts(chart_layout, rpt)

if @perf_options[:index]
chart_index = @perf_options[:index].to_i
Expand Down Expand Up @@ -1273,7 +1272,6 @@ def perf_gen_charts(rpt, perf_options, parent = false)
case perf_options[:typ]
when "Hourly"
chart_layout = perf_get_chart_layout("hourly_perf_charts", model_title)
perf_filter_charts(chart_layout, rpt)
if perf_options[:index]
chart = chart_layout[perf_options[:index].to_i]
perf_remove_chart_cols(chart)
Expand Down Expand Up @@ -1303,7 +1301,6 @@ def perf_gen_charts(rpt, perf_options, parent = false)
end
when "realtime"
chart_layout = perf_get_chart_layout("realtime_perf_charts", model_title)
perf_filter_charts(chart_layout, rpt)
if perf_options[:index]
chart = chart_layout[perf_options[:index].to_i]
perf_remove_chart_cols(chart)
Expand Down Expand Up @@ -1332,7 +1329,6 @@ def perf_gen_charts(rpt, perf_options, parent = false)
end
when "Daily"
chart_layout = perf_get_chart_layout("daily_perf_charts", model_title)
perf_filter_charts(chart_layout, rpt)
if perf_options[:index]
chart = chart_layout[perf_options[:index].to_i]
if chart
Expand Down Expand Up @@ -1548,21 +1544,6 @@ def perf_remove_report_cols(report, charts = nil)
new_rpt
end

# Deletes memory chart from chart_layout, if it is a chart for Amazon Availability Zone
# rpt.where_clause[0] should be query string
# rpt.where_clause[1] should be model name string
# rpt.where_clause[2] should be id
def perf_filter_charts(chart_layout, rpt)
return unless rpt&.where_clause
model = rpt.where_clause.dig(1).constantize
id = rpt.where_clause.dig(2)
return unless model && id
if model == AvailabilityZone &&
model.find(id).type == "ManageIQ::Providers::Amazon::CloudManager::AvailabilityZone"
chart_layout.reject! { |chart| chart[:title].include?("Memory") }
end
end

def process_chart_trends(chart, rpt, options)
if chart[:trends] && rpt.extras && rpt.extras[:trend]
trendcol = perf_get_chart_trendcol(chart)
Expand Down

0 comments on commit 9b3dc8a

Please sign in to comment.