summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2018-12-14 14:26:34 +1300
committerDouglas Bagnall <dbagnall@samba.org>2019-01-08 23:55:33 +0100
commit7b03e81c615a9b3ae24f90019c9b269b498bafc0 (patch)
treec454959f9235dc927b9d90770f8a0dbc29cabd0b /script
parent7edf58dc58630eca4f9b11242035aa5d6d24e285 (diff)
downloadsamba-7b03e81c615a9b3ae24f90019c9b269b498bafc0.tar.gz
traffic: generate sparser descriptions of conversations
Rather than building all the packets at this point, we stick to the barest details of the packets (which is all the model gives us anyway). The advantage is that will take a lot less memory, which matters because this process forks into many clients that were sharing and mutate the conversation list. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script')
-rwxr-xr-xscript/traffic_replay13
1 files changed, 7 insertions, 6 deletions
diff --git a/script/traffic_replay b/script/traffic_replay
index 6fbbe4f4425..83b7041f635 100755
--- a/script/traffic_replay
+++ b/script/traffic_replay
@@ -250,9 +250,9 @@ def main():
logger.info(("Using the specified model file to "
"generate conversations"))
- conversations = model.generate_conversations(opts.scale_traffic,
- opts.duration,
- opts.replay_rate)
+ conversations = model.generate_conversation_sequences(opts.scale_traffic,
+ opts.duration,
+ opts.replay_rate)
except ValueError:
logger.error(("Could not parse %s, which does not seem to be "
"a model generated by script/traffic_learner."
@@ -263,7 +263,7 @@ def main():
conversations = []
if debuglevel > 5:
- for c in conversations:
+ for c in traffic.seq_to_conversations(conversations):
for p in c.packets:
print(" ", p, file=sys.stderr)
@@ -350,7 +350,7 @@ def main():
logger.info("Writing traffic summary")
summaries = []
- for c in conversations:
+ for c in traffic.seq_to_conversations(conversations):
summaries += c.replay_as_summary_lines()
summaries.sort()
@@ -359,7 +359,8 @@ def main():
exit(0)
- traffic.replay(conversations, host,
+ traffic.replay(traffic.seq_to_conversations(conversations),
+ host,
lp=lp,
creds=creds,
accounts=accounts,