• 测试工具


    前言

    类型 版本
    操作系统 Mac os / Linux
    IDEA 2019.03

    Jvm-Sandbox-Repeater部署

    1、下载源码

    git clone https://github.com/alibaba/jvm-sandbox-repeater
    

    2、调整 console 工程中MySQL 的数据库配置信息

    #repeater-console/repeater-console-start/src/main/resources/application.properties
    
    # 本地mysql数据源测试
    spring.datasource.url=jdbc:mysql://localhost:3306/repeater?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=false
    spring.datasource.username=root
    spring.datasource.password=xxxxx
    spring.datasource.driver-class-name=com.mysql.jdbc.Driver
    spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
    spring.jpa.show-sql=false
    spring.jpa.hibernate.ddl-auto=none
    

    3、初始化数据库

    repeater-console/repeater-console-dal/src/main/resources/database.sql
    

    4、修改官方 Console 源码问题

    1) 把 repeater-console/repeater-console-start/src/main/resources/velocity 下面的所有文件,查找 #parse("/blocks ,统一改替换为 #parse("blocks ;
    2) 修改 repeater-console/repeater-console-start/src/main/java/com/alibaba/repeater/console/start/controller/page/ReplayController.java 中的 return "/replay/detail"; ,改为 return "replay/detail";
    3) 修改 repeater-console/repeater-console-start/src/main/java/com/alibaba/repeater/console/start/controller/test/RegressPageController.java 中的 return "/regress/index"; ,改为 return "regress/index"。
    

    5、编译并启动 Console

    # 在 repeater 项目根目录进行
    mvn install -DskipTests && java -jar repeater-console/repeater-console-start/target/*.jar
    

    6、安装 repeater

    # 再 repeater 项目根目录得 bin 目录下执行
    cd bin
    sh install-repeater.sh
    

    7、启动被测程序

    # 下载源码
    git clone https://github.com/chenhengjie123/gs-rest-service
    
    # 在示例项目 clone 后的根目录中运行
    cd complete 
    mvn install && java -jar target/*.jar
    

    8、启动 Sandbox attch 被测程序

    sh ~/sandbox/bin/sandbox.sh -p `ps -ef | grep "target/gs-rest-service-0.1.0.jar" | grep -v grep | awk '{print $2}'` -P 12580
    

    9、进入前端配置页面
    http://127.0.0.1:8001/regress/index.htm

    10、进入配置管理,添加信息
    应用名:unknown
    环境名:unknown

    {
      "useTtl" : true,
      "degrade" : false,
      "exceptionThreshold" : 1000,
      "sampleRate" : 10000,
      "pluginsPath" : null,
      "httpEntrancePatterns" : [ "^/greeting.*$" ],
      "javaEntranceBehaviors" : [ {
        "classPattern" : "hello.GreetingController",
        "methodPatterns" : [ "greeting" ],
        "includeSubClasses" : false
      } ],
      "javaSubInvokeBehaviors" : [],
      "pluginIdentities" : [ "http", "java-entrance", "java-subInvoke", "mybatis", "ibatis" ],
      "repeatIdentities" : [ "java", "http" ]
    }
    

    11、查看在线模块,可以看到被监控信息

    12、发送请求

    curl -s 'http://localhost:8080/greeting'
    curl -s 'http://localhost:8080/greeting?name=User'
    

    13、进入在线流量,查看录制得数据

  • 相关阅读:
    docker容器打包、镜像文件导入与导出 , 支持批量
    服务器高并发配置优化
    php集成财付通支付接口
    C# 防界面假死
    以二进制方式读取图片保存到string
    转载 C#开发串口总结,并提炼串口辅助类到公用类库中
    C# comport 打印图像
    C#实现MD5加密
    execute sp_executesql 用变量获取返回值
    C# 获取计算机cpu 硬盘 网卡信息
  • 原文地址:https://www.cnblogs.com/just4life/p/14694204.html
Copyright © 2020-2023  润新知