コード例 #1
0
ファイル: Chart.py プロジェクト: xcma/selenium
    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