Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持线程调用栈切面功能 #4

Open
kylixs opened this issue Nov 14, 2019 · 0 comments
Open

支持线程调用栈切面功能 #4

kylixs opened this issue Nov 14, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@kylixs
Copy link
Owner

kylixs commented Nov 14, 2019

Flare Profiler保存了每个线程的时序调用栈,可以计算到任意时刻的调用栈。虽然存在一定时间误差(采样间隔时间内),但对于问题诊断来说还是有较大的参考意义。

举例来说明:
查看线程调用栈火焰图时,发现某个时刻Logback写日志到文件时等待锁,持续超过1s。
需求:想看一下当时整体的线程调用栈,计算有多少个线程在等待锁,这个对于问题分析有很大意义。

实现方法:
Flare Profiler对每个线程的调用栈是按照增量方式保存,即取样时对比此线程上次的调用栈,如果发生变化则保存一个快照,否则忽略。
所有线程数据的时间都是相对于采样数据的开始收集时间,每个线程的调用栈单独按照发生的顺序保存到文件,同时建立了数据块的索引信息。
假如想要查看时刻t的线程调用栈,根据索引信息可以定位到某一个索引的时刻t1 <= 时刻t,则此索引对应的调用栈快照可以认为该线程时刻t的调用栈。我们知道在取样周期内没有更新,取样周期一般是5ms,对于分析锁等待之类的情况是非常短暂的,没有太大的影响。

@kylixs kylixs changed the title 支持线程切面功能 支持线程调用栈切面功能 Nov 14, 2019
@kylixs kylixs added the enhancement New feature or request label Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant