feature(web): 增加压缩结果显示

This commit is contained in:
2023-06-14 17:20:47 +08:00
parent 6abbd3d46a
commit 29c328a899
6 changed files with 212 additions and 17 deletions

View File

@@ -640,7 +640,19 @@ public class InfoService {
"m1.compaction_plan_instant",
"m2.type is not null as is_complete",
"m1.update_time as started_time",
"m2.update_time as finished_time"
"m2.update_time as finished_time",
"m1.total_scan_time as pre_total_scan_time",
"m1.total_log_files_compacted as pre_total_log_files_compacted",
"m1.total_log_files_size as pre_total_log_files_size",
"m1.total_records_deleted as pre_total_records_deleted",
"m1.total_records_updated as pre_total_records_updated",
"m1.total_records_compacted as pre_total_records_compacted",
"m2.total_scan_time as complete_total_scan_time",
"m2.total_log_files_compacted as complete_total_log_files_compacted",
"m2.total_log_files_size as complete_total_log_files_size",
"m2.total_records_deleted as complete_total_records_deleted",
"m2.total_records_updated as complete_total_records_updated",
"m2.total_records_compacted as complete_total_records_compacted"
),
page,
count,
@@ -666,6 +678,22 @@ public class InfoService {
if (ObjectUtil.isNotNull(finishedTimestamp)) {
finishedTime = finishedTimestamp.getTime();
}
CompactionMetrics.Statistics before = new CompactionMetrics.Statistics(
rs.getLong(9),
rs.getLong(10),
rs.getLong(11),
rs.getLong(12),
rs.getLong(13),
rs.getLong(14)
);
CompactionMetrics.Statistics after = new CompactionMetrics.Statistics(
rs.getLong(15),
rs.getLong(16),
rs.getLong(17),
rs.getLong(18),
rs.getLong(19),
rs.getLong(20)
);
return new CompactionMetrics(
rs.getLong(1),
rs.getString(2),
@@ -674,7 +702,9 @@ public class InfoService {
rs.getString(5),
isComplete,
startedTime,
finishedTime
finishedTime,
before,
after
);
}
);

View File

@@ -48,7 +48,8 @@ public class SqlBuilderTests {
String alias,
String order,
String direction,
ImmutableList<Boolean> filterCompletes
ImmutableList<Boolean> filterCompletes,
boolean limited
) {
int limit = Math.max(count, 1);
int offset = limit * Math.max(page - 1, 0);
@@ -78,7 +79,7 @@ public class SqlBuilderTests {
.whereNotNull(filterCompletes.anySatisfy(b -> b), column(m2, "type"))
.orNull(filterCompletes.anySatisfy(b -> !b), column(m2, "type"))
.orderBy(StrUtil.isNotBlank(order) && StrUtil.isNotBlank(direction), StrUtil.format("m1.{} {}", order, direction))
.limit(offset, count);
.limit(limited, offset, count);
}
public static void main(String[] args) {
@@ -95,12 +96,13 @@ public class SqlBuilderTests {
"m2.update_time as finished_time"
),
1,
100,
1542097996099055616L,
"acct_acct_item_fs",
"update_time",
"asc",
Lists.immutable.of(false, true)
10,
1542097983881048064L,
"conf_center_balance_type",
null,
null,
Lists.immutable.of(false),
true
).build()
));
}