File: stat.rb

package info (click to toggle)
libosl 0.8.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,328 kB
  • sloc: cpp: 114,345; ruby: 1,290; ansic: 915; makefile: 431; perl: 309; sh: 35
file content (16 lines) | stat: -rwxr-xr-x 348 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /usr/bin/env ruby

ok_count = 0
total_nodes = 0
ok_nodes = 0
while l = gets
  result = l.chomp.split(/\t/)
  nodes = result[3].to_i
  if result[1] == 'OK' then
    ok_count += 1
    ok_nodes += nodes
  end
  total_nodes += nodes
end

puts "OK: #{ok_count} OK nodes: #{ok_nodes}, average: #{ok_nodes.to_f / ok_count} Total nodes: #{total_nodes}"