health
##简介
健康检查
使用方法
- import pkg.health;
- 调用 health.start(); 开启健康检查,检查服务器各项指标,如果有异常会抛出警告
- 调用 health.end(); 结束健康检查
例子:
import gs.lang.*;
import gs.util.*;
import pkg.gtest;
import pkg.health;
void create()
{
load_static(pkg.health, this_domain());
}
void destruct()
{
health.end();
}
public mixed start()
{
health.start();
return "success";
}
public void test_run()
{
gtest.test_func((: start :), "success");
}
组件接口
函数原型 | 函数作用 |
---|---|
void start() | 该接口用来启动服务器健康检查监控 |
void end() | 该接口用来关闭服务器健康检查监控 |
void check_max_map_count() | unix下:检测最大map数 |
void check_current_maps() | unix下:检测当前使用map数 |
void check_handle() | 检测当前使用handle |
void check_queue() | 检测当前使用queue |
void check_memory() | 检测当前内存占用 |
void check_network() | 检测当前网络状态 |
void check_coroutine() | 检测当前协程状态及其调用栈 |
void msg_collect(string cmd, int len) | 网络消息收集 |