Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
9bb2ad48
Commit
9bb2ad48
authored
Oct 16, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java实例内存大小监控
parent
ee31606a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
5 deletions
+36
-5
config/src/main/resources/config/application.yml
+1
-0
core/pom.xml
+6
-0
core/src/main/java/com/wecloud/im/controller/SignController.java
+29
-5
No files found.
config/src/main/resources/config/application.yml
View file @
9bb2ad48
...
...
@@ -205,6 +205,7 @@ spring-boot-plus:
-
/user/register, /user/login, /user/resetPassword, /user/checkPhone
# 发送短信验证码
-
/verify/**
-
/signDemo/monitor
# 多行字符串权限配置
filter-chain-definitions
:
|
...
...
core/pom.xml
View file @
9bb2ad48
...
...
@@ -158,6 +158,12 @@
<version>
2.10.8
</version>
</dependency>
<dependency>
<groupId>
org.apache.lucene
</groupId>
<artifactId>
lucene-core
</artifactId>
<version>
4.0.0
</version>
</dependency>
</dependencies>
<!-- <build>-->
<!-- <resources>-->
...
...
core/src/main/java/com/wecloud/im/controller/SignController.java
View file @
9bb2ad48
...
...
@@ -2,12 +2,12 @@ package com.wecloud.im.controller;
import
cn.hutool.crypto.digest.MD5
;
import
com.wecloud.im.param.GetSignParam
;
import
com.wecloud.im.
service.ImClientLoginService
;
import
com.wecloud.im.
ws.manager.ChannelManager
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.
springframework.beans.factory.annotation.Autowired
;
import
org.
apache.lucene.util.RamUsageEstimator
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -25,9 +25,6 @@ import org.springframework.web.bind.annotation.RestController;
@Api
(
value
=
"signAPI"
,
tags
=
{
"获取sign(Demo)"
})
public
class
SignController
extends
BaseController
{
@Autowired
private
ImClientLoginService
imClientLoginService
;
/**
* 根据客户方生成签名字符串 验证通过则下发token
*/
...
...
@@ -39,5 +36,32 @@ public class SignController extends BaseController {
+
getSignParam
.
getAppKey
()
+
getSignParam
.
getAppSecret
()
+
getSignParam
.
getPlatform
());
}
/**
* monitor
*/
@PostMapping
(
"/monitor"
)
@ApiOperation
(
value
=
"monitor"
,
notes
=
"monitor"
)
public
String
monitor
()
{
int
sessionInfoMapSize
=
ChannelManager
.
SESSION_INFO_MAP
.
size
();
String
sizeStr
=
RamUsageEstimator
.
humanSizeOf
(
ChannelManager
.
SESSION_INFO_MAP
);
String
sizeClientId
=
RamUsageEstimator
.
humanSizeOf
(
ChannelManager
.
CLIENT_ID
);
String
sizeAppId
=
RamUsageEstimator
.
humanSizeOf
(
ChannelManager
.
APPLICATION_ID
);
String
sizeReadIdle
=
RamUsageEstimator
.
humanSizeOf
(
ChannelManager
.
READ_IDLE_TIMES
);
String
sizePlatform
=
RamUsageEstimator
.
humanSizeOf
(
ChannelManager
.
PLATFORM
);
StringBuilder
sb
=
new
StringBuilder
().
append
(
"sessionInfoMapSize: "
).
append
(
sessionInfoMapSize
)
.
append
(
"sizeStr:"
).
append
(
sizeStr
)
.
append
(
"sizeClientId:"
).
append
(
sizeClientId
)
.
append
(
"sizeAppId:"
).
append
(
sizeAppId
)
.
append
(
"sizeReadIdle:"
).
append
(
sizeReadIdle
)
.
append
(
"sizePlatform:"
).
append
(
sizePlatform
)
;
log
.
info
(
sb
.
toString
());
return
sb
.
toString
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment