-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
executable file
·48 lines (37 loc) · 1.05 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/python
# coding=utf-8
from pprint import pprint
import chronic
from core.term_test import TermTestManage
from core.flow import Flow
__author__ = 'GaoJie'
TERM_FILE = 'data/term_list.txt'
DIM_FILE = 'data/dim_list.txt'
if __name__ == '__main__':
test_time = '2014-06-10'
test_table = 'RTBApp'
with chronic.Timer('create'):
manage = TermTestManage()
# 加载基础维度
fo = open(DIM_FILE, 'r')
lines = fo.readlines()
manage.load_dim(lines)
fo.close()
del lines
# 加载修正组合
fo = open(TERM_FILE, 'r')
lines = fo.readlines()
manage.load(lines)
fo.close()
del lines
f = Flow(test_time, test_table)
#load_dim()
#dim_dict_combine = dim_combine()
#term_map = get_termmap(dim_dict_combine)
with chronic.Timer('test'):
value = f.total_current(7)
manage.estimate(term_map={'DeviceType': [1]}, total=value)
# 计算单次执行时间
pprint(chronic.timings)
while True:
continue