Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
01091117
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1173
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
01091117
编写于
11月 18, 2018
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加redis内存数量接口
上级
8a421a6f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
71 addition
and
12 deletion
+71
-12
skyeye-service/src/main/java/com/skyeye/authority/service/SysRedisMonitorService.java
.../com/skyeye/authority/service/SysRedisMonitorService.java
+2
-0
skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysRedisMonitorServiceImpl.java
...ye/authority/service/impl/SysRedisMonitorServiceImpl.java
+20
-0
skyeye-service/src/main/java/com/skyeye/jedis/JedisClientClusterService.java
...main/java/com/skyeye/jedis/JedisClientClusterService.java
+4
-4
skyeye-service/src/main/java/com/skyeye/jedis/impl/JedisClientCluster.java
...c/main/java/com/skyeye/jedis/impl/JedisClientCluster.java
+22
-5
skyeye-web/src/main/java/com/skyeye/authority/controller/SysRedisMonitorController.java
...kyeye/authority/controller/SysRedisMonitorController.java
+16
-0
skyeye-web/src/main/resources/mapping/reqmapping.xml
skyeye-web/src/main/resources/mapping/reqmapping.xml
+3
-1
skyeye-web/src/main/webapp/tpl/sysredis/redismonitorlist.html
...ye-web/src/main/webapp/tpl/sysredis/redismonitorlist.html
+4
-2
未找到文件。
skyeye-service/src/main/java/com/skyeye/authority/service/SysRedisMonitorService.java
浏览文件 @
01091117
...
...
@@ -9,4 +9,6 @@ public interface SysRedisMonitorService {
public
void
queryRedisLogsList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
queryRedisKeysList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
}
skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysRedisMonitorServiceImpl.java
浏览文件 @
01091117
...
...
@@ -64,4 +64,24 @@ public class SysRedisMonitorServiceImpl implements SysRedisMonitorService{
outputObject
.
settotal
(
beans
.
size
());
}
/**
*
* @Title: queryRedisKeysList
* @Description: 获取当前数据库中key的数量
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
queryRedisKeysList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
beans
=
jedisClientClusterService
.
getClusterNodes
();
for
(
Map
<
String
,
Object
>
bean
:
beans
){
bean
.
put
(
"keys"
,
jedisClientClusterService
.
dbSize
(
bean
.
get
(
"ip"
).
toString
()));
}
outputObject
.
setBeans
(
beans
);
outputObject
.
settotal
(
beans
.
size
());
}
}
skyeye-service/src/main/java/com/skyeye/jedis/JedisClientClusterService.java
浏览文件 @
01091117
...
...
@@ -34,11 +34,11 @@ public interface JedisClientClusterService {
*
* @Title: dbSize
* @Description: 获取占用内存大小
* @param @
return
* @param @
throws Exceptio
n 参数
* @param @
param ip
* @param @
retur
n 参数
* @return Long 返回类型
* @throws
*/
public
Long
dbSize
(
String
ip
);
public
Map
<
String
,
Object
>
dbSize
(
String
ip
);
}
skyeye-service/src/main/java/com/skyeye/jedis/impl/JedisClientCluster.java
浏览文件 @
01091117
...
...
@@ -7,17 +7,13 @@ import java.util.LinkedList;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
net.sf.json.JSONArray
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
com.alibaba.fastjson.JSON
;
import
com.skyeye.common.util.ToolUtil
;
import
com.skyeye.jedis.JedisClient
;
import
com.skyeye.jedis.JedisClientClusterService
;
import
redis.clients.jedis.Client
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.JedisCluster
;
...
...
@@ -234,7 +230,28 @@ public class JedisClientCluster implements JedisClient, JedisClientClusterServic
}
@Override
public
Long
dbSize
(
String
ip
)
{
public
Map
<
String
,
Object
>
dbSize
(
String
ip
)
{
Jedis
jedis
=
null
;
try
{
Map
<
String
,
JedisPool
>
jedisPools
=
jedisCluster
.
getClusterNodes
();
Iterator
<
Map
.
Entry
<
String
,
JedisPool
>>
entries
=
jedisPools
.
entrySet
().
iterator
();
while
(
entries
.
hasNext
())
{
Entry
<
String
,
JedisPool
>
entry
=
entries
.
next
();
if
(
entry
.
getKey
().
indexOf
(
ip
)
!=
-
1
){
jedis
=
entry
.
getValue
().
getResource
();
//配置redis服务信息
Client
client
=
jedis
.
getClient
();
client
.
dbSize
();
long
dbSize
=
client
.
getIntegerReply
();
jedis
.
close
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"createTime"
,
ToolUtil
.
getTimeAndToString
());
map
.
put
(
"dbSize"
,
dbSize
);
return
map
;
}
}
}
finally
{
}
return
null
;
}
...
...
skyeye-web/src/main/java/com/skyeye/authority/controller/SysRedisMonitorController.java
浏览文件 @
01091117
...
...
@@ -48,4 +48,20 @@ public class SysRedisMonitorController {
sysRedisMonitorService
.
queryRedisLogsList
(
inputObject
,
outputObject
);
}
/**
*
* @Title: queryRedisKeysList
* @Description: 获取当前数据库中key的数量
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/SysRedisMonitorController/queryRedisKeysList"
)
@ResponseBody
public
void
queryRedisKeysList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
sysRedisMonitorService
.
queryRedisKeysList
(
inputObject
,
outputObject
);
}
}
skyeye-web/src/main/resources/mapping/reqmapping.xml
浏览文件 @
01091117
...
...
@@ -160,7 +160,9 @@
<url
id=
"redis001"
path=
"/post/SysRedisMonitorController/queryRedisInfoList"
val=
"获取redis服务器信息"
allUse=
"1"
>
</url>
<url
id=
"redis002"
path=
"/post/SysRedisMonitorController/queryRedisLogsList"
val=
"获取redis日志信息"
allUse=
"0"
>
<url
id=
"redis002"
path=
"/post/SysRedisMonitorController/queryRedisLogsList"
val=
"获取redis日志信息"
allUse=
"1"
>
</url>
<url
id=
"redis003"
path=
"/post/SysRedisMonitorController/queryRedisKeysList"
val=
"获取当前数据库中key的数量"
allUse=
"0"
>
</url>
<!-- 系统角色用户管理结束 -->
...
...
skyeye-web/src/main/webapp/tpl/sysredis/redismonitorlist.html
浏览文件 @
01091117
...
...
@@ -15,7 +15,7 @@
<ul
class=
"winui-tab-nav"
>
<li
class=
"winui-this"
><i
class=
"fa fa-bar-chart fa-fw"
></i>
redis服务器信息
</li>
<li><i
class=
"fa fa-line-chart fa-fw"
></i>
redis日志信息
</li>
<li><i
class=
"fa fa-area-chart fa-fw"
></i>
Area
</li>
<li><i
class=
"fa fa-area-chart fa-fw"
></i>
redis内存数量
</li>
<li><i
class=
"fa fa-pie-chart fa-fw"
></i>
Pie
</li>
</ul>
</div>
...
...
@@ -34,7 +34,9 @@
</div>
</div>
<div
class=
"winui-tab-item"
>
<div
id=
"area"
style=
"width:100%;height:100%;"
>
3
</div>
<div
id=
"area"
style=
"width:100%;height:100%;"
>
</div>
</div>
<div
class=
"winui-tab-item"
>
<div
id=
"pie"
style=
"width:100%;height:100%;"
>
4
</div>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录