Apache Presto - JMX 连接器

Java 管理扩展 (JMX) 提供有关 Java 虚拟机和 JVM 内运行的软件的信息。 JMX连接器用于查询Presto服务器中的JMX信息。

因为我们已经启用了"etc/catalog"目录下的"jmx.properties"文件。 现在连接 Perst CLI 以启用 JMX 插件。

Presto CLI

查询

$ ./presto --server localhost:8080 --catalog jmx --schema jmx 

结果

您将收到以下回复。

presto:jmx> 

JMX 架构

要列出"jmx"中的所有模式,请键入以下查询。

查询

presto:jmx> show schemas from jmx; 

结果

      Schema 
-------------------- 
 information_schema  
 current

显示表格

要查看"当前"架构中的表,请使用以下命令。

查询 1

presto:jmx> show tables from jmx.current; 

结果

                                    Table                   
------------------------------------------------------------------------------
 com.facebook.presto.execution.scheduler:name = nodescheduler
 com.facebook.presto.execution:name = queryexecution
 com.facebook.presto.execution:name = querymanager
 com.facebook.presto.execution:name = remotetaskfactory
 com.facebook.presto.execution:name = taskexecutor
 com.facebook.presto.execution:name = taskmanager
 com.facebook.presto.execution:type = queryqueue,name = global,expansion = global
 ………………
 ……………….

查询 2

presto:jmx> select * from jmx.current.”java.lang:type = compilation"; 

结果

node               | compilationtimemonitoringsupported |      name   |         objectname         | totalcompilationti
--------------------------------------+------------------------------------+--------------------------------+----------------------------+-------------------
ffffffff-ffff-ffff-ffff-ffffffffffff | true | HotSpot 64-Bit Tiered Compilers | java.lang:type=Compilation |       1276

查询 3

presto:jmx> select * from jmx.current."com.facebook.presto.server:name = taskresource";

结果

 node                 | readfromoutputbuffertime.alltime.count 
 | readfromoutputbuffertime.alltime.max | readfromoutputbuffertime.alltime.maxer
 --------------------------------------+---------------------------------------+--------------------------------------+--------------------------------------- 
 ffffffff-ffff-ffff-ffff-ffffffffffff |                                   92.0 |                          1.009106149 |