source/load-testing/test-beacon.py [10:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def getEvent():
  events = {
    0 : 'click',
    1 : 'pageview',
    2 : 'conversion',
    3 : 'exception',
    4 : 'playvideo',
    5 : 'login',
    6 : 'logoff'
  }
  return events[random.randint(0,6)]

def getPage():
  return 'page_' + str(random.randint(1,100)) + '.html'

def getUser():
  return 'user' + str(random.randint(1,1000)) 

def getReferer():
  return 'referer_' + str(random.randint(1,20))

def getUserAgent():
  return 'python_manual_agent_' + str(random.randint(1,20))

def getIntMetricName():
  custom_metrics = {
    0 : 'page_load_time',
    1 : 'cart_item_quantity',
    2 : 'impression_count',
    3 : 'idle_time_ms',
    4 : 'mouse_distance_pixles'
  }
  return custom_metrics[random.randint(0,4)]

def getStringMetricName():
  custom_metrics = {
    0 : 'poll_response',
    1 : 'display_x_y',
    2 : 'blocker_type',
    3 : 'browser_version'
  }
  return custom_metrics[random.randint(0,3)]

def getFloatMetricName():
  custom_metrics = {
    0 : 'purchase_amount',
    1 : 'gpu_driver_version',
    2 : 'page_percent_displayed',
    3 : 'video_stopped_location',
    4 : 'compute_render_time'
  }
  return custom_metrics[random.randint(0,4)]

def getIntMetricValue():
  return str(random.randint(0,100))

def getFloatMetricValue():
  return str(random.random() * random.randint(0,100))

def getStringMetricValue():
  return  "dummy_string_value_" + str(random.random() * random.randint(0,10)) 

parser = argparse.ArgumentParser()
parser.add_argument("target", help="<http...> the http(s) location to send the GET request")
parser.add_argument("calls", help="the number of HTTP calls to make")
parser.add_argument("delay", help="the time in seconds to delay between calls (ie 0.5 is half a second)")

args = parser.parse_args()
i = 0
s = requests.Session()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/web_site/test-beacon.py [10:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def getEvent():
  events = {
    0 : 'click',
    1 : 'pageview',
    2 : 'conversion',
    3 : 'exception',
    4 : 'playvideo',
    5 : 'login',
    6 : 'logoff'
  }
  return events[random.randint(0,6)]

def getPage():
  return 'page_' + str(random.randint(1,100)) + '.html'

def getUser():
  return 'user' + str(random.randint(1,1000)) 

def getReferer():
  return 'referer_' + str(random.randint(1,20))

def getUserAgent():
  return 'python_manual_agent_' + str(random.randint(1,20))

def getIntMetricName():
  custom_metrics = {
    0 : 'page_load_time',
    1 : 'cart_item_quantity',
    2 : 'impression_count',
    3 : 'idle_time_ms',
    4 : 'mouse_distance_pixles'
  }
  return custom_metrics[random.randint(0,4)]

def getStringMetricName():
  custom_metrics = {
    0 : 'poll_response',
    1 : 'display_x_y',
    2 : 'blocker_type',
    3 : 'browser_version'
  }
  return custom_metrics[random.randint(0,3)]

def getFloatMetricName():
  custom_metrics = {
    0 : 'purchase_amount',
    1 : 'gpu_driver_version',
    2 : 'page_percent_displayed',
    3 : 'video_stopped_location',
    4 : 'compute_render_time'
  }
  return custom_metrics[random.randint(0,4)]

def getIntMetricValue():
  return str(random.randint(0,100))

def getFloatMetricValue():
  return str(random.random() * random.randint(0,100))

def getStringMetricValue():
  return  "dummy_string_value_" + str(random.random() * random.randint(0,10)) 

parser = argparse.ArgumentParser()
parser.add_argument("target", help="<http...> the http(s) location to send the GET request")
parser.add_argument("calls", help="the number of HTTP calls to make")
parser.add_argument("delay", help="the time in seconds to delay between calls (ie 0.5 is half a second)")

args = parser.parse_args()
i = 0
s = requests.Session()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



