疯狂的狮子Li
2023-01-20 27df5aba2faa68a2f5d03c1f72a01f2d113e397e
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/CacheController.java
@@ -16,7 +16,6 @@
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
/**
 * 缓存监控
@@ -51,13 +50,7 @@
    @GetMapping()
    public R<Map<String, Object>> getInfo() throws Exception {
        RedisConnection connection = connectionFactory.getConnection();
        Properties info = connection.commands().info();
        Properties commandStats = connection.commands().info("commandstats");
        Long dbSize = connection.commands().dbSize();
        Map<String, Object> result = new HashMap<>(3);
        result.put("info", info);
        result.put("dbSize", dbSize);
        List<Map<String, String>> pieList = new ArrayList<>();
        if (commandStats != null) {
@@ -69,8 +62,11 @@
                pieList.add(data);
            });
        }
        result.put("commandStats", pieList);
        return R.ok(result);
        return R.ok(Map.of(
                "info", connection.commands().info(),
                "dbSize", connection.commands().dbSize(),
                "commandStats", pieList
        ));
    }
    /**