-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
仿照DruidDataSource的监控功能,增加RpcClientStat和RpcServerStat,前台通过/r/DevStat__…
…jdbcSqlStats, /r/DevStat__rpcServerStats等链接查看每条sql语句,以及后台每个服务函数的性能统计数据
- Loading branch information
1 parent
bb3bf1e
commit f6dcbfa
Showing
27 changed files
with
828 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.nop.biz.dev; | ||
|
||
import io.nop.api.core.annotations.biz.BizModel; | ||
import io.nop.api.core.annotations.biz.BizQuery; | ||
import io.nop.api.core.annotations.core.Description; | ||
import io.nop.api.core.annotations.core.Locale; | ||
import io.nop.api.core.annotations.core.Name; | ||
import io.nop.api.core.annotations.core.Optional; | ||
import io.nop.core.stat.GlobalStatManager; | ||
import io.nop.core.stat.JdbcSqlStatValue; | ||
import io.nop.core.stat.RpcClientStat; | ||
import io.nop.core.stat.RpcServerStat; | ||
|
||
import java.util.List; | ||
|
||
@Locale("zh-CN") | ||
@BizModel("DevStat") | ||
public class DevStatBizModel { | ||
@BizQuery | ||
@Description("jdbc调用的统计信息") | ||
public List<JdbcSqlStatValue> jdbcSqlStats(@Name("orderByAvgTime") @Optional Boolean orderByAvgTime) { | ||
if (orderByAvgTime == null) | ||
orderByAvgTime = true; | ||
return GlobalStatManager.instance().getAllJdbcSqlStat(orderByAvgTime); | ||
} | ||
|
||
@BizQuery | ||
@Description("rpc服务调用的统计信息") | ||
public List<RpcServerStat> rpcServerStats(@Name("orderByAvgTime") @Optional Boolean orderByAvgTime) { | ||
if (orderByAvgTime == null) | ||
orderByAvgTime = true; | ||
return GlobalStatManager.instance().getAllRpcServerStats(orderByAvgTime); | ||
} | ||
|
||
@BizQuery | ||
@Description("rpc客户端调用的统计信息") | ||
public List<RpcClientStat> rpcClientStats(@Name("orderByAvgTime") @Optional Boolean orderByAvgTime) { | ||
if (orderByAvgTime == null) | ||
orderByAvgTime = true; | ||
return GlobalStatManager.instance().getAllRpcClientStats(orderByAvgTime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.