Created
September 20, 2019 16:42
-
-
Save tracek/e2dfd528cf872ba347a16a2efbb12bca to your computer and use it in GitHub Desktop.
This file contains 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
import re | |
import numpy as np | |
with open('code-corp.log') as f: | |
log = f.readlines() | |
latency = [] | |
timeout = [] | |
for idx, line in enumerate(log): | |
match = re.search('time=(\d+\.\d+)', line) | |
if match: | |
latency.append(float(match.group(1))) | |
f = line.find('Request timeout') | |
if f !=-1: | |
timeout.append(idx) | |
latency = np.array(latency) | |
timeout_idx = np.array(timeout) | |
timeout_interval = timeout_idx[1:] - timeout_idx[:-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment