我是一个尝试学习kibana的新手。我已插入此数据。只是通过,失败并跳过计数测试用例计数到弹性。
testMethodsSummary.passed:0 testMethodsSummary.failed:1 testMethodsSummary.skipped:0 _id:AWBP0yDXO9VGNRQOwYSD _type:uc _index:msm _score:1 testMethodsSummary.passed:1 testMethodsSummary.failed:0 testMethodsSummary.skipped:0 _id:AWBP0wHiO9VGNRQOwYSC _type:uc _index:msm _score:1 testMethodsSummary.passed:5 testMethodsSummary.failed:1 testMethodsSummary.skipped:0 _id:AWBP0tthO9VGNRQOwYSB _type:bat _index:msm _score:1 testMethodsSummary.passed:1 testMethodsSummary.failed:0 testMethodsSummary.skipped:6 _id:AWBP0qTxO9VGNRQOwYSA _type:bat _index:msm _score:1
当我查询计数出来时,确定。
"聚合":{ " total_fail":{ "价值":2 }, " total_skipped":{ "价值":6 }, " total_pass":{ "价值":7 } }
但是当试图获得平均值时...平均通行证不是7/15 - 我甚至不知道这些数字的来源。
"聚合":{
" avg_fail":{
"价值":0.5
},
" avg_skip":{
"价值":1.5
},
" avg_pass":{
"价值":1.75
}
}
有人可以解释一下吗?
答案 0 :(得分:1)
Elasticsearch中的平均聚合是针对所有文档计算的。
有关平均聚合的更多信息: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-avg-aggregation.html
聚合":{" avg_fail":{"价值":0.5}," avg_skip":{"价值": 1.5}," avg_pass":{"价值":1.75}}
对于avg_fail它(所有失败的总和)/(索引中的总doc数),即2/4 = 0.5
同样,对于avg_skip,它的6/4 = 1.5,对于avg_pass,它的7/4 = 1.75