[*] 日常优化

This commit is contained in:
acgist
2023-08-21 08:04:01 +08:00
parent 9c54ffff0a
commit 58d02a3065
3 changed files with 10 additions and 11 deletions

View File

@@ -3237,7 +3237,7 @@ class Taoyao extends RemoteClient {
/**
* 重启系统信令
*
* @returns 重启系统
* @returns 重启系统结果
*/
async systemReboot() {
return await this.request(protocol.buildMessage("system::reboot", {}));
@@ -3246,7 +3246,7 @@ class Taoyao extends RemoteClient {
/**
* 关闭系统信令
*
* @returns 关闭系统
* @returns 关闭系统结果
*/
async systemShutdown() {
return await this.request(protocol.buildMessage("system::shutdown", {}));

View File

@@ -61,7 +61,6 @@ public class SystemInfoProtocol extends ProtocolClientAdapter {
final Map<String, Object> info = new HashMap<>();
// 硬盘
final List<Diskspace> diskspace = new ArrayList<>();
// File.listRoots();
// FileSystems.getDefault().getFileStores();
Stream.of(File.listRoots()).forEach(v -> {
diskspace.add(new Diskspace(v.getPath(), v.getFreeSpace(), v.getTotalSpace()));
@@ -69,18 +68,18 @@ public class SystemInfoProtocol extends ProtocolClientAdapter {
info.put("diskspace", diskspace);
// 内存
final Runtime runtime = Runtime.getRuntime();
info.put("maxMemory", runtime.maxMemory());
info.put("freeMemory", runtime.freeMemory());
info.put("maxMemory", runtime.maxMemory());
info.put("freeMemory", runtime.freeMemory());
info.put("totalMemory", runtime.totalMemory());
info.put("maxMemoryGracefully", FileUtils.formatSize(runtime.maxMemory()));
info.put("freeMemoryGracefully", FileUtils.formatSize(runtime.freeMemory()));
info.put("maxMemoryGracefully", FileUtils.formatSize(runtime.maxMemory()));
info.put("freeMemoryGracefully", FileUtils.formatSize(runtime.freeMemory()));
info.put("totalMemoryGracefully", FileUtils.formatSize(runtime.totalMemory()));
// 其他
info.put("osArch", System.getProperty("os.arch"));
info.put("osName", System.getProperty("os.name"));
info.put("osVersion", System.getProperty("os.version"));
info.put("javaVmName", System.getProperty("java.vm.name"));
info.put("javaVersion", System.getProperty("java.version"));
info.put("osVersion", System.getProperty("os.version"));
info.put("javaVmName", System.getProperty("java.vm.name"));
info.put("javaVersion", System.getProperty("java.version"));
info.put("cpuProcessors", runtime.availableProcessors());
// 响应
message.setBody(info);

View File

@@ -19,9 +19,9 @@ import lombok.extern.slf4j.Slf4j;
*/
@Slf4j
@Description(
memo = "重启系统",
flow = {
"信令服务+)终端",
"终端->信令服务+)终端",
"终端=>信令服务+)终端"
}
)