Mercurial > hg > cc > azure
diff master/src/wecu/reducer.py @ 58:a3edba8dab11
move to right place in tree
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Thu, 28 May 2020 09:56:42 +0000 |
parents | master/wecu/reducer.py@ac1a20e627a9 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/master/src/wecu/reducer.py Thu May 28 09:56:42 2020 +0000 @@ -0,0 +1,20 @@ +#!/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) \ No newline at end of file