提交 3c4f196d 编写于 作者: D dingbo

docs: mockdatasoruce.py

上级 ca9a65d7
......@@ -139,12 +139,14 @@ def main():
for i in range(WRITE_TASK_COUNT):
queue = Queue(max_size_bytes=QUEUE_SIZE)
task_queues.append(queue)
# create write processes
for i in range(WRITE_TASK_COUNT):
p = Process(target=run_write_task, args=(i, task_queues[i]))
p.start()
logging.debug(f"WriteTask-{i} started with pid {p.pid}")
write_processes.append(p)
# create read processes
for i in range(READ_TASK_COUNT):
p = Process(target=run_read_task, args=(i, task_queues))
......
......@@ -3,11 +3,11 @@ import time
class MockDataSource:
samples = [
"LosAngeles,0,8.8,119,0.32",
"SanDiego,1,10.7,116,0.34",
"Hollywood,2,9.9,111,0.33",
"Compton,3,8.9,113,0.329",
"San Francisco,4,9.4,118,0.141"
"8.8,119,0.32,LosAngeles,0",
"10.7,116,0.34,SanDiego,1",
"9.9,111,0.33,Hollywood,2",
"8.9,113,0.329,Compton,3",
"9.4,118,0.141,San Francisco,4"
]
def __init__(self, tb_name_prefix, table_count):
......@@ -22,7 +22,7 @@ class MockDataSource:
data = []
for i in range(self.table_count):
table_name = self.table_name_prefix + str(i)
# tbName,location,groupId,current,voltage,phase
# tbName,current,voltage,phase,location,groupId
row = table_name + ',' + lines[i]
data.append((i, row)) # tableId, row
return data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册