Apache Presto - JMX Connector

Java Management Extensions(JMX)提供有关在JVM中运行的Java虚拟机和软件的信息. JMX连接器用于查询Presto服务器中的JMX信息.

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

Presto CLI

查询

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

结果

您将收到以下回复.

presto:jmx>

JMX Schema

要列出"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

Query 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 |