2020-10-10 17:00:07 +08:00

60 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

服务性能监控
适用场景:
-- 1、人数采集
2、服务性能
数据结构
{
id:int,
name:string,
host:sting,
area:string,
port:int,
url:string,
user:string,
sendto:string,
costtimeint
status:bool,
clientip:string,
client_area:string,
}
工作流程:
1、client访问接口按区域过滤获得需验证的服务明细(id,area,url)
2、访问服务的url获得状态及耗费时间(id,costtime,status)
3、将上述内容加上clientip,client_area发送给server端
4、server端将数据写入数据库针对异常发送报警信息
mysql
table
service_name
id,name,host,area,port,url,user,sendto
service_info
id,costtime,status,clientip,client_area
server
接口规划:
1、返回需监控的内容
get /getlist area
return (id,url)
2、记录监控的数据
post /putdata (id,costtime,status,clientip,client_area)
return bool
3、可用性接口
get /alive
return {status:1}
client
--定期触发
持续运行,读取配置文件的时间间隔
实现可用性接口
get /alive
return {status:1}
日志记录