Skip to content

Commit

Permalink
Merge pull request ManageIQ#11827 from yrudman/show-memory-graph-for-…
Browse files Browse the repository at this point in the history
…azure-instances

Show 'Memory (MB)' chart for azure instance
  • Loading branch information
gtanzillo committed Oct 14, 2016
2 parents 63d27e6 + 29b5625 commit 3f1916e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/azure/cloud_manager/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def disconnected?
false
end

def memory_mb_available?
true
end

def self.calculate_power_state(raw_power_state)
case raw_power_state.downcase
when /running/, /starting/
Expand Down
8 changes: 8 additions & 0 deletions spec/services/charts_layout_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,13 @@
expect(chart.count { |x| x[:title] == "CPU (%)" }).to equal 0
expect(chart.count { |x| x[:title] == "CPU (Mhz)" }).to equal 1
end

it "includes Memory (MB) chart for azure instance" do
ems_azure = FactoryGirl.create(:ems_azure)
host = FactoryGirl.create(:host, :ext_management_system => ems_azure)
vm_azure = FactoryGirl.create(:vm_azure, :ext_management_system => ems_azure, :host => host)
chart = ChartsLayoutService.layout(vm_azure, UiConstants::CHARTS_LAYOUTS_FOLDER, 'daily_perf_charts', 'VmOrTemplate')
expect(chart.count { |x| x[:title] == "Memory (MB)" }).to equal 1
end
end
end

0 comments on commit 3f1916e

Please sign in to comment.