Arthas-trace


作用

方法內部調用路徑,並輸出方法路徑上的每個節點上耗時。

介紹

  • trace 命令能主動搜索 class-patternmethod-pattern 對應的方法調用路徑,渲染和統計整個調用鏈路上的所有性能開銷和追蹤調用鏈路
  • 觀察表達式的構成主要由 ognl 表達式組成,所以你可以這樣寫 "{params,returnObj}",只要是一個合法的 ognl 表達式,都能被正常支持
  • OGNL 表達式官網:https://commons.apache.org/proper/commons-ognl/language-guide.html
  • 很多時候我們只想看到某個方法的 rt 大於某個時間之后的 trace 結果,現在 Arthas 可以按照方法執行的耗時來進行過濾了
  • 例如 trace *StringUtils isBlank '#cost>100' 表示當執行時間超過 100ms 的時候,才會輸出 trace 的結果
trace demo.MathGame run

image-20211101130939835

trace demo.MathGame run -n 2

image-20211101131053701

trace --skipJDKMethod false demo.MathGame run -n 2

image-20211101131127838

trace demo.MathGame run "#cost>0.5"

image-20211101131710996

End


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM