使用`ttop`命令将线程关联到捆绑

时间:2019-01-21 08:44:31

标签: apache-karaf

我在Apache Karaf(版本4.1.3)控制台中使用list命令列出捆绑包。通常,由于执行list命令而导致我进入Apache Karaf控制台:

 963 │ Active    │  80 │ 1.3.1                              │ OPS4J Pax JDBC Pooling Support Base
 964 │ Active    │  80 │ 4.1.3                              │ Apache Karaf :: JDBC :: Core
1274 │ Active    │  80 │ 1.3.1                              │ OPS4J Pax JDBC Generic Driver Extender
1640 │ Active    │  50 │ 2.17.6                             │ camel-amqp
1658 │ Active    │  50 │ 5.14.5                             │ activemq-karaf
1660 │ Active    │  50 │ 5.14.5                             │ activemq-web-console
1685 │ Active    │  50 │ 0                                  │ wrap_file__opt_Talend-6.5.1_runtime_system_io_netty_netty-all_4.0.17.Final_netty-all-4.0.17.Final.jar
1686 │ Active    │  50 │ 0                                  │ wrap_file__opt_Talend-6.5.1_runtime_system_org_apache_qpid_proton-j_0.12.0_proton-j-0.12.0.jar
1687 │ Active    │  50 │ 0                                  │ wrap_file__opt_Talend-6.5.1_runtime_system_org_apache_qpid_qpid-jms-client_0.8.0_qpid-jms-client-0.8.0.jar
1843 │ Installed │  80 │ 0.2.1.M1-SNAPSHOT                  │ Apache Karaf :: Shell aetos/ktop Commands
1871 │ Active    │  80 │ 0.21.0.SNAPSHOT                    │ job_rest_000_profile
1902 │ Active    │  80 │ 0.5.0.SNAPSHOT                     │ job_rest_000_reservation_quality_status
1924 │ Active    │  80 │ 0.22.0.SNAPSHOT                    │ job_rest_000_qualityStatus
1925 │ Active    │  80 │ 0.3.0.SNAPSHOT                     │ job_app_000_tcfile_delete_invoices
1926 │ Active    │  80 │ 0.18.0.SNAPSHOT                    │ job_rest_000_rules
1933 │ Active    │  80 │ 1.0.0.SNAPSHOT                     │ job_app_001_service_submissions
1934 │ Active    │  80 │ 1.0.0.SNAPSHOT                     │ job_rest_000_downloadTCFiles
1935 │ Active    │  80 │ 0.12.0.SNAPSHOT                    │ job_rest_000_sendToStewardship

然后,您还可以使用命令ttop查看线程及其相应的CPU时间。然后,您将获得一个类似于这样的线程的视图:

  TID NAME                                     STATE                T-CPU LOCK-OWNER-ID                                                                                                      
  27714 qtp1567745313-27714                      timed_waiting        0.000                                                                                                                    
  27712 RMI TCP Connection(idle)                 timed_waiting        0.004                                                                                                                    
  27711 RMI TCP Connection(idle)                 timed_waiting        0.000                                                                                                                    
  27708 qtp1567745313-27708                      runnable             0.001                                                                                                                    
  27707 qtp1567745313-27707                      runnable             0.041                                                                                                                    
  27704 pipe-ttop                                runnable             2.449                                                                                                                    
  27703 job controller 1                         waiting              3.083                                                                                                                    
  27702 qtp1567745313-27702                      timed_waiting        0.070                                                                                                                    
  27696 qtp1567745313-27696                      runnable             0.002                                                                                                                    
  27693 qtp1567745313-27693                      runnable             0.005                                                                                                                    
  27669 Karaf SSH terminal non blocking reade... timed_waiting        0.073                                                                                                                    
  27664 Karaf ssh console user tadmin            waiting              0.382                                                                                                                    
  27663 org.apache.karaf.shell.ssh.SshTermina... waiting              0.008                                                                                                                    
  17506 pool-36-thread-17                        timed_waiting        0.454                                                                                                                    
  15683 pool-36-thread-16                        timed_waiting        0.520                                                                                                                    
  15502 Thread-11922                             runnable      67:27:06.691                                                                                                                    
  15278 pool-36-thread-15                        timed_waiting        0.444                                                                                                                    
  15233 qtp1567745313-15233                      waiting              0.232                                                                                                                    
  14853 pool-36-thread-14                        timed_waiting        0.464                                                                                                                    
  11991 pool-36-thread-13                        timed_waiting        0.466                                                                                                                    
  11862 pool-36-thread-12                        timed_waiting        0.518       

我在这里的问题是,您如何才能说特定线程与特定捆绑软件相关联。例如,您有一个消耗大量CPU的线程。它应与特定的捆绑包关联。如果您看到有这样一个线程:

15502 Thread-11922

如何找出与线程关联的束。有办法吗?

0 个答案:

没有答案