view scripts/log.rb @ 1672:32bc4ea3557f draft

set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 18 Jul 2013 11:20:51 +0900 (2013-07-18)
parents 9b0908cb7553
children
line wrap: on
line source
require 'yaml'
log_file = ARGV[0]

puts 'digraph log {'
puts 'node [shape = record];'
YAML.load_documents(open(log_file)) do |doc|
  print doc['task_id'].to_s
  print '['
  print 'label = "{'
  print doc['task_id'].to_s + '|'
  print 'cmd:\ ' + doc['cmd'].to_s + '\l' + '\n'
  print 'create:\ ' + doc['create_time'].to_s + '\l' + '\n'
  print 'execute:\ ' + doc['execute_time'].to_s + '\l' + '\n'
  print 'finish:\ ' + doc['finish_time'].to_s + '\l' + '\n'
  print '}"];' + "\n"
end

YAML.load_documents(open(log_file)) do |doc|
  if doc['wait_for'] != nil then
    doc['wait_for'].each do |task|
      puts task['task_id'].to_s + ' -> ' + doc['task_id'].to_s
    end
  end

end

puts '}'