feat: test logging
This commit is contained in:
@ -13,7 +13,6 @@ import pickle
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
|
|
||||||
class RepState(Enum):
|
class RepState(Enum):
|
||||||
ADDED = 0
|
ADDED = 0
|
||||||
|
@ -5,7 +5,6 @@ import time
|
|||||||
from replication import ReplicatedDatablock, RepCommand,RepDeleteCommand
|
from replication import ReplicatedDatablock, RepCommand,RepDeleteCommand
|
||||||
from replication_graph import ReplicationGraph
|
from replication_graph import ReplicationGraph
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
STATE_INITIAL = 0
|
STATE_INITIAL = 0
|
||||||
|
@ -7,9 +7,11 @@ import time
|
|||||||
import cProfile
|
import cProfile
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
logging.basicConfig()
|
||||||
|
logging.getLogger().setLevel(logging.INFO)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SampleData():
|
class SampleData():
|
||||||
def __init__(self, map={"sample":"data"}):
|
def __init__(self, map={"sample":"data"}):
|
||||||
self.map = map
|
self.map = map
|
||||||
@ -231,14 +233,14 @@ class TestStressClient(unittest.TestCase):
|
|||||||
client.register(SampleData())
|
client.register(SampleData())
|
||||||
|
|
||||||
while len(client2._rep_store.keys()) < 10000:
|
while len(client2._rep_store.keys()) < 10000:
|
||||||
time.sleep(0.001)
|
time.sleep(0.00001)
|
||||||
total_time+=0.001
|
total_time+=0.00001
|
||||||
|
|
||||||
# test_num_items = len(client2._rep_store.keys())
|
# test_num_items = len(client2._rep_store.keys())
|
||||||
server.stop()
|
server.stop()
|
||||||
client.disconnect()
|
client.disconnect()
|
||||||
client2.disconnect()
|
client2.disconnect()
|
||||||
logger.debug("{} s for 10000 values".format(total_time))
|
logger.info("{} s for 10000 values".format(total_time))
|
||||||
|
|
||||||
self.assertLess(total_time,1)
|
self.assertLess(total_time,1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user