Sha256: 533e0a959576e9e9be08804f96c883ca441515dd1bb9e8ed94a9c3726668ef0c
Contents?: true
Size: 561 Bytes
Versions: 2
Compression:
Stored size: 561 Bytes
Contents
module Opsk class Analyze < Thor::Group include Thorable, Thor::Actions argument :file, :type => :string, :desc => 'the puppet log input file' class_option :threshold, :type=> :string, :desc => 'minimum run time filter' def report threshold = options['threshold'] || '0.01' rs = File.readlines(file).find_all{|line| line.include?('Evaluated')} top = rs.collect {|r| r.split(' ').values_at(3 , 7)}.find_all{|r| r[1].to_f > threshold.to_f} top.sort_by{|r| r[1].to_f}.reverse.each {|r| say("#{r[0]} #{r[1]}") } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
opskeleton-0.10.1 | lib/opskeleton/analyze.rb |
opskeleton-0.9.9 | lib/opskeleton/analyze.rb |