Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. list.each { |file|
  2. content = YAML.parse_file file.chomp
  3. # failed count
  4. count = 0
  5. while content['metrics']['resources']['values'][count]
  6. if content['metrics']['resources']['values'][count][0].value == ":failed"
  7. report[server][0] += content['metrics']['resources']['values'][count][2].value.to_i
  8. break
  9. end
  10. count += 1
  11. end
  12. # changes count
  13. report[server][1] += content['metrics']['changes']['values'][0][2].value.to_i
  14. if report[server][1] > 0
  15. i = "#{report[server][0].class}" == "Array" ? report[server][i].length : 2
  16. content['logs'].value.each { |yaml_obj|
  17. report[server][i] = Array.new
  18. report[server][i][0] = yaml_obj['source'].value
  19. report[server][i][1] = yaml_obj['message'].value
  20. report[server][i][2] = yaml_obj['time'].value
Add Comment
Please, Sign In to add comment