本文是根据自己的总结和网络总结得出
1、TP 指标说明
TP指标: 指在一个时间段内,统计该方法每次调用所消耗的时间,并将这些时间按从小到大的顺序进行排序, 并取出结果为 : 总次数 * 指标数 = 对应TP指标的值, 在取出排序好的时间。
TP50、TP90、TP99、TP999 计算方式一致TP90,TP99,TP999则对方法性能要求很高。
2、国外资料:
- sort all times in ascending order: [2s, 10s, 100s, 1000s]
- find latest item in portion you need to calculate.
TP50 it will ceil(4*.5)=2 requests. You need 2nd request.
TP90 it will be ceil(4*.9)=4. You need 4th request.
get time for the item found above. TP50=10s. TP90=1000s
3 疑问: 为什么是去对应的取整值, 为什么不是平均值, 原文疑问
This doesn’t seem to match with the statistical definition of a percentile. Instead of using a ceiling to find an index, you should be averaging the two closest indices. For example, in a 4-element list, TP50 is the average of the 2nd and 3rd elements, not just the 2nd element. (This is assuming TP50 means the 50th percentile.) The exact formula is i=(k/100)(n+1) to find your desired index, where k is your percentile and n is the number of elements in your list. If i is not a whole number, average the two nearest indices.
译文:
这似乎不符合百分位的统计定义。 您应该对两个最接近的指数进行平均,而不是使用上限来查找指数。 例如,在4元素列表中,TP50是第二和第三元素的平均值,而不仅仅是第二元素。 (这是假设TP50表示第50个百分点。)准确的公式是i =(k / 100)(n + 1)以找到您想要的指数,其中k是您的百分比,n是您列表中的元素数量。 如果我不是一个整数,平均两个最接近的指数。
https://stackoverflow.com/questions//what-do-we-mean-by-top-percentile-or-tp-based-latency/#
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/232275.html原文链接:https://javaforall.net
