Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完善user-guide #61

Merged
merged 8 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@

![1669969036417](./images/guide/1669969036417.png)

*<font color="#415ff">应用名称</font>:* server端接口 /api/app/appNameList 返回,server部署前需修改为用户自身应用标识。需要注意的是,**<font color="#dd0000">jvm参数需包含该应用标识</font>**,否则”远程录制“方式无法启动
<font color="#415ff">应用名称</font>: server端接口 /api/app/appNameList 返回,server部署前需修改为用户自身应用标识。需要注意的是,**<font color="#dd0000">jvm参数需包含该应用标识</font>**,否则”远程录制“方式无法启动

<font color="#415ff">单接口采集量</font>:单个接口的最大采集量

<font color="#415ff">任务运行时长</font>:录制任务运行时长,超过该时长后,录制任务为自动关闭

**很多新手朋友对上面的"应用名称"和"jvm参数标识"表示疑惑,不知道如何配置和使用,补充说明如下:**
- 为了演示方便,**"应用名称"** 下拉列表对应的数据默认是在接口中硬编码实现的。生产使用时建议自行扩展,可以考虑从数据库、CMDB、注册中心/配置中心等中读取数据;
- **"jvm启动参数标识"** 是未做强制规范约定的,建议在目标应用启动脚本中使用类似"-DappName=item-center"(item-center是目标应用名/服务名)。

#### 流量采集配置

录制的流量类型,目前平台支持 http接口,dubbo接口和java方法的录制。
Expand All @@ -80,6 +84,10 @@

*<font color="#415ff">接口方法</font>:* 支持正则表达式。采集某个具体方法名:testRecord、采集所有方法:.*

##### motan接口

同上,参考dubbo

##### java方法录制

java方法录制比较特殊,由于是依托于spring实现,因此有如下限制:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public abstract class AbstractTaskRunService implements TaskRunService {

@Override
public void deleteByPkId(String taskRunId) {
TaskRunInfoWithBLOBs taskRunInfoWithBLOBs =getByTaskRunId(taskRunId);
TaskRunInfoWithBLOBs taskRunInfoWithBLOBs = getByTaskRunId(taskRunId);
TaskRunInfoWithBLOBs taskRunInfo = new TaskRunInfoWithBLOBs();
taskRunInfo.setDeleteState(DeleteStatus.DELETED.getStatus());
taskRunInfo.setId(taskRunInfoWithBLOBs.getId());
Expand Down Expand Up @@ -207,9 +207,9 @@ public MoonBoxResult<Void> taskRun(TaskRunReq taskRunReq) {
MoonBoxLogVO.MoonBoxLogVOBuilder builder = MoonBoxLogVO.builder().taskRunId(taskRunInfo.getTaskRunId());
MoonBoxResult<Void> returnResult = null;
try {
String result =agentDistributionService.startAgent(dbTaskRunInfo);
String result = agentDistributionService.startAgent(dbTaskRunInfo);
dbUpdate.setRunStatus(TaskRunStatus.RUNNING.getCode());
builder.content("agent启动执行结果:"+result);
builder.content("agent启动执行结果:" + result);
returnResult = MoonBoxResult.createSuccess();
} catch (Exception e) {
dbUpdate.setRunStatus(TaskRunStatus.FAILED.getCode());
Expand All @@ -230,7 +230,7 @@ public MoonBoxResult<Void> reRun(String taskRunId, String runUser, ReRunType reR

@Override
public void stop(String taskRunId, String runUser) {
TaskRunInfoWithBLOBs taskRunInfoWithBLOBs =getByTaskRunId(taskRunId);
TaskRunInfoWithBLOBs taskRunInfoWithBLOBs = getByTaskRunId(taskRunId);
TaskRunInfoWithBLOBs update = new TaskRunInfoWithBLOBs();
update.setRunStatus(TaskRunStatus.STOP_RUN.getCode());
update.setUpdateUser(runUser);
Expand All @@ -250,7 +250,7 @@ TaskRunInfoWithBLOBs getByTaskRunId(String taskRunId) {
TaskRunInfoExample taskRunInfoExample = new TaskRunInfoExample();
taskRunInfoExample.createCriteria().andTaskRunIdEqualTo(taskRunId);
List<TaskRunInfoWithBLOBs> taskRunInfo = taskRunInfoMapper.selectByExampleWithBLOBs(taskRunInfoExample);
AssertUtil.assetTrue(taskRunInfo.size() >0,"没有找到任务,任务id:"+taskRunId);
AssertUtil.assetTrue(taskRunInfo.size() > 0, "没有找到任务,任务id:" + taskRunId);
return taskRunInfo.get(0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ spring.main.allow-bean-definition-overriding=true

#mysql
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/repeater_console?&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true
spring.datasource.username=yyy
spring.datasource.password=xxx
spring.datasource.username=
spring.datasource.password=
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
mybatis.mapper-locations=classpath*:META-INF/mybatis/mapper/*.xml
mybatis.config-location=classpath:META-INF/mybatis/mybatis-config.xml
#mysql end


moonbox.server.url=http://127.0.0.1:8080
config.elasticsearch.nodes=127.0.0.1:9200,127.0.0.1:9200
config.elasticsearch.username=user
config.elasticsearch.password=pwd

#es start
config.elasticsearch.nodes=127.0.0.1:9740
config.elasticsearch.username=
config.elasticsearch.password=
#es end

app.name=moonbox-web
sandbox.agent.download.uri=/api/agent/downLoadSandBoxZipFile
Expand Down