view master/src/wecu/reducer.py @ 68:1f04bce6ead7 default tip

use basefile instead of transferfile, and remove cleanup: belt and braces wrt lossage of sac_schemes.py in 15% of 1000_k3, this as used in a_2
author Henry S. Thompson <ht@markup.co.uk>
date Thu, 04 Jun 2020 20:44:44 +0000
parents a3edba8dab11
children
line wrap: on
line source

#!/usr/bin/python

import sys

request_counter = 0
response_counter = 0

for line in sys.stdin:
    line = line.strip().split('\t')
    if line[0] == 'request_counter':
        request_counter += int(line[1])
    elif line[0] == 'response_counter':
        response_counter += int(line[1])
    else:
        print(line[0])
        print('error')
        sys.exit(1)

print(request_counter)
print(response_counter)