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

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

DATA_SETS = o([
        ('TCP download',
         {'command': find_netperf("TCP_MAERTS", LENGTH, HOST),
          'delay': DELAY,
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ('TCP upload',
         {'command': find_netperf("TCP_STREAM", LENGTH, HOST),
          'delay': DELAY,
          'units': 'Mbits/s',
          'runner': 'netperf_demo',}),
        ('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,
      'axis_labels': [None, 'Latency (ms)'],
      'series': [{'data': 'TCP download',
                  'label': 'Download'},
                 {'data': 'TCP upload',
                  'label': 'Upload'},
                 {'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)',
                  'axis': 2}]}),
    ('ping',
     {'description': 'Ping plot',
      'type': 'timeseries',
      'legend_title': 'Ping (ms)',
      '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',
      'axis_labels': ['Latency (ms)'],
      'series': [{'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)'},],
      'cutoff': (DELAY,DELAY)}),

    ('box_totals',
     {'description': 'Box plot of totals',
      'parent': 'totals',
      'type': 'box',}),
    ])
