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

用http的方式调用watch,偶现cost的值是当前时间的时间戳 #2565

Open
VanillaIceCreams opened this issue Jun 19, 2023 · 1 comment

Comments

@VanillaIceCreams
Copy link

  • Arthas 版本: 3.6.9
  • 操作系统版本: centos
  • 目标进程的JVM版本: openjdk1.8

Snipaste_2023-06-19_22-49-32

6秒的是正常的,1.xxxE8的是错的。

(debug时看了下,好像是threadLocal里的stack,有时候会先进pop而不是Push...)

@hengyunabc
Copy link
Collaborator

的确是有可能的,是实现和效率的考虑。 大概来说是这个原因

  1. 增强代码要在 函数入口执行一小段代码,这里要统计 开始时间
  2. 增强代码要在 函数结尾执行一小段代码,这里要统计 结束时间
  3. 两者相减是 cost

但是可能会出现这种情况:

  • 应用代码运行到 1 ,2 之间时,插入增强的代码,那么就会只有 函数结尾 的数据,所以就不准确了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants