HM接口说明
HM对外提供数据访问api,具体形式如下:
http://ip:port/hm/cache/q
该接口允许用户对缓存的profile(画像),monitor(实时监控),iplink(服务流)数据进行查询,默认暴露的查询端口为8765,下面对具体数据类型的查询方式举例加以说明。
1,profile数据
查询所有的画像数据
POST localhost:8765/hm/cache/q { "intent":"profile", "request":{ } }
结果返回
返回结果形式如下: {rs: "{"UAV@http://127.0.0.1:8080/apphub/…{}}}\..."}"} rs中的具体内容形式如下,其中key值为具体实例的唯一标识,由{appgroup}@{appurl}构成,value值为相应实例的profile数据 { UAV@http://127.0.0.1:8080/:"{...}" UAV@http://127.0.0.1:8080/apphub/:"{...}" UAV@http://127.0.0.1:10101/:"{...}" UAV@http://127.0.0.1:10102/:"{...}" UAV@jse://127.0.0.1/com.alibaba.rocketmq.broker.BrokerStartup-2144:"{...}" UAV@jse://127.0.0.1/com.alibaba.rocketmq.namesrv.NamesrvStartup-3980:"{...}" UAV@jse://127.0.0.1/org.elasticsearch.bootstrap.Elasticsearch-13424:"{...}" } proflie数据的具体形式如下 { appdes:"" appgroup:"UAV" appid:"ROOT" appmetrics:"{"M24hr_UsrLog":{}}" appurl:"http://127.0.0.1/" cpt.clients:"[]" cpt.filters:"{"org.apache.tomcat.websocket.server.WsFilter":{"dyn":{"servletNames":[],"urlPatterns":["/*"],"filterName":"Tomcat WebSocket (JSR356) Filter"}}}" cpt.listeners:"{"org.apache.tomcat.websocket.server.WsContextListener":{"dyn":{}},"org.apache.tomcat.websocket.server.WsSessionListener":{"dyn":{}}}" cpt.services:"{}" host:"DESKTOP-84FNUC2" ip:"127.0.0.1" jars.lib:"@LAZY" logs.log4j:"{}" mofmeta:"{"NetCardIndex":"0","NetCardName":""}" state:"1" svrid:"E:/UAVIDE/tomcat/apache-tomcat-7.0.65---E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0" time:1512455925270 webapproot:"E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ROOT" }
查询指定appgroup下的profile数据
以下示例查询appgroup为UAV的所有实例的profile数据
POST localhost:8765/hm/cache/q { "intent":"profile", "request":{ "fkey":"appgroup", "fvalue":"UAV" } }
返回结果
结果格式与查询全部时一致,不过只包含指定appgroup的profile数据。
查询指定appurl下的profile数据
以下示例查询appurl为http://127.0.0.1:8080/apphub/的所有实例的profile数据
POST localhost:8765/hm/cache/q { "intent":"profile", "request":{ "fkey":"appurl", "fvalue":"http://127.0.0.1:8080/apphub/" } }
返回结果
结果格式与查询全部时一致,不过只包含指定appurl的profile数据。
查询指定用户组下某一应用实例的lib数据
以下示例查询appgroup为UAV,appurl为http://127.0.0.1:8080/apphub/的实例中lib下的jar包数据
POST localhost:8765/hm/cache/q { "intent":"profile.detail", "request":{ "target":"profile.info.jarlib", "field":"UAV@http://127.0.0.1:8080/apphub/" } }
返回结果
返回结果形式如下 {rs: "{"UAV@http://127.0.0.1:8080/apphub/…reditease.uav.hook.httpclients-1.0-sync3.jar\"}"}"} rs中的具体内容形式如下,其中key应用标识,value值为应用实例所包含的jar包数据 {UAV@http://127.0.0.1:8080/apphub/: "{"com.creditease.uav.logging-1.0.jar":"file:/E:/UA…m.creditease.uav.hook.httpclients-1.0-sync3.jar"}"} jar报数据中具体内容如下,其中key为jar包名称,value值为jar包的绝对路径 { aopalliance-repackaged-2.4.0-b31.jar:"file:/E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.creditease.uav.console/WEB-INF/lib/aopalliance-repackaged-2.4.0-b31.jar" aredis-api-1.4.jar:"file:/E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.creditease.uav.console/WEB-INF/lib/aredis-api-1.4.jar" com.creditease.uav.base-1.0.jar:"file:/E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.creditease.uav.console/WEB-INF/lib/com.creditease.uav.base-1.0.jar" com.creditease.uav.cache.redis-1.0.jar:"file:/E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.creditease.uav.console/WEB-INF/lib/com.creditease.uav.cache.redis-1.0.jar" com.creditease.uav.fastjson-1.2.6.jar:"file:/E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.creditease.uav.console/WEB-INF/lib/com.creditease.uav.fastjson-1.2.6.jar" com.creditease.uav.helper-1.0.jar:"file:/E:/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.creditease.uav.console/WEB-INF/lib/com.creditease.uav.helper-1.0.jar" com.creditease.uav.hook.httpclients-1.0-async.jar:"file:/E:/UAVCode/uavGitLab/ce-datamonitorsystem/com.creditease.uav.monitorframework.buildComponent/target/build/com.creditease.uav.appfrk/com.creditease.uav.hook.httpclients-1.0-async.jar" com.creditease.uav.hook.httpclients-1.0-sync3.jar:"file:/E:/UAVCode/uavGitLab/ce-datamonitorsystem/com.creditease.uav.monitorframework.buildComponent/target/build/com.creditease.uav.appfrk/com.creditease.uav.hook.httpclients-1.0-sync3.jar" .... }
查询所有实例的客户端组件
POST localhost:8765/hm/cache/q { "intent":"clients", "request":{ } }
返回结果
返回结果形式如下 {rs: "{"C@UAV@http://127.0.0.1:10102/":"[{\"values\"…lasticsearch.bootstrap.Elasticsearch-13424":"[]"}"} rs中的具体内容形式如下,其中key应用标识,value值为应用实例所包含的客户端数据 { C@UAV@http://127.0.0.1:8080/:"[...]" C@UAV@http://127.0.0.1:8080/apphub/:"[...]" C@UAV@http://127.0.0.1:10101/:"[...]" C@UAV@http://127.0.0.1:10102/:"[...]" C@UAV@jse://127.0.0.1/com.alibaba.rocketmq.broker.BrokerStartup-2144:"[...]" C@UAV@jse://127.0.0.1/com.alibaba.rocketmq.namesrv.NamesrvStartup-3980:"[...]" C@UAV@jse://127.0.0.1/org.elasticsearch.bootstrap.Elasticsearch-13424:"[...]" } 某一实例客户端数据的具体内容如下 [ {"values":{"urls":{"/ah/app":{"ACpost":1512455355327,"ts":1512455355327},"/ah/group":{"ACpost":1512455355321,"ts":1512455355321}},"type":"apache.http.AsyncClient","ts":1512455355327,"state":"-1"},"id":"http://127.0.0.1:8011"}, {"values":{"urls":{"ap":{"ACauth":1512455530875,"ACget":1512458763341,"ACconfig":1512455530875,"AChmget":1512455528761,"AChmset":1512455355384,"AChgetall":1512455528756,"ts":1512458763341}},"type":"redis.client.Aredis","svr":"redis","ts":1512458763341,"state":"1"},"id":"redis://127.0.0.1:6379"}, {"values":{"urls":{"/hm/cache/q":{"ACpost":1512458763356,"ts":1512458763356}},"type":"apache.http.AsyncClient","ts":1512458763356,"state":"1"},"id":"http://127.0.0.1:8765"} ]
2,monitor数据查询
以下实例查询时间在1512450873892与1512450933892之间,ip为127.0.0.1机器上
http://127.0.0.1:8080/com.creditease.uav.console应用的err和RC数据,另外还支持的metric还有appResp.warn, appResp.EXT, appResp.tmax, appResp.tsum, appResp.tavg, appResp.tmin, appResp.count。
POST localhost:8765/hm/cache/q
{
"intent":"monitor",
"request":{
"cache.query.json":"{
\"start\":1512450873892,
\"end\":1512450933892,
\"queries\":[
{
\"aggregator\":\"avg\",
\"metric\":\"appResp.err\",
\"tags\":{
\"ip\":\"127.0.0.1\",
\"pgid\":\"E/u003a/UAVIDE/tomcat/apache-tomcat-7.0.65---E/u003a/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0\",
\"instid\":\"http/u003a//127.0.0.1/u003a8080/apphub---apphub\"
}
},
{
\"aggregator\":\"avg\",
\"metric\":\"appResp.RC\",
\"tags\":{
\"ip\":\"127.0.0.1\",
\"pgid\":\"E/u003a/UAVIDE/tomcat/apache-tomcat-7.0.65---E/u003a/UAVIDE/defaultworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0\",
\"instid\":\"http/u003a//127.0.0.1/u003a8080/apphub---apphub\",
\"ptag\":\"*\"
}
}
]
}"
}
}
返回结果
返回结果形式如下
{rs: "[{"metric":"appResp.RC200","tags":{"ip":"127.0.0.1…}]"}
rs中具体内容形式如下
[
{metric: "appResp.RC200", tags: {…}, dps: {…}}
{metric: "appResp.RC304", tags: {…}, dps: {…}}
{metric: "appResp.RC302", tags: {…}, dps: {…}}
{metric: "appResp.err", tags: {…}, dps: {…}}
]
tags结果与请求参数中的tags基本相同,不同点在于如果请求参数中含有ptag:"*",则在返回结果中会进行细
分,如例中的appResp.RC,返回时会根据RC200,RC304,RC302进行分隔
dps中的具体内容形式如下
{
1512460980270:347
1512460995260:349
1512461010270:353
1512461025270:353
}
3,iplink数据查询
POST localhost:8765/hm/cache/q
{
"intent":"iplnk",
"request":{
"appgpids":"[
\"UAV@http://127.0.0.1:8080/apphub/\",
\"UAV@jse://127.0.0.1/org.elasticsearch.bootstrap.Elasticsearch-13424\"
]"
}
}
返回结果
返回结果形式如下
{rs: "{"UAV@jse://127.0.0.1/org.elasticsearch.bootst…56.1\":1512462439074},\"ts\":1512462439074}"}}"}
rs中的具体内容形式如下,其中key值为应用标识,value为iplink数据
{
UAV@http://127.0.0.1:8080/apphub/:{...}
UAV@jse://127.0.0.1/org.elasticsearch.bootstrap.Elasticsearch-13424:{}
}
iplink数据具体内容形式如下
{
browser://127.0.0.1:8080/apphub:"{"urls":{"/rs/gui/loadTemp":1512455530051,"/rs/godeye/profile/q/iplink":1512462406887,"/uavapp_godeye/appmonitor/main.html":1512462378880,"/rs/godeye/profile/q/cache":1512462439074,"/rs/godeye/monitor/q/hm":1512462406898,"/rs/gui/login":1512455528725,"/rs/gui/loadMainMenu":1512455528745,"/rs/gui/jumpAppPage":1512455529989,"/rs/gui/loadUserManageInfo":1512455528765},"clients":{"user://192.168.56.1":1512462439074},"ts":1512462439074}"
browser://127.0.0.1:8080/apphub-ts:"1512462439074"
}
http://ip:port/ivc/q
用户可通过该接口对轻调用链数据进行查询,调用链默认查询端口为7799
1,调用链数据查询示例
POST localhost:7799/ivc/q
{
"intent":"qApp",
"request":{
"appuuid":"http://127.0.0.1:8080/apphub---apphub",
"stime":"1512377369878",
"etime":"1512463769878",
indexdate:"2017-12-7",//调用链产生日期,查询本周数据可省略
"eptype":"E,S",
"from":"0",
"size":"100",
"sort":"cost=DESC"
}
}
返回结果
返回结果形式如下,其中rs中为调用链数据,count为数据总数
{
rs:[{"traceid":"127.0.0.1_8080_1512463713021_56_6….console","state":"200" ,"class":"","eptype":"E"}]",
count: "25"
}
rs中的具体内容形式如下
[
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---apphub", cost: 835, ipport: "127.0.0.1:8080", method: "loadTemp", …}
{traceid: "127.0.0.1_8080_1512463713886_53_7", appuuid: "http://127.0.0.1:8080/apphub---apphub", cost: 180, ipport: "127.0.0.1:8080", method: "createValidataCode", …}
{traceid: "127.0.0.1_8080_1512463740450_55_11", appuuid: "http://127.0.0.1:8080/apphub---apphub", cost: 28, ipport: "127.0.0.1:8080", method: "loadUserManageInfo", …}
{traceid: "127.0.0.1_8080_1512463740398_54_8", appuuid: "http://127.0.0.1:8080/apphub---apphub", cost: 20, ipport: "127.0.0.1:8080", method: "login", …}
{traceid: "127.0.0.1_8080_1512463743000_56_17", appuuid: "http://127.0.0.1:8080/apphub---apphub", cost: 14, ipport: "127.0.0.1:8080", method: "getMonitorData", …}
...
}
每个调用链数据的详细内容形式如下
{
appgroup:"UAV"
appid:"com.creditease.uav.console"
appuuid:"http://127.0.0.1/apphub---apphub"
class:"com.creditease.uav.apphub.rest.GUIService"
cost:835
epinfo:"http.service,mtd=GET,src=10.10.168.155"
eptype:"E"
ipport:"127.0.0.1:8080"
method:"loadTemp"
parentid:"N"
spanid:"1"
state:"200"
stime:1512463713021
traceid:"127.0.0.1_8080_1512463713021_56_6"
url:"http://localhost:8080/apphub/rs/gui/loadTemp"
}
2,调用链详情数据查询示例
POST localhost:7799/ivc/q
{
"intent":"qTrace",
"request":{
"traceid":"127.0.0.1_8080_1512463713021_56_6",
"from":"0",
"size":"1000",
"sort":"spanid=ASC,stime=ASC,epinfo=ASC"
}
}
返回结果
返回结果形式如下,其中rs中为调用链详情数据,count为数据总数
{
rs: "[{"traceid":"127.0.0.1_8080_1512463713021_56_6...ase.uav.httpasync.HttpAsyncClient","eptype":"C"}]",
count: "8"
}
rs中的具体内容形式如下
[
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 835, ipport: "127.0.0.1:8080", method: "loadTemp", …}
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 100, ipport: "127.0.0.1:8080", method: "doHttpOutboundAsyncInternal", …}
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 75, ipport: "127.0.0.1:8080", method: "doHttpOutboundAsyncInternal", …}
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 73, ipport: "127.0.0.1:8080", method: "doHttpOutboundAsyncInternal", …}
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 59, ipport: "127.0.0.1:8080", method: "doHttpOutboundAsyncInternal", …}
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 58, ipport: "127.0.0.1:8080", method: "doHttpOutboundAsyncInternal", …}
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 96, ipport: "127.0.0.1:8080", method: "doHttpOutboundAsyncInternal", …}
{traceid: "127.0.0.1_8080_1512463713021_56_6", appuuid: "http://127.0.0.1:8080/apphub---aphub", cost: 18, ipport: "127.0.0.1:8080", method: "doHttpOutboundAsyncInternal", …}
]
每条记录的具体内容形式于调用链数据内容结构一致
http://ip:port/slw/q
用户可通过该接口对重调用链数据进行查询,重调用链默认查询端口为7799
POST localhost:7799/slw/q
{
"intent":"qParams",
"request":{
"traceid":"127.0.0.1_8080_1512528400374_94_10",
"spanid":"1.1",
"epinfo":"apache.http.AsyncClient",
"appid":"apphub"
}
}
返回结果
返回结果形式如下,其中rs中为重调用链数据,count为数据总数
{
rs: "[{"traceid":"127.0.0.1_8080_1512528400374_94_1...values\\":{\\\\\\\\\\\\\\\"urls\\"}]",
count: "1"
}
rs中的具体内容形式如下
[
{
appgroup:"UAV"
appid:"apphub"
appuuid:"http://127.0.0.1:8080/apphub---apphub"
epinfo:"apache.http.AsyncClient"
rpc_req_body:"{"intent":"profile","request":{},"responseAsJsonString":"{}"}"
rpc_req_head:"{"param.http.head.span":"127.0.0.1_8080_1512528400374_94_10&1.1&1&","UAV-Client-Src":"http://127.0.0.1:8080/apphub"}{}"
rpc_rsp_body:"{"rs":"{\"UAV@jse://127.0.0.1/edu.umd.cs.findb....":{\\\\\\\"urls\"
rpc_rsp_head:"{"Content-length":"113376","Date":"Wed, 06 Dec 2017 02:46:40 GMT"}"
spanid:"1.1"
traceid:"127.0.0.1_8080_1512528400374_94_10"
}
]
http://ip:port/jta/q
用户可通过该接口对线程分析数据进行查询,线程分析数据默认查询端口为5566
1,线程分析数据查询示例
POST localhost:5566/jta/q
{
"intent":"qDistinct",
"request":{"ipport":"127.0.0.1:8080"}
}
返回结果
返回结果形式如下,其中rs中为线程分析数据,count为数据总数
{
rs: "[{"threadcount":120,"time":"1512537011959","user":…ount":120,"time":"1512531600647","user":"admin"}]",
count: "3"
}
rs中的具体内容形式如下
[
{threadcount: 120, time: "1512537011959", user: "admin"}
{threadcount: 120, time: "1512536880350", user: "admin"}
{threadcount: 120, time: "1512531600647", user: "admin"}
]
2,线程分析详细数据查询示例
POST localhost:5566/jta/q
{
"intent":"qField",
"request":{
"stime":"1512537011959",
"etime":"1512537011959",
"ipport":"127.0.0.1:8080",
"from":"0",
"size":"5000",
"sort":
"percpu=DESC"
}
}
返回结果
返回结果形式如下,其中rs中每次线程分析的详细数据,count为数据总数
{
rs: "[{"ipport":"127.0.0.1:8080","appgroup":"UNKNO…9a501b9000 nid=0x2309 waiting on condition\r\n"}]",
count: "120"
}
rs中的具体内容形式如下
[
{ipport: "127.0.0.1:8080", appgroup: "UNKNOWN", pname: "", percpu: 6.699999809265137, pid: "", …}
{ipport: "127.0.0.1:8080", appgroup: "UNKNOWN", pname: "", percpu: 0, pid: "", …}
{ipport: "127.0.0.1:8080", appgroup: "UNKNOWN", pname: "", percpu: 0, pid: "", …}
{ipport: "127.0.0.1:8080", appgroup: "UNKNOWN", pname: "", percpu: 0, pid: "", …}
{ipport: "127.0.0.1:8080", appgroup: "UNKNOWN", pname: "", percpu: 0, pid: "", …}
{ipport: "127.0.0.1:8080", appgroup: "UNKNOWN", pname: "", percpu: 0, pid: "", …}
...
]
每个线程信息的具体内容形式如下
{
appgroup:"UNKNOWN"
info:""ContainerBackgroundProcessor[StandardEngine[Catalina]]" #53 daemon prio=5 os_prio=0 tid=0x00007f9a50705800 nid=0x256e waiting on condition [0x00007f99f8ad8000]
↵java.lang.Thread.State: TIMED_WAITING (sleeping)
↵at java.lang.Thread.sleep(Native Method)
↵at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1355)
↵at java.lang.Thread.run(Thread.java:745)
↵"
ipport:"127.0.0.1:8080"
percpu:6.699999809265137
permem:11
pid:""
pname:""
state:"TIMED_WAITING (sleeping)"
tid:"9582"
time:1512537011959
timeadd:"0:56.37"
user:"admin"
}
http://ip:port/hm/query
该接口允许用户对历史数据的monitorData(实时数据)、nodeInfo(容器节点数据)进行查询,默认对外暴露的查询端口为8765,下面对具体数据类型的查询方式举例加以说明。
查询nodeInfo数据
以下示例以进程指标查询为例
POST localhost:8765/hm/query { "request": { "opentsdb.query.json":"{ \"start\":1512544020000, \"end\":1512544140000, \"queries\":[{ \"aggregator\":\"sum\", \"downsample\":\"1m-avg\", \"metric\":\"procState.conn\", \"tags\":{ \"instid\":\"127.0.0.0.1_org.elasticsearch.bootstrap.Elasticsearch_10508\" } }] }", "datastore.name": "MT_Monitor" } } 其中start与end为开始与结束时间,queries为查询条件,metric为性能指标名,tags为具体某一进程的查询条件
结果返回
返回数据具体格式如下:{ "rs": "[{ "metric":"procState.conn", "tags":{ "pgid":"org.elasticsearch.bootstrap.Elasticsearch", "instid":"127.0.0.1_org.elasticsearch.bootstrap.Elasticsearch_10508", "ip":"127.0.0.1" }, "aggregateTags":[], "dps":{ "1512544020":14.0, "1512544080":14.0, "1512544140":14.0 } }]" } 其中metric为性能指标名,tags为查询条件,dps为返回历史数据
http://ip:port/hb/query
该接口允许用户对缓存的nodeInfo(心跳数据)进行查询,默认对外暴露的查询端口为8020,下面对具体数据的查询方式加以说明。
1,查询所有容器的心跳数据,
POST localhost:8020/hb/query
{
"intent":"node",
"request":{
}
}
结果返回
返回数据具体格式如下:
{
"rs": "{
"938300339801718784":"{
"clientTimestamp": 1512546163627,
"group": "",
"host": "DESKTOP-KDVH36F",
"id": "938300339801718784",
"info": {
"os.io.disk": "{"
E: ":{
"disk\_read":"0.00",
"total":"46079996",
"use":"18136596",
"useRate":"39%",
"free":"27943400",
"disk\_write":"0.00"
},
"D: ":{
"disk\_read":"0.00",
"total":"77163516",
"use":"14794732",
"useRate":"19%",
"free":"62368784",
"disk\_write":"0.00"
},
"C: ":{
"disk\_read":"0.00",
"total":"125576188",
"use":"53220416",
"useRate":"42%",
"free":"72355772",
"disk\_write":"0.00"
}
}",
"node.pid": "15412",
"node.hbserver": "127.0.0.1:8010",
"os.cpu.maxmem": "17058336768",
"os.arch": "amd64",
"node.services": "{
"nodeoperagent-NodeOperHttpServer-/node/ctrl":"http: //localhost: 10101/node/ctrl"}",
"node.state": "1",
"os.type": "Windows 10",
"os.java.vm": "Java HotSpot\(TM\) 64-Bit Server VM",
"node.feature": "{"hbclientagent":\["HeartBeatClientAgent"\],
"procscan":\["ProcDetectAgent"\],
"nodeoperagent":\["NodeOperAgent"\],
"threadanalysis":\["ThreadAnalysisAgent"\],
"collectclient":\["CollectDataAgent"\],
"logagent":\["LogAgent"\],
"procwatch":\["ProcWatchAgent"\],
"notifyagent":\["GlobalNotificationAgent"\],
"monitoragent":\["MonitorAgent"\]}",
"node.profile": "agent",
"os.mac": "F4:96:34:86:B9:EC",
"os.cpu.number": "8",
"os.java.ver": "1.8.0\_131",
"node.tags": "Elasticsearch,UAV.AppHub,监控代理程序,jar,BrokerStartup,NamesrvStartup,健康管理程序,",
"os.cpu.load": "9",
"node.version": "1.0",
"node.procs": "{......}",
"os.java.home": "D:\java\jdk1.8.0\_131\jre",
"os.conn.cur": "-1",
"os.cpu.freemem": "8731549696",
"node.root": "D:\GITStoreXinJian\ce-datamonitorsystem\com.creditease.uav.agent.buildComponent\target\build",
"os.cpu.avgload": "-100"
},
"ip": "localhost",
"name": "监控代理程序",
"serverTimestamp": 1512546163630
}",
"938300359816974336":"{.....}"
}"
}
node.procs内容如下:
"{"12464":{
"name":"java","pid":"12464","ports":\[\],
"tags":{
"main":"com.creditease.mscp.boot.MSCPBoot",
"jargs":"-agentlib: jdwp=transport=dt\_socket,suspend=y,
address=localhost: 55338-javaagent:
D: \GITStoreXinJian\ce-datamonitorsystem\com.creditease.uav.monitorframework.buildComponent\target\build\com.creditease.uav.agent\com.creditease.uav.monitorframework.agent-1.0-agent.jar-Dfile.encoding=UTF-8",
"jflags":"",
"watch":"false",
"conn\_8765":"0",
"conn":"3",
"memRate":"7.88",
"mem":"1312536",
"conn\_10102":"0",
"conn\_55639":"1",
"cpu":"22.78"
,"conn\_8020":"0",
"conn\_8010":"2",
"conn\_8011":"0",
"conn\_9000":"0",
"conn\_5566":"0",
"disk\_read":"0.27","disk\_write":"55.96"
}
},
"15412":{
"name":"java","pid":"15412","ports":\[\],
"tags":{
"main":"com.creditease.mscp.boot.MSCPBoot",
"jargs":"-agentlib: jdwp=transport=dt\_socket,suspend=y,
address=localhost: 55182-javaagent:
D: \GITStoreXinJian\ce-datamonitorsystem\com.creditease.uav.monitorframework.buildComponent\target\build\com.creditease.uav.agent\com.creditease.uav.monitorframework.agent-1.0-agent.jar-Dfile.encoding=UTF-8",
"jflags":"",
"watch":"false",
"conn":"1",
"memRate":"1.68",
"mem":"280076",
"conn\_10101":"0",
"cpu":"11.39",
"conn\_55263":"1",
"disk\_read":"20.36",
"disk\_write":"33.41"
}
},
"16292":{.......},
"4484":{.......},
"17272":{......},
"10508":{......}
}"
2,查询指定ip的容器心跳数据
POST localhost:8020/hb/query
{
"intent":"node",
"request":{
"fkey":"ip",
"fvalue":"127.0.0.1"
}
}
返回数据结构与查询所有容器数据时一致,但是仅包含指定ip的容器心跳数据。
3,查询指定组的容器心跳数据
以UAV组查询为例(多组查询时,组名间用逗号隔开)
POST localhost:8020/hb/query
{
"intent":"node",
"request":{
"fkey":"group",
"fvalue":"UAV"
}
}
返回数据结构与查询所有容器数据时一致,但是仅包含指定组的容器心跳数据。
4,查询某一容器的所注册的服务的心跳数据
以nodeoperagent-NodeOperHttpServer-/node/ctrl查询为例
POST localhost:8020/hb/query
{
"intent":"services",
"request":{
"service":"nodeoperagent-NodeOperHttpServer-/node/ctrl"
}
}
返回数据具体格式如下:
{
"rs":"[\"http://127.0.0.1/node/ctrl\"]"
}