def get_testResultOrderByIfName(self): """ 查询y接口状态 :param if_name:'a01' :return:[{}] """ kwargs = dict(table=self.table, order='if_name') return Base.select(self, **kwargs)
def get_testResultByIfName(self, if_name): """ 查询y接口状态 :param if_name:'a01' :return:{} """ where = "if_name='%s'" % if_name kwargs = dict(table=self.table, where=where) return Base.select(self, **kwargs)
def get_testResultByUrl(self, url): """ 根据url查询全部数据 :param url: :return: """ where = "url_target LIKE '"+url+"%'" kwargs = dict(table=self.table, where=where) return Base.select(self, **kwargs)
def get_testShortUrlByTag(self, short_tag): """ 查询y接口状态 :param short_tag:'ssdf' :return:{} """ where = "short_tag='%s'" % short_tag kwargs = dict(table=self.table, where=where) return Base.select(self, **kwargs)
def getApiPassRateWphByIfName(self, if_name): """ 查询y接口通过率 :param if_name:'a01' :return:{} """ data = "round(((`pass_num`)/(fail_num+pass_num)*100),2) AS pass_rate, if_name" where = "if_name='%s'" % if_name kwargs = dict(data=data, table=self.table, where=where) return Base.select(self, **kwargs)
def get_apiPerformanceAvgByIfName(self, if_name): """ 查询y接口响应时间 :param if_name:'a01' :return:{} """ data = "if_name,res_time_avg" where = "if_name='%s'" % if_name kwargs = dict(data=data, table=self.table, where=where) return Base.select(self, **kwargs)
def get_apiPerformanceAvgByIfName(self, if_name): """ 查询接口平均响应时间 :param if_name: :return: {} """ data = "round(AVG(res_time),4) as res_time,if_name" where = "if_name='%s'" % if_name kwargs = dict(data=data, table=self.table, where=where) return Base.select(self, **kwargs)
def select(self, data='', where='', limit='', order='', group=''): """ 查询当前表 :param data: :param where: :param limit: :param order: :param group: :return: """ kwargs = dict(data=data, table=self.table, where=where, limit=limit, order=order, group=group) return Base.select(self, **kwargs)
def select_todo(self, data='', where='', limit='', order='', group=''): kwargs = dict(data=data, table=self.table, where=where, limit=limit, order=order, group=group) result = Base.select(self, **kwargs) return result
def get_testResultByUrl(self, url): where = "url_target LIKE '"+url+"%'" kwargs = dict(table=self.table, where=where) return Base.select(self, **kwargs)
def get_allType(self): data = "DISTINCT type" kwargs = dict(data=data, table=self.table) return Base.select(self, **kwargs)