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

include("netperf_definitions.inc")
DESCRIPTION="TCP download - N streams w/ping"
DEFAULTS={'PLOT': 'totals'}

STREAMS=get_test_parameter('download_streams')

DATA_SETS = o([
    ('TCP download',
     {'command': find_netperf("TCP_MAERTS", LENGTH, HOST),
      'delay': DELAY,
      'units': 'Mbits/s',
      'runner': 'netperf_demo',
      'duplicates': STREAMS}),
    ('TCP download avg',
     {'apply_to': [glob("TCP download*", exclude=["TCP download sum"])],
      'units': 'Mbits/s',
      'runner': 'average',}),
    ('TCP download sum',
     {'apply_to': [glob("TCP download*", exclude=["TCP download avg"])],
      'units': 'Mbits/s',
      'runner': 'sum',}),
    ('Ping (ms) ICMP',
     {'command': find_ping(IP_VERSION, STEP_SIZE, TOTAL_LENGTH, HOST),
      'units': 'ms',
      'runner': 'ping',}),
])


PLOTS = o([
    ('totals',
     {'description': 'Bandwidth and ping plot',
      'type': 'timeseries',
      'dual_axes': True,
      'series': [{'data': 'TCP download sum',
                  'label': 'Download'},
                 {'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)',
                  'axis': 2}]}),
    ('download',
     {'description': 'Download bandwidth plot',
      'type': 'timeseries',
      'legend_title': 'TCP download',
      'series': [{'data': glob('TCP download*', exclude=['TCP download sum', 'TCP download avg']),
                  'label': 'BE'},
                 {'data': 'TCP download avg',
                  'label': 'Avg',
                  'smoothing': 10,
                  'color': 'black',
                  'linewidth': 2}]}),
    ('download_scaled',
     {'description': 'Download bandwidth w/axes scaled to remove outliers',
      'parent': 'download',
      'scaling': (5,95)}),
    ('ping',
     {'description': 'Ping plot',
      'type': 'timeseries',
      'axis_labels': ['Latency (ms)'],
      'series': [{'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)'},]}),
    ('ping_smooth',
     {'description': 'Ping plot (inc smoothed average)',
      'type': 'timeseries',
      'legend_title': 'Ping (ms)',
      'axis_labels': ['Latency (ms)'],
      'series': [
                 {'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)'},
                 {'data': 'Ping (ms) ICMP',
                  'label': 'Avg (smoothing)',
                  'smoothing': 5,
                  'color': 'black',
                  'linewidth': 2}]}),
    ('ping_cdf',
     {'description': 'Ping CDF plot',
      'type': 'cdf',
      'series': [{'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)'},],
      'cutoff': (DELAY,DELAY)}),
    ('box_totals',
     {'description': 'Box plot of totals',
      'parent': 'totals',
      'type': 'box',}),
    ])


include("common.inc")
