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

AGGREGATOR='timeseries'
TOTAL_LENGTH=LENGTH+2*DELAY
DESCRIPTION="UDP flood w/ping"
DEFAULTS={'PLOT': 'totals'}
PING="ping"
IPERF_V6=""
if IP_VERSION == 6:
    IPERF_V6="-V"
    PING="ping6"


DATA_SETS = o([
        ('UDP upload',
         {'command': "iperf -c %s -i %.2f -y C -t %d -u -b 100M %s" % (HOST, max(0.5,STEP_SIZE), LENGTH, IPERF_V6),
          'delay': DELAY,
          'units': 'bits/s',
          'runner': 'iperf_csv',}),
        ('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': 'UDP upload',
                  'label': 'Upload'},
                 {'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)',
                  'color': 'red',
                  'axis': 2}]}),
    ('ping_cdf',
     {'description': 'Ping CDF plot',
      'type': 'cdf',
      'series': [{'data': 'Ping (ms) ICMP',
                  'label': 'Ping (ms)'},],
      'cutoff': (DELAY,DELAY)}),
    ])
