Created
September 13, 2016 21:17
-
-
Save jmvrbanac/40da162364281b2c4d57c10b085dbb5e to your computer and use it in GitHub Desktop.
Quick and dirty converter for falcon metrics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_results(): | |
lines = [] | |
while True: | |
try: | |
line = raw_input() | |
except EOFError: | |
break | |
if line: | |
lines.append(line) | |
return lines | |
def main(): | |
print('Input results: (CTRL-D to finish)') | |
result_lines = get_results() | |
first = True | |
print('--------------') | |
for line in result_lines: | |
_, name_and_rps, _, _, u_req, _, perf = line.split(' ') | |
name = name_and_rps.split('.')[0] | |
rps = int(name_and_rps.split('.')[-1]) | |
u_req = float(u_req) | |
perf = perf.replace('(', '') | |
perf = perf.replace(')', '') | |
msg = '<td>{name} ()</td><td>{rps:,}</td><td>{u_req}</td><td>{perf}</td>'.format( | |
name=name.capitalize(), | |
rps=rps, | |
u_req=int(round(u_req)), | |
perf=perf | |
) | |
print(msg) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment