Skip to content

Commit

Permalink
perf: ESB接口get_step_status支持返回执行中步骤的实时总耗时 TencentBlueKing#2788
Browse files Browse the repository at this point in the history
1.使用外层数据结构中计算得到的总耗时;
2.完善测试用例。
  • Loading branch information
jsonwan committed Feb 29, 2024
1 parent 9a32024 commit 915e402
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ private EsbStepInstanceStatusV3DTO buildEsbStepInstanceStatusV3DTO(StepExecution
stepInst.setType(stepInstance.getExecuteType());
stepInst.setStatus(stepInstance.getStatus().getValue());
stepInst.setCreateTime(stepInstance.getCreateTime());
stepInst.setStartTime(stepInstance.getStartTime());
stepInst.setEndTime(stepInstance.getEndTime());
stepInst.setTotalTime(stepInstance.getTotalTime());
stepInst.setStartTime(executionResult.getStartTime());
stepInst.setEndTime(executionResult.getEndTime());
stepInst.setTotalTime(executionResult.getTotalTime());

List<EsbStepInstanceStatusV3DTO.StepResultGroup> stepResultGroupList = new ArrayList<>();
List<AgentTaskResultGroupDTO> resultGroups = executionResult.getResultGroups();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.notNullValue;

Expand Down Expand Up @@ -50,6 +51,7 @@ void testGetScriptStepInstanceStatus() {
.body("data.execute_count", equalTo(0))
.body("data.type", equalTo(1))
.body("data.status", notNullValue())
.body("data.total_time", greaterThan(0))
.body("data.step_result_group_list", hasSize(1));
}

Expand All @@ -73,6 +75,7 @@ void testGetFileStepInstanceStatus() {
.body("data.execute_count", equalTo(0))
.body("data.type", equalTo(2))
.body("data.status", notNullValue())
.body("data.total_time", greaterThan(0))
.body("data.step_result_group_list", hasSize(1));
}

Expand Down

0 comments on commit 915e402

Please sign in to comment.