Esempio n. 1
0
 def stop(n=0, e=0):
     global stop_flag
     logger.error("stopping.....")
     for t in tail:
         logger.error("stopping " + str(t))
         try:
             t.join(60)
         except:
             logger.error(traceback.format_exc())
     if conf.get_test_path() != "null":
         release()
     stop_flag = True
Esempio n. 2
0
 def stop(n=0, e=0):
     global stop_flag
     logger.error("stopping.....")
     for t in tail:
         logger.error("stopping " + str(t))
         try:
             t.join(60)
         except:
             logger.error(traceback.format_exc())
     if conf.get_test_path() != "null":
         release()
     stop_flag = True
Esempio n. 3
0
basepath = os.path.dirname(__file__)
logging.config.fileConfig(basepath + "/../conf/log.conf")


class PublishThread(threading.Thread):
    def __init__(self, t):
        self.id = id
        self.m = "aadfaddaffdf"
        self.t = t
        threading.Thread.__init__(self)

    def run(self):
        times = range(10)
        for i in times:
            time.sleep(1)
            post(self.t, self.m + str(i))


if __name__ == '__main__':
    use(passport("jiugao", "1111"))
    t = tunnel("t1")
    threads = []
    threadnum = range(10)
    for i in threadnum:
        pt = PublishThread(t)
        pt.start()
        threads.append(pt)

    [t.join() for t in threads]
    release()
Esempio n. 4
0
basepath = os.path.dirname(__file__)
logging.config.fileConfig(basepath + "/../conf/log.conf")

class PublishThread(threading.Thread):
    def __init__(self, t):
        self.id = id
        self.m = "aadfaddaffdf"
        self.t = t
        threading.Thread.__init__(self)
     
    def run(self):
        times = range(10)
        for i in times:
            time.sleep(1)
            post(self.t, self.m + str(i))


if __name__ == '__main__':
    use(passport("jiugao", "1111"))
    t = tunnel("t1")
    threads = []
    threadnum = range(10)
    for i in threadnum:
        pt = PublishThread(t)
        pt.start()
        threads.append(pt)
        
    [t.join() for t in threads] 
    release()
Esempio n. 5
0
#! /usr/bin/env python
#encoding=utf-8
'''
Created on 2010-10-25

@author: jiugao
'''
from client.TimeTunnel2 import use, passport, tunnel, post, release
import logging.config
import os


basepath = os.path.dirname(__file__)
logging.config.fileConfig(basepath + "/../conf/log.conf")

if __name__ == '__main__':
    use(passport("jiugao", "1111"))
    t = tunnel("t1")
    m = "hello"
    times = range(100)
    for i in times:
        post(t, m)
            
    release();