推荐系统服务监控
接口
推荐系统
监控
概述
- 推荐系统需要由
余杨
增加服务的监控,以监测推荐系统的「服务可用性」和「服务准确性」两个方面,监测的规则由陈福
和刘润忠
提供。
- 丁香园 APP 采用的是 V3 版本的API,丁香人才是 V2 版本,所以需要注意一下请求链接中关于版本的标记。
- 需要注意监控的「有效性」,如果用于监控的请求的任何一个参数有更改,都有可能影响监控的「有效性」,例如:
# 如果请求中,`userId` 的值不存在,那么这个请求肯定会是失败的,也就会触发监控的报警,需要注意这种报警消息实际是无效的。
curl -X GET \
'http://172.16.1.3:7707/v3/recommend/?userId=dxy_gawxtms6&domain=bbs_app_recomm'
用户监控名单
用户名 |
账号归属 |
备注 |
hotstone |
夏版 |
医生用户,暂时不监控 |
shenzhongji |
沈博 |
非医生用户 |
dxy_gawxtms6 |
Oscar |
失效账号,不需要监控 |
1 服务可用性判断条件
服务 |
异常判断 |
备注 |
Engine |
返回结果的 status 为 false 为异常 |
- |
Recall |
返回结果的 status 非 400 - 500 为异常 |
- |
Rerank |
返回结果的 status 非 400 - 500 为异常 |
- |
2 服务准确性判断条件
服务 |
异常判断 |
备注 |
Engine |
返回的10条记录的 rdna 均为 1073741823 则为异常 |
rdna 为 1073741823 代表返回的内容均为「热门内容」 |
Recall |
返回结果的 status 非 400 - 500 为异常 |
- |
Rerank |
返回结果的 status 非 400 - 500 为异常 |
- |
Engine 接口
# app1
## 丁香园 APP 推荐频道
curl -X GET \
'http://172.16.1.3:7707/v3/recommend/?id=shenzhongji&domain=bbs_app_recomm&cache=false&filter=false'
{"result":[{"rdna":7442445,"itemid":37856851,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37749454,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37719200,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37777461,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37848887,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37756034,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37777635,"itemType":1,"type":"bbs_topic"},{"rdna":7442447,"itemid":516789,"itemType":5,"type":"cms_article"},{"rdna":7442445,"itemid":37817270,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37816388,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":205,"userId":"shenzhongji","supply_time":-1,"fetchCache_time":-1,"abtest_time":0,"domain":"bbs_app_recomm","cached":false,"eventTime":1510801236746,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"rerank_time":175,"total_time":381},"status":true}
## 丁香园 APP 热门频道
curl -X GET \
'http://172.16.1.3:7707/v3/recommend/?id=&domain=bbs_app_hot&cache=false&filter=false'
{"result":[{"rdna":1071642621,"itemid":37865780,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":30936325,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":16995034,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":36718306,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":35232105,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":37869137,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":37352146,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":30131958,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":19203951,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":4761839,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":-1,"userId":"","supply_time":-1,"fetchCache_time":-1,"abtest_time":-1,"domain":"bbs_app_hot","cached":false,"eventTime":1510800607634,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"total_time":1,"rerank_time":-1},"status":true}
## 丁香园 APP 频道聚合
curl -X GET \
'http://172.16.1.3:7707/v3/recommend/?id=2&domain=bbs_app_channel&filter=false'
{"result":[{"rdna":10486824,"itemid":37870071,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869672,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869670,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869024,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869012,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868984,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868174,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868054,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37867402,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37867151,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":46,"userId":"2","supply_time":-1,"fetchCache_time":-1,"abtest_time":0,"domain":"bbs_app_channel","cached":false,"eventTime":1510800550050,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"rerank_time":51,"total_time":97},"status":true}
## 丁香人才-职位召回简历
curl -X GET \
'http://172.16.1.3:7707/v2/recommend/?id=626889&domain=jobmd_job4resume&filter=false&cache=false'
{"v":"0.2","runtimeInfo":{},"status":true,"result":[{"rdna":9439262,"itemId":"y017017","itemType":"userName"},{"rdna":9439262,"itemId":"hwb1989","itemType":"userName"},{"rdna":9439262,"itemId":"carrie伊亿","itemType":"userName"},{"rdna":9439262,"itemId":"chenchunlian2015","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_4u2y6nu9","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_i1olqns9","itemType":"userName"},{"rdna":9439262,"itemId":"宜兰宜兰","itemType":"userName"},{"rdna":9439262,"itemId":"happyqiu2010","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_kd8y8tb6","itemType":"userName"},{"rdna":9439262,"itemId":"gdmc_nana","itemType":"userName"}]}
## 丁香人才-职位召回职位
curl -X GET \
'http://172.16.1.3:7707/v2/recommend/?id=626889&domain=jobmd_job4job&filter=false&cache=false'
{"v":"0.2","runtimeInfo":{},"status":true,"result":[{"rdna":8390687,"itemId":"647516","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"626107","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"535387","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"567218","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"645455","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"535349","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"629055","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"658487","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"652572","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"648398","itemType":"jobmd_entwork"}]}
# app2
## 丁香园 APP 推荐频道
curl -X GET \
'http://172.16.2.3:7707/v3/recommend/?id=shenzhongji&domain=bbs_app_recomm&cache=false&filter=false'
{"result":[{"rdna":7442445,"itemid":37856851,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37749454,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37719200,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37777461,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37848887,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37756034,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37777635,"itemType":1,"type":"bbs_topic"},{"rdna":7442447,"itemid":516789,"itemType":5,"type":"cms_article"},{"rdna":7442445,"itemid":37817270,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37816388,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":205,"userId":"shenzhongji","supply_time":-1,"fetchCache_time":-1,"abtest_time":0,"domain":"bbs_app_recomm","cached":false,"eventTime":1510801236746,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"rerank_time":175,"total_time":381},"status":true}
## 丁香园 APP 热门频道
curl -X GET \
'http://172.16.2.3:7707/v3/recommend/?id=&domain=bbs_app_hot&cache=false&filter=false'
{"result":[{"rdna":1071642621,"itemid":37865780,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":30936325,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":16995034,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":36718306,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":35232105,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":37869137,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":37352146,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":30131958,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":19203951,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":4761839,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":-1,"userId":"","supply_time":-1,"fetchCache_time":-1,"abtest_time":-1,"domain":"bbs_app_hot","cached":false,"eventTime":1510800607634,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"total_time":1,"rerank_time":-1},"status":true}
## 丁香园 APP 频道聚合
curl -X GET \
'http://172.16.2.3:7707/v3/recommend/?id=2&domain=bbs_app_channel&filter=false'
{"result":[{"rdna":10486824,"itemid":37870071,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869672,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869670,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869024,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869012,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868984,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868174,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868054,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37867402,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37867151,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":46,"userId":"2","supply_time":-1,"fetchCache_time":-1,"abtest_time":0,"domain":"bbs_app_channel","cached":false,"eventTime":1510800550050,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"rerank_time":51,"total_time":97},"status":true}
## 丁香人才-职位召回简历
curl -X GET \
'http://172.16.2.3:7707/v2/recommend/?id=626889&domain=jobmd_job4resume&filter=false&cache=false'
{"v":"0.2","runtimeInfo":{},"status":true,"result":[{"rdna":9439262,"itemId":"y017017","itemType":"userName"},{"rdna":9439262,"itemId":"hwb1989","itemType":"userName"},{"rdna":9439262,"itemId":"carrie伊亿","itemType":"userName"},{"rdna":9439262,"itemId":"chenchunlian2015","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_4u2y6nu9","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_i1olqns9","itemType":"userName"},{"rdna":9439262,"itemId":"宜兰宜兰","itemType":"userName"},{"rdna":9439262,"itemId":"happyqiu2010","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_kd8y8tb6","itemType":"userName"},{"rdna":9439262,"itemId":"gdmc_nana","itemType":"userName"}]}
## 丁香人才-职位召回职位
curl -X GET \
'http://172.16.2.3:7707/v2/recommend/?id=626889&domain=jobmd_job4job&filter=false&cache=false'
{"v":"0.2","runtimeInfo":{},"status":true,"result":[{"rdna":8390687,"itemId":"647516","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"626107","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"535387","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"567218","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"645455","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"535349","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"629055","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"658487","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"652572","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"648398","itemType":"jobmd_entwork"}]}
# app3
## 丁香园 APP 推荐频道
curl -X GET \
'http://172.16.3.3:7707/v3/recommend/?id=shenzhongji&domain=bbs_app_recomm&cache=false&filter=false'
{"result":[{"rdna":7442445,"itemid":37856851,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37749454,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37719200,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37777461,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37848887,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37756034,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37777635,"itemType":1,"type":"bbs_topic"},{"rdna":7442447,"itemid":516789,"itemType":5,"type":"cms_article"},{"rdna":7442445,"itemid":37817270,"itemType":1,"type":"bbs_topic"},{"rdna":7442445,"itemid":37816388,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":205,"userId":"shenzhongji","supply_time":-1,"fetchCache_time":-1,"abtest_time":0,"domain":"bbs_app_recomm","cached":false,"eventTime":1510801236746,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"rerank_time":175,"total_time":381},"status":true}
## 丁香园 APP 热门频道
curl -X GET \
'http://172.16.3.3:7707/v3/recommend/?id=&domain=bbs_app_hot&cache=false&filter=false'
{"result":[{"rdna":1071642621,"itemid":37865780,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":30936325,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":16995034,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":36718306,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":35232105,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":37869137,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":37352146,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":30131958,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":19203951,"itemType":1,"type":"bbs_topic"},{"rdna":1071642621,"itemid":4761839,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":-1,"userId":"","supply_time":-1,"fetchCache_time":-1,"abtest_time":-1,"domain":"bbs_app_hot","cached":false,"eventTime":1510800607634,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"total_time":1,"rerank_time":-1},"status":true}
## 丁香园 APP 频道聚合
curl -X GET \
'http://172.16.3.3:7707/v3/recommend/?id=2&domain=bbs_app_channel&filter=false'
{"result":[{"rdna":10486824,"itemid":37870071,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869672,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869670,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869024,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37869012,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868984,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868174,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37868054,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37867402,"itemType":1,"type":"bbs_topic"},{"rdna":10486824,"itemid":37867151,"itemType":1,"type":"bbs_topic"}],"v":"0.0.1","runtimeInfo":{"filter_time":-1,"recall_time":46,"userId":"2","supply_time":-1,"fetchCache_time":-1,"abtest_time":0,"domain":"bbs_app_channel","cached":false,"eventTime":1510800550050,"add2filter_time":-1,"add2cache_time":-1,"getMenu_time":-1,"rerank_time":51,"total_time":97},"status":true}
## 丁香人才-职位召回简历
curl -X GET \
'http://172.16.3.3:7707/v2/recommend/?id=626889&domain=jobmd_job4resume&filter=false&cache=false'
{"v":"0.2","runtimeInfo":{},"status":true,"result":[{"rdna":9439262,"itemId":"y017017","itemType":"userName"},{"rdna":9439262,"itemId":"hwb1989","itemType":"userName"},{"rdna":9439262,"itemId":"carrie伊亿","itemType":"userName"},{"rdna":9439262,"itemId":"chenchunlian2015","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_4u2y6nu9","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_i1olqns9","itemType":"userName"},{"rdna":9439262,"itemId":"宜兰宜兰","itemType":"userName"},{"rdna":9439262,"itemId":"happyqiu2010","itemType":"userName"},{"rdna":9439262,"itemId":"dxy_kd8y8tb6","itemType":"userName"},{"rdna":9439262,"itemId":"gdmc_nana","itemType":"userName"}]}
## 丁香人才-职位召回职位
curl -X GET \
'http://172.16.3.3:7707/v2/recommend/?id=626889&domain=jobmd_job4job&filter=false&cache=false'
{"v":"0.2","runtimeInfo":{},"status":true,"result":[{"rdna":8390687,"itemId":"647516","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"626107","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"535387","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"567218","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"645455","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"535349","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"629055","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"658487","itemType":"jobmd_entwork"},{"rdna":8390688,"itemId":"652572","itemType":"jobmd_entwork"},{"rdna":8390687,"itemId":"648398","itemType":"jobmd_entwork"}]}
Recall 接口
# app4 请求
curl -X GET \
'http://172.16.7.3:8765/v1/recall/?idType=jobmd_entwork&maxSize=10&id=550531&recallId=30'
# app4 返回
{"status":400,"algorithm":"30","result":[{"id":"guichungen","idType":"userName"},{"id":"yxwsd","idType":"userName"},{"id":"qq398491500","idType":"userName"},{"id":"Dilfuruz","idType":"userName"},{"id":"xfgwhc","idType":"userName"},{"id":"1129683095wxx","idType":"userName"},{"id":"HYAN121","idType":"userName"},{"id":"Adelinelee","idType":"userName"},{"id":"xiaoshandezhu","idType":"userName"},{"id":"Infinitybeiru","idType":"userName"}]}
# app5 请求
curl -X GET \
'http://172.16.8.3:8765/v1/recall/?idType=jobmd_entwork&maxSize=10&id=550531&recallId=32'
# app5 返回
{"status":400,"algorithm":"32","result":[{"id":"666591","idType":"jobmd_entwork"},{"id":"665250","idType":"jobmd_entwork"},{"id":"545174","idType":"jobmd_entwork"},{"id":"659926","idType":"jobmd_entwork"},{"id":"658361","idType":"jobmd_entwork"},{"id":"655208","idType":"jobmd_entwork"}]}
Rerank 接口
# app8 请求
curl -X POST \
http://10.25.48.2:8764/v1/rerank/ \
-d '{
"rerankId": "9",
"domain": "jobmd_job4resume",
"pid": {
"id": "664310",
"idType": "jobmd_entwork"
},
"recallResults": [
{
"recallId": "30",
"items": [
{
"id": "dxy_4mirv0s9",
"idType": "userName"
},
{
"id": "dxy_hf3h3ie3",
"idType": "userName"
}
]
}
]
}
'
# app8 返回
{"status":400,"result":[{"id":"dxy_hf3h3ie3","idType":"userName"},{"id":"dxy_4mirv0s9","idType":"userName"}]}
# app9 请求
curl -X POST \
http://10.25.68.19:8764/v1/rerank/ \
-d '{
"rerankId": "9",
"domain": "jobmd_job4resume",
"pid": {
"id": "664310",
"idType": "jobmd_entwork"
},
"recallResults": [
{
"recallId": "30",
"items": [
{
"id": "dxy_4mirv0s9",
"idType": "userName"
},
{
"id": "dxy_hf3h3ie3",
"idType": "userName"
}
]
}
]
}
'
# app9 返回
{"status":400,"result":[{"id":"dxy_hf3h3ie3","idType":"userName"},{"id":"dxy_4mirv0s9","idType":"userName"}]}