'These options alter the traffic '
'generated by the model')
model_group.add_option('-S', '--scale-traffic', type='float', default=1.0,
- help='Increase the number of conversations by '
- 'this factor')
+ help=('Increase the number of conversations by '
+ 'this factor (or use -T)'))
+ parser.add_option('-T', '--packets-per-second', type=float,
+ help=('attempt this many packets per second '
+ '(alternative to -S)'))
parser.add_option('--old-scale',
action="store_true",
help='emulate the old scale for traffic')
logger.error("--group-memberships requires --number-of-groups")
sys.exit(1)
+ if opts.scale_traffic is not None and opts.packets_per_second is not None:
+ logger.error("--scale-traffic and --packets-per-second "
+ "are incompatible. Use one or the other.")
+ sys.exit(1)
+
if opts.timing_data not in ('-', None):
try:
open(opts.timing_data, 'w').close()
logger.info(("Using the specified model file to "
"generate conversations"))
+ if opts.scale_traffic:
+ packets_per_second = model.scale_to_packet_rate(opts.scale_traffic)
+ else:
+ packets_per_second = opts.packets_per_second
+
conversations = \
model.generate_conversation_sequences(
- opts.scale_traffic,
+ packets_per_second,
opts.duration,
opts.replay_rate,
opts.conversation_persistence)