Skip to content

Commit

Permalink
fix(parser): less brittle integration parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed Sep 28, 2023
1 parent 3cc0ef5 commit a39e133
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions netsim/netsim_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,11 @@ def parse_magic_iroh_client(lines):
}
is_ok = 0
for line in lines:
if 'Downloading' in line:
is_ok += 1
if 'Transferred' in line and 'seconds' in line:
if 'Transferred' in line and 'in' in line and '/s' in line:
is_ok += 1
if 'sending UDP: Some(' in line and 'DERP:' in line:
s['conn_upgrade'] = 'true'
s['transfer_success'] = 'true' if is_ok == 2 else 'false'
s['transfer_success'] = 'true' if is_ok == 1 else 'false'
return s

def integration_parser(nodes, prefix):
Expand Down

0 comments on commit a39e133

Please sign in to comment.