Apache Presto - Connettore JMX

Java Management Extensions (JMX) fornisce informazioni sulla Java Virtual Machine e sul software in esecuzione all'interno di JVM. Il connettore JMX viene utilizzato per interrogare le informazioni JMX nel server Presto.

Come abbiamo già abilitato “jmx.properties” file sotto “etc/catalog”directory. Ora collega Perst CLI per abilitare il plugin JMX.

Presto CLI

Query

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

Risultato

Riceverai la seguente risposta.

presto:jmx>

Schema JMX

Per elencare tutti gli schemi in "jmx", digitare la seguente query.

Query

presto:jmx> show schemas from jmx;

Risultato

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

Mostra tabelle

Per visualizzare le tabelle nello schema "corrente", utilizzare il seguente comando.

Domanda 1

presto:jmx> show tables from jmx.current;

Risultato

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
 ………………
 ……………….

Domanda 2

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

Risultato

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

Domanda 3

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

Risultato

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