-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
116 lines (91 loc) · 2.72 KB
/
config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import logging
LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
DATE_FORMAT = "%m/%d/%Y %H:%M:%S %p"
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT, datefmt=DATE_FORMAT)
log = logging.getLogger()
redis_config = {
"daily": "daily",
"long_running": "long_running"
}
csv_config = {
'file_dir': "",
'goreplay_data_dir_name': "goreplay",
'server_result': "server_result",
'compare_result': "result",
'backup': "backup",
'pt_source_parent_dir': "pt_source_parent_dir",
'pt_source_file': "pt_source_file",
'long_running_result': "long_running_result",
}
mysql_config = {
'enable': False,
'host': "localhost",
'port': 3306,
'database': "",
'user': 'root',
'password': '',
'charset': 'utf8'
}
ke_config = {
"Authorization": "",
"urls": [
"",
""
] # The 1st is base line, and others is compare line.
}
tags_recognized: (str, str) = {
}
class _TagsLabel(object):
@property
def not_found(self):
return 'NOT_FOUND'
@property
def sql_error(self):
return 'SQL_ERROR'
@property
def success(self):
return 'SUCCESS'
@property
def unrecognized(self):
return 'UNRECOGNIZED'
@property
def fallback(self):
return 'FALLBACK'
@property
def diff_duration_20(self):
return 'DIFF_DURATION_20'
@property
def diff_duration_100(self):
return 'DIFF_DURATION_100'
@property
def diff_time(self):
return 'DIFF_TIME'
@property
def unstable(self):
return 'UNSTABLE'
TagsLabel = _TagsLabel()
NOT_SAVE_RECORD_SET: set = {
TagsLabel.not_found, TagsLabel.sql_error, TagsLabel.diff_duration_20, TagsLabel.diff_duration_100,
TagsLabel.diff_time
}
for t in tags_recognized.items():
NOT_SAVE_RECORD_SET.add(t[1])
NOT_BACKUP_RECORD_SET: set = {
TagsLabel.not_found, TagsLabel.sql_error
}
tags: (str, str) = {
"find project": TagsLabel.not_found,
"not found": TagsLabel.not_found,
"Illegal use of": TagsLabel.sql_error,
"No such file or directory": "NO_SUCH_FILE_OR_DIRECTORY",
"Cannot parse input": "CSV_PARSER",
"Not enough spark off-heap execution memory": "OFF_HEAP",
"The query exceeds the set time limit of": "TIME_OUT",
"Input path does not exist": "NO_SUCH_FILE_OR_DIRECTORY",
"ObjectInputStream.readOrdinaryObject": "VERSION_DIFF",
"From line ": TagsLabel.sql_error,
"AmazonS3Exception: Forbidden (Service: Amazon S3": "S3_AUTH",
"Executor heartbeat timed out": "HEARTBEAT_TIMEOUT",
"Failed to get object info: No response body.. HTTP response code: 404": "NO_SUCH_FILE_OR_DIRECTORY"
}
PERFORMANCE_RANGE: list = [-100, -10, -2, -1, -0.5, -0.2, 0, 0.2, 0.5, 1, 2, 10, 100]