Skip to content

Commit

Permalink
Merge pull request #16093 from radvc/remove-unused-variables
Browse files Browse the repository at this point in the history
Remove unused variables
  • Loading branch information
bdunne authored Oct 25, 2017
2 parents 14a0d27 + 7ceae09 commit f12ddbe
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
1 change: 1 addition & 0 deletions app/models/miq_server/server_smart_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def is_vix_disk_supported?
require 'VMwareWebService/VixDiskLib/VixDiskLib'
caps[:vixDisk] = true
end
rescue Exception
# It is ok if we hit an error, it just means the library is not available to load.
end

Expand Down
8 changes: 4 additions & 4 deletions app/models/vim_performance_planning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def self.build_results_for_report_planning(options)
end

case t
when :cpu then vm_profile[t] = "#{vm_profile[t].round} MHz"
when :memory then vm_profile[t] = "#{vm_profile[t].round} MB"
when :storage then vm_profile[t] = "#{(vm_profile[t].to_i / 1.gigabyte).round} GB"
end
when :cpu then vm_profile[t] = "#{vm_profile[t].round} MHz"
when :memory then vm_profile[t] = "#{vm_profile[t].round} MB"
when :storage then vm_profile[t] = "#{(vm_profile[t].to_i / 1.gigabyte).round} GB"
end
end
return results, {:vm_profile => vm_profile}
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/vm_or_template/right_sizing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ def base_change_percentage(recommended, actual)
div = (actual.to_f / recommended.to_f)
return 0 if div == 0

result = ((1 - (1 / div)) * 1000).round / 10.0
((1 - (1 / div)) * 1000).round / 10.0
end
end
54 changes: 27 additions & 27 deletions tools/dba.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def self.select(*args)
#
def self.client_connections
select(<<-SQL, "Client Connections")
SELECT client_addr AS client_address
, datname AS database
, procpid AS spid
, waiting AS number_waiting
, current_query AS query
FROM pg_stat_activity
ORDER BY 1, 2
SQL
SELECT client_addr AS client_address
, datname AS database
, procpid AS spid
, waiting AS number_waiting
, current_query AS query
FROM pg_stat_activity
ORDER BY 1, 2
SQL
end

# Taken from: https://github.com/bucardo/check_postgres/blob/2.19.0/check_postgres.pl#L3492
Expand Down Expand Up @@ -332,25 +332,25 @@ def self.database_statistics

def self.table_statistics
select(<<-SQL, "Table Statistics")
SELECT relname AS table_name
, seq_scan AS table_scan
, seq_tup_read AS sequential_rows_read
, idx_scan AS index_scan
, idx_tup_fetch AS index_rows_fetched
, n_tup_ins AS rows_inserted
, n_tup_upd AS rows_updated
, n_tup_del AS rows_deleted
, n_tup_hot_upd AS rows_hot_updated
, n_live_tup AS rows_live
, n_dead_tup AS rows_dead
, last_vacuum AS last_vacuum_date
, last_autovacuum AS last_autovacuum_date
, last_analyze AS last_analyze_date
, last_autoanalyze AS last_autoanalyze_date
FROM pg_stat_all_tables
WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
ORDER BY relname ASC ;
SQL
SELECT relname AS table_name
, seq_scan AS table_scan
, seq_tup_read AS sequential_rows_read
, idx_scan AS index_scan
, idx_tup_fetch AS index_rows_fetched
, n_tup_ins AS rows_inserted
, n_tup_upd AS rows_updated
, n_tup_del AS rows_deleted
, n_tup_hot_upd AS rows_hot_updated
, n_live_tup AS rows_live
, n_dead_tup AS rows_dead
, last_vacuum AS last_vacuum_date
, last_autovacuum AS last_autovacuum_date
, last_analyze AS last_analyze_date
, last_autoanalyze AS last_autoanalyze_date
FROM pg_stat_all_tables
WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
ORDER BY relname ASC ;
SQL
end

def self.table_size
Expand Down
2 changes: 2 additions & 0 deletions tools/env_probe_vc_inv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def vim_vc_inv_hash
begin
t0 = Time.now
vc_data = {}
vim_vc_connect
vim_vc_inv_hash
log(:info, "Requesting inventory accessors...")
VC_ACCESSORS.each do |acc, type|
inv_hash = @vi.send(acc)
Expand Down

0 comments on commit f12ddbe

Please sign in to comment.