| | |
| | | package com.ruoyi.web.controller.monitor;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Properties;
|
| | | import cn.hutool.core.util.StrUtil;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.data.redis.core.RedisCallback;
|
| | | import org.springframework.data.redis.core.RedisTemplate;
|
| | |
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | import java.util.*;
|
| | |
|
| | | /**
|
| | | * 缓存监控
|
| | |
| | | commandStats.stringPropertyNames().forEach(key -> {
|
| | | Map<String, String> data = new HashMap<>(2);
|
| | | String property = commandStats.getProperty(key);
|
| | | data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
| | | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
| | | data.put("name", StrUtil.removePrefix(key, "cmdstat_"));
|
| | | data.put("value", StrUtil.subBetween(property, "calls=", ",usec"));
|
| | | pieList.add(data);
|
| | | });
|
| | | result.put("commandStats", pieList);
|