TP指標: TP50:指在一個時間段內(如5分鐘),統計該方法每次調用所消耗的時間,並將這些時間按從小到大的順序進行排序,取第50%的那個值做爲TP50 值;配置此監控指標對應的報警閥值後,須要保證在這個時間段內該方法全部調用的消耗時間至少有50%的值要小於此閥值,不然系統將會報警。性能
TP90,TP99,TP999與TP50值計算方式一致,它們分別表明着對方法的不一樣性能要求,TP50相對較低,TP90則比較高,TP99,TP999則對方法性能要求很高。blog
The tp90 is a minimum time under which 90% of requests have been served.排序
tp90 = top percentile 90get
Imagine you have response times:requests
10s
1000s
100s
2s數學
Calculating TP is very simple:it
1. Sort all times in ascending order: [2s, 10s, 100s, 1000s]io
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.test
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%等百分線的狀況。
參考
Stack Overflow:distributed system
爲何這種指標比平均數和中位數好:http://apmblog.dynatrace.com/2012/11/14/why-averages-suck-and-percentiles-are-great/