PDF
1Vert.X(2)Vert.xSpringBootCPUContents .................................................................................................... 1 ............................................................................................... 1 ............................................................................................... 4线线线便API@GetMapping("/api/v1/{app}")public AppInfo getAppInfoV1(@PathVariable String app) throws JsonProcessingException, InvalidRequestException, AppNotFoundException { return service.getAppInfo(app);}西 2@GetMapping("/api/v2/{app}")public ResponseEntity<AppInfo> getAppInfoV2(@PathVariable String app) throws InvalidRequestException, AppNotFoundException { AppInfo info = service.getAppInfo(app); return ResponseEntity.ok() .header("Signature", service.getSign(info)) .body(info);}@PostMapping("/api/v1/{app}")public ResponseEntity<AppInfo> getAppInfoV1ByPost(@PathVariable String app, @RequestBody Request request) throws InvalidRequestException, AppNotFoundException { AppInfo info = service.getAppInfo(app); return ResponseEntity.ok() .header("nonce", request.getNonce()) .body(info);}@PostMapping("/api/v2/{app}")public ResponseEntity<AppInfo> getAppInfoV2ByPost(@PathVariable String app, @RequestBody Request request) throws InvalidRequestException, AppNotFoundException, JsonProcessingException { AppInfo info = service.getAppInfo(app); return ResponseEntity.ok() .header("Signature", service.getSign(info, request.getNonce())) .body(info);}使Router router = Router.router(vertx);router.get("/api/v1/:app") .handler(context -> { String app = context.pathParam("app"); AppInfo info = service.getAppInfo(app); context.json(info); }).failureHandler(errorHandler); 3Docker使便version: "2.4"services: app-springboot: build: context: ./springboot dockerfile: ./Dockerfile image: springboot-app:latest ports: - "8081:8080" mem_limit: 4096m cpus: 4.0 app-vertx: build: context: ./vertx dockerfile: ./Dockerfile image: vertx-app:latest ports: - "8082:8080" mem_limit: 4096m cpus: 4.0jmeter便线 4使使便使${__P(threads, 1)}使./apache-jmeter-5.2.1/bin/jmeter -n -t benchmark.jmx \ -J threads=3000 \ -J seconds=0 \ -J loop=100 \ -l result.jtl \ -j result.log 5

HTML view coming soon.

Download PDF for the full formatted version.