This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'clamp' | |
require 'date' | |
require 'awesome_print' | |
Clamp do | |
parameter "DATA", "File with data collected from the cron job" | |
self.description = "Preprocess data for chart of memory usage. Collect the data with\n $> echo \"0 * * * * root (date && ps aux --sort -rss | head -n20) >> output_file\" > /etc/cron.d/mem_usage" | |
option ['--filter'], 'FILTER', "Regexp matching processes included in the chart", :attribute_name => :filter_expression | |
option ['--depth'], 'DEPTH', "Process name is split by spaces first N parts are used as process name", :default => 3 |