jmeter多并发对比单并发性能衰减

from openpyxl import load_workbook,Workbook

class DoExcel:
    def __int__(self,filepath):
        self.wb = load_workbook(filepath)
        self.sh=self.wb.active
        
    def read_excel(self):
        all_casedatas=[]
        for row in range(2,self.sh.max_row+1):
            case_data={}
            case_data[self.sh.cell(row=row,column=1).value]=self.sh.cell(row=row,column=5).value
            all_casedatas.append(case_data)
        return all_casedatas
    
single = DoExcel(r"文件路径名").read_excel()
twenty = DoExcel(r"文件路径名").read_excel()
fifty = DoExcel(r"文件路径名").read_excel()
wb = Workbook()
#单线程
for x in range(0,len(single)):
    for SingleKey,Singlevalue in single[x].items():
        print(x,SingleKey,Singlevalue)
        #20线程
        for i in range(0,len(twenty)):
            for TwentyKey, Twentyvalue in twenty[i].items():
                print(i, TwentyKey, Twentyvalue)
                if SingleKey.find(TwentyKey)!=-1:
                    for y in range(0,len(fifty)):
                        for fiftyKey,fiftyValue in fifty[y].items():
                            if SingleKey.find(TwentyKey) !=-1 and SingleKey.find(fiftyKey) != -1:
                                AttenuationValue1 = (Twentyvalue-Singlevalue)/Singlevalue
                                AttenuationValue2 = (fiftyValue-Singlevalue)/Singlevalue
                                ws=wb.active
                                # 接口名称
                                ws.cell(row=x+2,column=1,value=SingleKey)
                                #单线程90%line
                                ws.cell(row=x+2,column=2,value=Singlevalue)
                                # 多线程90line
                                ws.cell(row=x+2,column=3,value=Twentyvalue)
                                # 性能衰减
                                ws.cell(row=x+2,column=4,value=attenuationValue1)
                                ws.cell( row=x+2, column=5, value= fiftyValue)
                                ws.cell( row= x+2, column=6, value= Attenuation Value2)
                                
                                wb.save(r"D\性能衰减表单.xlsx")
                                
                            
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值