From 5be3b4555ec32578e51cacd86ea046139d6d661a Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Wed, 7 Jun 2017 13:31:09 -0400 Subject: [PATCH] Add memory usage to worker status --- lib/tasks/evm_application.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/evm_application.rb b/lib/tasks/evm_application.rb index 7b449ba28d7..0440bd557e5 100644 --- a/lib/tasks/evm_application.rb +++ b/lib/tasks/evm_application.rb @@ -102,11 +102,12 @@ def self.output_workers_status(servers) w.miq_server_id, w.queue_name || w.uri, w.started_on && w.started_on.iso8601, - w.last_heartbeat && w.last_heartbeat.iso8601] + w.last_heartbeat && w.last_heartbeat.iso8601, + (mem = (w.proportional_set_size || w.memory_usage)).nil? ? "" : mem / 1.megabyte] end end - header = ["Worker Type", "Status", "ID", "PID", "SPID", "Server id", "Queue Name / URL", "Started On", "Last Heartbeat"] + header = ["Worker Type", "Status", "ID", "PID", "SPID", "Server id", "Queue Name / URL", "Started On", "Last Heartbeat", "MB Usage"] puts data.unshift(header).tableize unless data.empty? end