非正规集成+压力测试

非正规集成测试和性能测试 6月份公司最重要的续费活动就要开始了,期间功能方面的改动不是特别大。但需要做性能测试和全部数据方面的验证。 基于以上(全部数据的验证、性能测试)目的,于是需要对接口进行性能测试。 1、工具调研 在工具调研方面,市面上常见的性能测试工具有以下。 JMeter Apache Bench TestNG LoadRunner 基于熟悉上手和对公司业务数据的了解程度,最后选择了TestNG。原因有: 编码方便,灵活 数据驱动方式还不错 灵活的设置线程数 基于TestNG可以很灵活的设计一样宽表来保存结果集。 最后设计的表结构如下 create table renewalintegrationtesting.t_2023_renewal_list ( id bigint auto_increment primary key, student_num varchar(128) null, student_id varchar(36) null, phone varchar(255) null, customer_id varchar(500) null, app_token varchar(255) null, authorization varchar(255) null, step1_url varchar(500) null comment '步骤一的接口地址', step1_request text null, step1_response text null, step1_success tinyint default 0 not null comment '步骤一执行结果0-不成功1-成功', step2_url varchar(500) null comment '步骤二的接口地址', step2_request text null, step2_response text null, step2_success tinyint default 0 not null comment '步骤二执行结果0-不成功1-成功', step3_url varchar(500) null comment '步骤3的接口地址', step3_request text null, step3_response text null, step3_success tinyint default 0 not null comment '步骤3执行结果0-不成功1-成功', step4_url varchar(500) null comment '步骤4的接口地址', step4_request text null, step4_response text null, step4_success tinyint default 0 not null comment '步骤4执行结果0-不成功1-成功', step5_url varchar(500) null comment '步骤5的接口地址', step5_request text null, step5_response text null, step5_success tinyint default 0 not null comment '步骤5执行结果0-不成功1-成功', step6_url varchar(500) null comment '步骤6的接口地址', step6_request text null, step6_response text null, step6_success tinyint default 0 not null comment '步骤6执行结果0-不成功1-成功', step7_url varchar(500) null comment '步骤7的接口地址', step7_request text null, step7_response text null, step7_success tinyint default 0 not null comment '步骤7执行结果0-不成功1-成功', step8_url varchar(500) null comment '步骤8的接口地址', step8_request text null, step8_response text null, step8_success tinyint default 0 not null comment '步骤8执行结果0-不成功1-成功', step9_url varchar(500) null comment '步骤9的接口地址', step9_request text null, step9_response text null, step9_success tinyint default 0 not null comment '步骤9执行结果0-不成功1-成功', step10_url varchar(500) null comment '步骤10的接口地址', step10_request text null, step10_response text null, step10_success tinyint default 0 not null comment '步骤10执行结果0-不成功1-成功' ); 2、测试用例的编写 示例测试用例代码如查看订单列表

apache shenyu重构之AbstractShenyuPlugin

重构AbstractShenyuPlugin.execute()方法 原来的执行流程 initMatchCacheConfig(); String pluginName = named(); PluginData pluginData = BaseDataCache.getInstance().obtainPluginData(pluginName); if (Objects.nonNull(pluginData) && pluginData.getEnabled()) { final String path = exchange.getRequest().getURI().getPath(); SelectorData selectorData = obtainSelectorDataCacheIfEnabled(exchange); if (Objects.isNull(selectorData)) { List<SelectorData> selectors = BaseDataCache.getInstance().obtainSelectorData(pluginName); if (CollectionUtils.isEmpty(selectors)) { return handleSelectorIfNull(pluginName, exchange, chain); } Pair<Boolean, SelectorData> matchSelectorData = matchSelector(exchange, selectors); selectorData = matchSelectorData.getRight(); if (Objects.isNull(selectorData)) { if (matchCacheConfig.getSelectorEnabled() && matchSelectorData.getLeft()) { selectorData = new SelectorData(); selectorData.setPluginName(named()); cacheSelectorData(path, selectorData); } return handleSelectorIfNull(pluginName, exchange, chain); } else { if (matchCacheConfig.

apache shenyu 介绍

shenyu是什么 是一个java实现的网关、高性能、跨语言的、响应式API网关。 架构图 模块说明 admin 管理后台和配置模块 bootstrap 程序的主入口 client 客户端模块,提供支持Spring MVC 、Dubbo 、Spring Cloud 快速访问 disruptor 基于disruptor的封装 register-center shenyu-client提供各种rpc接入注册中心的支持 common 框架的通用类 dist 构建项目 metrics prometheus(普罗米修斯)实现的 metrics plugin 插件集合 spin 定义的spi spring-boot-starter 支持 spring-boot-starter sync-data-center 提供 ZooKeeper,HTTP,WebSocket,Nacos 的方式同步数据 examples 示例模块 web 包括插件、请求路由和转发等核心处理包

redis使用分布式锁记

使用redis分布式锁记 背景介绍 在项目中使用封装的redis锁注解中,会出现异常信息。抛出拿分布式锁异常。 跟源码 其中lock对象为false的情况下会抛出Get redis lock failed的业务异常 @Around("redisLockPoint() && @annotation(redisLock)") public Object around(ProceedingJoinPoint pjp, RedisLock redisLock) throws Throwable { String key = redisLock.key(); if (StringUtils.isBlank(key)) { Object[] args = pjp.getArgs(); if (redisLock.bindType().equals(RedisLock.BindType.DEFAULT)) { key = StringUtils.join(args); } else if (redisLock.bindType().equals(RedisLock.BindType.ARGS_INDEX)) { key = getArgsKey(redisLock, args); } else if (redisLock.bindType().equals(RedisLock.BindType.OBJECT_PROPERTIES)) { key = getObjectPropertiesKey(redisLock, args); } } Assert.hasText(key, "key does not exist"); String prefix = redisLock.prefix()+"_"; boolean lock = distributedRedisLock.lock(prefix + key, redisLock.

bug 记录

bug清单表格 1、springboot上传文件,报流关闭错误 现象 : springboot上传文件,报流关闭错误 原因 : 项目中增加了全局的GlobalWebAppConfig,其中的配置导致流关闭失效 解决方式 : 移除@EnableWebMvc注解 过程总结 : 本地复现 定位问题点 (移除pom),注释依赖 确定问题点确实是新增配置 网上搜索解决方式 记录时间 : 2021-08-21 2、某些sql会在limit后追加一个limit,导致查询sql报错 现象 : 某些sql会在limit后追加一个limit,导致查询sql报错 原因 : PageHelper 非安全调用方式,项目中使用方式为PageHelper.startPage,此种方式背后实现原理为: ThreadLocal设置线程局部变量,tomcat线程次会缓存请求,可能导致threadlocal中的线程变量被其他线程访问到 解决方式 : springmvc层增加全局的拦截器, 然后手动移除一下pageHelper的变量 过程总结 : 定位问题 网上搜索确实发现limit可能会是pagehelper导致 再次定位threadlocal设置变量,设置tomcat工作线程设置为1个 本地手写分页复现场景,分页参数设置,未查询数据库,手动触发报错 增加全局分页拦截器解决 记录时间 : 2021-08-21 3、请求接口,返回90044错误 现象 : 请求接口,返回90044错误 原因 : 2.0网关配置中,只建立了bi的服务,在角色那一栏并未配置bi相关的服务 解决方式 : 2.0网关配置erp-api的相关权限 1、定位问题9004 2、查询9004为请求接口超出授权范围 3、访问灰度复现出改问题 过程总结 : 定位问题9004 查询9004为请求接口超出授权范围 访问灰度复现出改问题 找运维老师确认2.0网关的配置问题 确认配置问题、增加配置 记录时间 : 2021-08-23 4、小程序获取手机号授权,并未生成响应的学员记录 现象 : 小程序获取手机号授权,并未生成响应的学员记录 原因 : 营销服务调用crm服务,crm服务新增授权类型客户的时候没有写入电话字段 解决方式 : 入口出增加电话字段 过程总结 : httplog寻找入参数, ```sql select * from alc-http-log.