Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory usage to worker status in rake evm:status and status_full #15375

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/tasks/evm_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I've seen this before...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(☞゚ヮ゚)☞

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use (mem = (w.proportional_set_size || w.memory_usage)).nil? ? "" : mem.to_s(:human_size)], but that's just splitting hairs

LGTM 👍

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

Expand Down