def process_data(data):
  global metric
  #print data
  if data['type'] == 'request':
    time = ((1000/data['time'])/granularity)*granularity
    TIME_LENGTH=10

    try:
      metric["%s-%s" % (time, data['host'])] += 1
    except:
      metric["%s-%s" % (time, data['host'])] = 1

    if b.check():
      #using slices in these because it seems faster..
      for k,v in metric.items():
        time, host = k[0:10], k[11:]
        r.zincrby(time+"-hosts", host, v)

      metric.clear()
dataset/ETHPy150Open rawdigits/bouncer/example/redis-loaders/host.py/process_data/swapped operands of `/`