Skip to content
Pierre Lindenbaum edited this page Jul 10, 2015 · 4 revisions

##Motivation

Monitor/interrupt/break a VCF stream with java JMX http://www.oracle.com/technetwork/articles/java/javamanagement-140525.html . When multiple workflows are running, this tool gives the opportunity to visualize the current context in a jconsole ( https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html ) and to interrupt the stream.

##Compilation

See also Compilation.

$  make vcfjmx

##Synopsis

$ java -jar dist/vcfjmx.jar (stdin|file) 

##Options

Option Description
-p (stream-identifier) will be displayed in the JMX console to identify the stream, Optional.
-h get help (this screen) and exit.
-v print version and exit.
-L (level) log level. One of java.util.logging.Level . Optional.

##Source Code

Main code is: https://github.com/lindenb/jvarkit/blob/master/src/main/java/com/github/lindenb/jvarkit/tools/jmx/VcfJmx.java

##Example

$   java -jar dist/vcfjmx.jar -p MyWorkflow1 input.vcf > /dev/null

while the stream is running, open a new jconsole https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html . here you can get the number of records, the elapsed time. Two operation are available:

  • doBreak: interrupt current streaming , exit with success (0)
  • doAbort: interrupt current streaming , exit with failure (-1)
$ java -jar dist/vcfjmx.jar -p 1000G  ALL.wgs.phase3_shapeit2_mvncall_integrated_v5a.20130502.sites.vcf.gz | \
    java -jar dist/vcfjmx.jar  -p 1000G-2  |\
    java -jar dist/vcfjmx.jar  -p 1000G-3  |\
    java -jar dist/vcfjmx.jar  -p 1000G-4 > /dev/null

[INFO/VcfJmx] 2015-07-10 14:11:08 "Starting JOB at Fri Jul 10 14:11:08 CEST 2015 com.github.lindenb.jvarkit.tools.jmx.VcfJmx version=4f797a9fbf2c3ceac9cec3c431c719ad794953c2  built=2015-07-10:13-07-05"
[INFO/VcfJmx] [INFO/VcfJmx] 2015-07-10 14:11:08 "Command Line args : -p 1000G-2"
2015-07-10 14:11:08 "Starting JOB at Fri Jul 10 14:11:08 CEST 2015 com.github.lindenb.jvarkit.tools.jmx.VcfJmx version=4f797a9fbf2c3ceac9cec3c431c719ad794953c2  built=2015-07-10:13-07-05"
[INFO/VcfJmx] 2015-07-10 14:11:08 "Command Line args : -p 1000G-3"
[INFO/VcfJmx] 2015-07-10 14:11:08 "Starting JOB at Fri Jul 10 14:11:08 CEST 2015 com.github.lindenb.jvarkit.tools.jmx.VcfJmx version=4f797a9fbf2c3ceac9cec3c431c719ad794953c2  built=2015-07-10:13-07-05"
[INFO/VcfJmx] 2015-07-10 14:11:08 "Command Line args : -p 1000G ALL.wgs.phase3_shapeit2_mvncall_integrated_v5a.20130502.sites.vcf.gz"
[INFO/VcfJmx] 2015-07-10 14:11:08 "Executing as lindenb@kaamelot-master01 on Linux 2.6.32-431.17.1.el6.x86_64 amd64; Java HotSpot(TM) 64-Bit Server VM 1.7.0_60-b19"
[INFO/VcfJmx] 2015-07-10 14:11:08 "Executing as lindenb@kaamelot-master01 on Linux 2.6.32-431.17.1.el6.x86_64 amd64; Java HotSpot(TM) 64-Bit Server VM 1.7.0_60-b19"
[INFO/VcfJmx] 2015-07-10 14:11:08 "Executing as lindenb@kaamelot-master01 on Linux 2.6.32-431.17.1.el6.x86_64 amd64; Java HotSpot(TM) 64-Bit Server VM 1.7.0_60-b19"
[INFO/VcfJmx] 2015-07-10 14:11:08 "reading from stdin"
[INFO/VcfJmx] 2015-07-10 14:11:08 "reading from stdin"
[INFO/VcfJmx] 2015-07-10 14:11:08 "reading from ALL.wgs.phase3_shapeit2_mvncall_integrated_v5a.20130502.sites.vcf.gz"
[SEVERE/VcfJmx] 2015-07-10 14:11:46 "#### Process "1000G-3" received message BREAK"
[INFO/VcfJmx] 2015-07-10 14:11:46 "Number of Variants:1130774"
[INFO/VcfJmx] 2015-07-10 14:11:46 "End JOB status=0 [Fri Jul 10 14:11:46 CEST 2015] com.github.lindenb.jvarkit.tools.jmx.VcfJmx done. Elapsed time: 0.64 minutes."
[INFO/VcfJmx] 2015-07-10 14:11:46 "Number of Variants:1120774"
[INFO/VcfJmx] 2015-07-10 14:11:46 "Number of Variants:1110975"
[INFO/VcfJmx] 2015-07-10 14:11:46 "End JOB status=0 [Fri Jul 10 14:11:46 CEST 2015] com.github.lindenb.jvarkit.tools.jmx.VcfJmx done. Elapsed time: 0.64 minutes."
[INFO/VcfJmx] 2015-07-10 14:11:46 "End JOB status=0 [Fri Jul 10 14:11:46 CEST 2015] com.github.lindenb.jvarkit.tools.jmx.VcfJmx done. Elapsed time: 0.64 minutes."

Contribute

##See also

##History

  • 2015 : Creation

License

The project is licensed under the MIT license.

Clone this wiki locally