GithubHelp home page GithubHelp logo

interfaceconcurrent's Introduction

interfaceconcurrent

  Spring Boot 接口并发测试,开启多线程使用Http 请求并行测试接口来测试并发。

测试接口说明

  此处测试注册接口
  http://localhost:8080/manage/app/user/register
  测试项目代码未提交到Github,下面简单说明一下注册接口。

    /**
     * 用户注册
     * @param baseResult
     * @return
     */
    @RequestMapping(value = "user/register" , produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public BaseResult UserRegister(@RequestBody BaseResult baseResult){
        customFile.info( "appId:"+ baseResult.getTreasureID()+"用户注册访问:" + baseResult.toString() );
        return appUserService.userRegister(baseResult);
    }

  请求参数封装

public class BaseResult implements Serializable {

    private static final long serialVersionUID = 3401781428101852075L;

    private String ip;

    /**
     * appId
     */
    private String treasureID;

    /**
     * 请求响应加密数据
     */
    private String treasureData;

    /**
     * desKey
     */
    private String treasureDESKey;
    ...
}

测试方式

  开启多线程通过Http 请求并行访问接口。

测试结果

这是一张图片

TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 请求数据 - {"treasureID":"402216352","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk=","treasureData":"{\"userPhone\":\"15738539120\",\"userPassword\":\"1357ac90\",\"phoneCode\":\"666666\"}"}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}
TransObjectByHttp: 返回数据 - {"ip":null,"treasureID":"402216352","treasureData":"{\"errCode\":\"100188\",\"errMsg\":\"当前用户已经注册过\",\"responseTime\":\"1536737371\",\"result\":{\"flag\":false}}","treasureDESKey":"u+p50xk3Ak0sdCP2OfB144Vi/sBPl/UbXE0qVyYOoWopjky9Cj2TbfptQuFRAno8LrREdL43JQTI6IZR1bGT/tRBTAEySbMaSCqAKBMplRPCnJoF6hsux0oJ2o/dJW+q9MRmtdwOCVWjfsp25nrkCwt6TTbiYAmULWrkC/8Mwlk="}

interfaceconcurrent's People

Contributors

niaonao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.