## -*- mode: python; coding: utf-8 -*-

include("netperf_definitions.inc")
DESCRIPTION="Two TCP upload streams; 2nd stream started delayed"
DEFAULTS={'PLOT': 'totals'}
TOTAL_LENGTH=max(LENGTH,DELAY*6)

DATA_SETS = o([
        ('TCP cubic',
         {'command': find_netperf("TCP_STREAM", LENGTH, HOST,
		extra_test_args="-M ,64k -K cubic,cubic"),
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ('TCP cubic 2',
         {'command': find_netperf("TCP_STREAM", DELAY, HOST,
		extra_test_args="-M ,64k -K cubic,cubic"),
          'delay': DELAY,
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ('TCP reno',
         {'command': find_netperf("TCP_STREAM", DELAY, HOST,
		extra_test_args="-M ,64k -K reno,reno"),
          'delay': DELAY*3,
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ('TCP westwood',
         {'command': find_netperf("TCP_STREAM", DELAY, HOST,
		extra_test_args="-M ,64k -K westwood,westwood"),
          'delay': DELAY*5,
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ]
)


PLOTS = o([
    ('totals',
     {'description': 'Bandwidth plot',
      'type': 'timeseries',
      'series': [{'data': 'TCP cubic',
                  'label': 'Cubic'},
                  {'data': 'TCP cubic 2',
                  'label': 'Cubic 2'},
                  {'data': 'TCP reno',
                  'label': 'Reno'},
                  {'data': 'TCP westwood',
                  'label': 'Westwood'},]}
	),
    ('totals_5s',
     {'description': 'Bandwidth plot, 5 second smoothed sample size',
      'type': 'timeseries',
      'series': [{'data': 'TCP cubic',
                  'label': 'Cubic 1',
                  'smoothing': 5.0/STEP_SIZE},
                  {'data': 'TCP cubic 2',
                  'label': 'Cubic 2',
                  'smoothing': 5.0/STEP_SIZE},
                  {'data': 'TCP reno',
                  'label': 'Reno',
                  'smoothing': 5.0/STEP_SIZE},
                  {'data': 'TCP westwood',
                  'label': 'Westwood',
                  'smoothing': 5.0/STEP_SIZE}]},
	),
    ('box_combine',
     {'description': 'Summarising combined tests',
      'type': 'box_combine',
      'cutoff': (DELAY,0),
      'group_by': 'series',
      'axis_labels': ['Mean bandwidth (MBits/s)'],
      'series': [{'data': 'TCP cubic',
                  'label': 'Stream 1',
                  'combine_mode': 'meta:MEAN_VALUE'},
                  {'data': 'TCP cubic 2',
                  'label': 'Cubic 2',
                  'combine_mode': 'meta:MEAN_VALUE'},
                  {'data': 'TCP reno',
                  'label': 'Reno',
                  'combine_mode': 'meta:MEAN_VALUE'},
                  {'data': 'TCP westwood',
                  'label': 'Westwood',
                  'combine_mode': 'meta:MEAN_VALUE'}]},
	),
    ])
