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

tt 命令添加条件后观察不到结果 #2989

Open
weiye-Lee opened this issue Feb 14, 2025 · 0 comments
Open

tt 命令添加条件后观察不到结果 #2989

weiye-Lee opened this issue Feb 14, 2025 · 0 comments

Comments

@weiye-Lee
Copy link

Hi arthas✌️

我遇到了一个关于使用tt 条件的问题,发现使用了条件获取不到期望的结果

没有条件观察时

可以看到1836 号的结果第二个参数的值是@String[com.xxx.xxx.xxx.project.controller.ProjectController]

[arthas@1]$ tt -t org.springframework.beans.factory.support.DefaultListableBeanFactory resolveDependency -n 100000
[arthas@1]$ tt -i 1836
 INDEX            1836                                                                                                                                         
 GMT-CREATE       2025-02-13 17:41:39.836                                                                                                                      
 COST(ms)         2669.562054                                                                                                                                  
 OBJECT           0x2fef4ca1                                                                                                                                   
 CLASS            org.springframework.beans.factory.support.DefaultListableBeanFactory                                                                         
 METHOD           resolveDependency                                                                                                                            
 IS-RETURN        false                                                                                                                                        
 IS-EXCEPTION     true                                                                                                                                         
 PARAMETERS[0]    @DependencyDescriptor[                                                                                                                       
                      declaringClass=@Class[class com.xxx.xxx.xxx.project.controller.ProjectController],                                             
                      methodName=null,                                                                                                                         
                      parameterTypes=null,                                                                                                                     
                      parameterIndex=@Integer[0],                                                                                                              
                      fieldName=@String[projectService],                                                                                                       
                      required=@Boolean[true],                                                                                                                 
                      eager=@Boolean[true],                                                                                                                    
                      nestingLevel=@Integer[1],                                                                                                                
                      containingClass=@Class[class com.xxx.xxx.xxx.project.controller.ProjectController],                                            
                      resolvableType=@ResolvableType[com.xxx.xxx.xxx.project.service.XXXProjectService],                                         
                      typeDescriptor=null,                                                                                                                     
                      methodParameter=null,                                                                                                                    
                      field=@Field[private com.xxx.xxx.xxx.project.service.XXXProjectService com.xxx.xxx.xxx.project.controller.Projec 
                  tController.projectService],                                                                                                                 
                      fieldAnnotations=@Annotation[][isEmpty=false;size=1],                                                                                    
                  ]                                                                                                                                            
 PARAMETERS[1]    @String[com.xxx.xxx.xxx.project.controller.ProjectController] 


 [arthas@1]$ tt -t org.springframework.beans.factory.support.DefaultListableBeanFactory resolveDependency 'params[1]=="com.xxx.xxx.xxx.project.controller.ProjectController"' -n 10000
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 366 ms, listenerId: 5

使用了条件后

tt -t org.springframework.beans.factory.support.DefaultListableBeanFactory resolveDependency 'params[1]=="com.xxx.xxx.xxx.project.controller.ProjectController"' -n 10000 观察不到结果

期望

期望是添加了条件后能得到1836 号同样的结果

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

No branches or pull requests

1 participant