From d59d2f9aacab2dc72718090bacde964b194c08a2 Mon Sep 17 00:00:00 2001 From: pengtao Date: Sat, 10 Oct 2020 17:00:07 +0800 Subject: [PATCH] add --- .gitignore | 1 + readme.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .gitignore create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1b7204 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.idea/* diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..f4bfcfa --- /dev/null +++ b/readme.md @@ -0,0 +1,59 @@ +服务性能监控 + +适用场景: +-- 1、人数采集 +2、服务性能 + + + +数据结构 +{ + id:int, + name:string, + host:sting, + area:string, + port:int, + url:string, + user:string, + sendto:string, + costtime:int, + 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} + 日志记录 + + +