Example #1
0
def __stats_update():
  from time import sleep
  iopoll = IOPoll()
  with iopoll.loop():
    while _running:
      try:
        client = StatsClient()
        with client.connection(iopoll, '127.0.0.1', 11217):
          while _running:
            _rusage.append((time(), client.rusage()))
            _global_data['cpu'] = _data_cpu(_rusage)
            _global_data['ctxswitch'] = _data_ctxswitch(_rusage)
            _global_data['io'] = _data_io(_rusage)

            _memusage.append((time(), client.memusage()))
            _global_data['mem'] = _data_mem(_memusage)
            _global_data['malloc'] = _data_malloc(_memusage)

            _iousage.append((time(), client.iopoll()))
            _global_data['iopoll'] = _data_iopoll(_iousage)

            sleep(1)
      except Exception as e:
        print e
        sleep(1)
Example #2
0
def main():
  iopoll = IOPoll()
  with iopoll.loop():
    NTHREADS = 8
    client = RaleighClient()
    with client.connection(iopoll, _RaleighJob.RALEIGH_HOST, _RaleighJob.RALEIGH_PORT):
      print 'Bench Ping'
      bench_run(NTHREADS, PingJob, None)
Example #3
0
def main():
  iopoll = IOPoll()
  with iopoll.loop():
    NTHREADS = 8
    client = RaleighClient()
    with client.connection(iopoll, _RaleighJob.RALEIGH_HOST, _RaleighJob.RALEIGH_PORT):
      object_name = 'bench-number'
      data = client.semantic_create(object_name, RaleighNumber.TYPE)
      try:
        print 'Bench Number-Insert'
        bench_run(NTHREADS, NumberIncJob, data['oid'])
        print 'Bench Number-Get'
        bench_run(NTHREADS, NumberGetJob, data['oid'])
      finally:
        client.semantic_delete(object_name)
Example #4
0
 def run(self):
   iopoll = IOPoll()
   with iopoll.loop():
     client = RaleighClient()
     client.REPLY_MAX_WAIT = 20
     with client.connection(iopoll, self.RALEIGH_HOST, self.RALEIGH_PORT):
       exception = None
       nrequests = 0
       st = time()
       try:
         nrequests, exception = self.execute(client)
       except Exception as e:
         exception = e
       finally:
         et = time()
       return (et - st, nrequests, exception)