TP指标: TP50:指在一个时间段内(如5分钟),统计该方法每次调用所消耗的时间,并将这些时间按从小到大的顺序进行排序,取第50%的那个值作为TP50 值;配置此监控指标对应的报警阀值后,需要保证在这个时间段内该方法所有调用的消耗时间至少有50%的值要小于此阀值,否则系统将会报警。

TP90,TP99,TP999与TP50值计算方式一致,它们分别代表着对方法的不同性能要求,TP50相对较低,TP90则比较高,TP99,TP999则对方法性能要求很高。

The tp90 is a minimum time under which 90% of requests have been served.

tp90 = top percentile 90

Imagine you have response times:

10s

1000s

100s

2s

Calculating TP is very simple:

1. Sort all times in ascending order: [2s, 10s, 100s, 1000s]

2. find latest item in portion you need to calculate.

2.1 For TP50 it will be ceil(4*0.5) = 2 requests. You need 2nd request.

2.2 For TP90 it will be ceil(4*0.9) = 4. You need 4th request.

3. We get time for the item found above. TP50=10s. TP90=1000s

可以认为 TP90的意思是保证90%请求都能被响应的最小耗时。

TP=Top Percentile,Top百分数,是一个统计学里的术语,与平均数、中位数都是一类。

TP50、TP90和TP99等指标常用于系统性能监控场景,指高于50%、90%、99%等百分线的情况。