comparison master/wecu/reducer.py @ 57:ac1a20e627a9

from lukasz git repo 2020-05-26 (see ~/src/wecu), then editted, sac not quite working yet
author Henry S. Thompson <ht@markup.co.uk>
date Wed, 27 May 2020 20:54:34 +0000
parents
children
comparison
equal deleted inserted replaced
56:8ce6a81e2bb4 57:ac1a20e627a9
1 #!/usr/bin/python
2
3 import sys
4
5 request_counter = 0
6 response_counter = 0
7
8 for line in sys.stdin:
9 line = line.strip().split('\t')
10 if line[0] == 'request_counter':
11 request_counter += int(line[1])
12 elif line[0] == 'response_counter':
13 response_counter += int(line[1])
14 else:
15 print(line[0])
16 print('error')
17 sys.exit(1)
18
19 print(request_counter)
20 print(response_counter)