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

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

DATA_SETS = o([
        ('TCP stream 1',
         {'command': find_netperf("TCP_STREAM", LENGTH+DELAY, HOST),
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ('TCP stream 2',
         {'command': find_netperf("TCP_STREAM", LENGTH, HOST),
          'delay': DELAY,
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ])


PLOTS = o([
    ('totals',
     {'description': 'Bandwidth plot',
      'type': 'timeseries',
      'series': [{'data': 'TCP stream 1',
                  'label': 'Stream 1'},
                  {'data': 'TCP stream 2',
                  'label': 'Stream 2'}]},),
    ('totals_5s',
     {'description': 'Bandwidth plot, 5 second smoothed sample size',
      'type': 'timeseries',
      'series': [{'data': 'TCP stream 1',
                  'label': 'Stream 1',
                  'smoothing': 5.0/STEP_SIZE},
                  {'data': 'TCP stream 2',
                  'label': 'Stream 2',
                  '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 stream 1',
                  'label': 'Stream 1',
                  'combine_mode': 'meta:MEAN_VALUE'},
                  {'data': 'TCP stream 2',
                  'label': 'Stream 2',
                  'combine_mode': 'meta:MEAN_VALUE'}]},),
    ])
