Exemple #1
0
    def getResTimelList(cls):
        """
        查询响应时间列表
        :return:[]
        """
        all_res_time = {}
        all_uptm = {}
        path = Misc.ABSpath() + "/Src/Conf/Config.yml"
        all_type = readConfig(path)['Api_all_type']
        for key, type in all_type.items():
            data = Chart.getData(type)
            if data:
                if_name_one = Misc.read_from_file('if_name_one_list')[0]
                # 根据if_name取出对应的res_time_list和uptm_list
                for name in if_name_one:
                    if_type = tr.getApiType(name)
                    if type == if_type:
                        res_time_list = []
                        uptm_list = []
                        for j in data:
                            if j['if_name'] == name:
                                res_time_list.append(j['res_time'])
                                uptm_list.append(j['uptm'])

                        res_time_list_thousand = [x*1000 for x in res_time_list]
                        all_res_time[name] = res_time_list_thousand

                        all_uptm[name] = uptm_list
        return all_res_time, all_uptm
Exemple #2
0
import os, sys, getopt, string, json
from Src.Function.Utils import *
from Src.Function.ReadConfig import readConfig

# utf-8
reload(sys)
sys.setdefaultencoding('utf8')

msg = "ParameterError:参数错误,You can get help in this way:[-h]"

# 若依赖的binary文件放在系统PATH下(如/usr/local/bin),1. 安装起来比较分散,2. 因权限等出了毛病难定位
# 故,放在当前目录的bin下,用脚本自动安装
os.environ["PATH"] += (os.pathsep + ABSpath() + '/bin')

Init_config_path_ym = ABSpath() + "/Src/Conf/InitParameter.yml"
value_all = readConfig(Init_config_path_ym)['value_all']

# 读value
level_value = value_all['level_value']
brower_value = value_all['brower_value']
report_value = value_all['report_value']
del_value = value_all['del_value']
backup_value = value_all['backup_value']
Main_value = value_all['Main_value']
email_value = value_all['email_value']
send_email_value = value_all['send_email_value']
url_value = value_all['url_value']
case_whitch_value = value_all['case_whitch_value']
# 初始值设置:
environment = readConfig(Init_config_path_ym)['Environment']['environment']
category_local = "Local"
Exemple #3
0

def ABSpath():
    """获取当前的绝对路径"""
    ABSPATH = os.path.abspath(sys.argv[0])
    ABSPATH = os.path.dirname(ABSPATH)
    return ABSPATH

msg = "ParameterError:参数错误,You can get help in this way:[-h]"

# 若依赖的binary文件放在系统PATH下(如/usr/local/bin),1. 安装起来比较分散,2. 因权限等出了毛病难定位
# 故,放在当前目录的bin下,用脚本自动安装
os.environ["PATH"] += (os.pathsep + ABSpath() + '/bin')

Init_config_path_ym = ABSpath() + "/Src/Conf/InitParameter.yml"
value_all = readConfig(Init_config_path_ym)['value_all']

# 读value
level_value = value_all['level_value']
brower_value = value_all['brower_value']
report_value = value_all['report_value']
del_value = value_all['del_value']
backup_value = value_all['backup_value']
Main_value = value_all['Main_value']
email_value = value_all['email_value']
send_email_value = value_all['send_email_value']
url_value = value_all['url_value']
case_whitch_value = value_all['case_whitch_value']
# 初始值设置:
environment = readConfig(Init_config_path_ym)['Environment']['environment']
category_local = "Local"