mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-07-02 07:04:56 +08:00
Merge branch 'koogua/v1.6.2' into demo
This commit is contained in:
commit
9b8338615f
@ -1,3 +1,7 @@
|
|||||||
|
### [v1.6.2](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.1)(2023-01-12)
|
||||||
|
|
||||||
|
- ServerMonitor资源监控阀值可配置
|
||||||
|
|
||||||
### [v1.6.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.1)(2022-12-12)
|
### [v1.6.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.1)(2022-12-12)
|
||||||
|
|
||||||
- 富文本编辑器增加粘贴图片和远程图片本地化
|
- 富文本编辑器增加粘贴图片和远程图片本地化
|
||||||
|
@ -53,7 +53,9 @@ class ServerMonitorTask extends Task
|
|||||||
|
|
||||||
$load = sys_getloadavg();
|
$load = sys_getloadavg();
|
||||||
|
|
||||||
if ($load[1] > $cpuCount * 0.8) {
|
$limit = $this->getConfig()->path('server_monitor.cpu', 0.8);
|
||||||
|
|
||||||
|
if ($load[1] > $cpuCount * $limit) {
|
||||||
return sprintf("cpu负载超过%s", $load[1]);
|
return sprintf("cpu负载超过%s", $load[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +84,9 @@ class ServerMonitorTask extends Task
|
|||||||
|
|
||||||
$left = 100 * ($available / $total);
|
$left = 100 * ($available / $total);
|
||||||
|
|
||||||
if ($left < 20) {
|
$limit = $this->getConfig()->path('server_monitor.memory', 10);
|
||||||
|
|
||||||
|
if ($left < $limit) {
|
||||||
return sprintf("memory剩余不足%s%%", round($left));
|
return sprintf("memory剩余不足%s%%", round($left));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +100,9 @@ class ServerMonitorTask extends Task
|
|||||||
|
|
||||||
$left = 100 * $free / $total;
|
$left = 100 * $free / $total;
|
||||||
|
|
||||||
if ($left < 20) {
|
$limit = $this->getConfig()->path('server_monitor.disk', 20);
|
||||||
|
|
||||||
|
if ($left < $limit) {
|
||||||
return sprintf("disk剩余不足%s%%", round($left));
|
return sprintf("disk剩余不足%s%%", round($left));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class AppInfo
|
|||||||
|
|
||||||
protected $link = 'https://www.koogua.com';
|
protected $link = 'https://www.koogua.com';
|
||||||
|
|
||||||
protected $version = '1.6.1';
|
protected $version = '1.6.2';
|
||||||
|
|
||||||
public function __get($name)
|
public function __get($name)
|
||||||
{
|
{
|
||||||
@ -28,6 +28,8 @@ class AppInfo
|
|||||||
if (isset($this->{$name})) {
|
if (isset($this->{$name})) {
|
||||||
return $this->{$name};
|
return $this->{$name};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -172,4 +172,19 @@ $config['websocket']['connect_address'] = 'your_domain.com:8282';
|
|||||||
*/
|
*/
|
||||||
$config['websocket']['register_address'] = '127.0.0.1:1238';
|
$config['websocket']['register_address'] = '127.0.0.1:1238';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源监控: CPU负载(0.1-1.0)
|
||||||
|
*/
|
||||||
|
$config['server_monitor']['cpu'] = 0.8;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源监控: 内存剩余占比(10-100)%
|
||||||
|
*/
|
||||||
|
$config['server_monitor']['memory'] = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源监控: 磁盘剩余占比(10-100)%
|
||||||
|
*/
|
||||||
|
$config['server_monitor']['disk'] = 20;
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user