An Open Source Instrumentation Tool for the Hotspot...

34
Thermostat An Open Source Instrumentation Tool for the Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red Hat Developer Conference 2013

Transcript of An Open Source Instrumentation Tool for the Hotspot...

Page 1: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

Thermostat

An Open SourceInstrumentation Tool for theHotspot JVM

Severin Gehwolf, Red HatMario Torre, Red Hat

Developer Conference 2013

Page 2: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

2/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Agenda

● What is it exactly this Thermostat?● How does Thermostat work?● Current and upcoming features● Thermostat plug-ins 101● Demo/Hack Session

Page 3: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

3

The Tool Explained(a.k.a. What is this tool exactly?)

Page 4: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

4/34 Severin Gehwolf & Mario Torre Feb 23, 2013

What is Thermostat?

Monitoring

Diagnostics

Tuning

Profiling

OpenSource

OpenJDK

Page 5: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

5/34 Severin Gehwolf & Mario Torre Feb 23, 2013

What is Thermostat?

Monitoring

Diagnostics

Tuning

Profiling

OpenSource

OpenJDK

Information Hub

Page 6: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

6/34 Severin Gehwolf & Mario Torre Feb 23, 2013

What is Thermostat?

AS

JVM

OS

Page 7: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

7/34 Severin Gehwolf & Mario Torre Feb 23, 2013

What is Thermostat?

AS

JVM

OS

Vertical Integration

Page 8: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

8/34 Severin Gehwolf & Mario Torre Feb 23, 2013

What is Thermostat?

Local Remote Cluster Cloud?

Page 9: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

9/34 Severin Gehwolf & Mario Torre Feb 23, 2013

What is Thermostat?

Horizontal Integration

Page 10: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

10/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Lines of Code

Source: https://www.ohloh.net/p/thermostat-monitoring-tool

Page 11: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

11/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Commits Per Month

Source: https://www.ohloh.net/p/thermostat-monitoring-tool

Page 12: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

12

Current and Upcoming Features

Page 13: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

13/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Current Features

● CPU monitoring

● Memory usage

● GC invocations

● Thread monitoring

● Heap dump analysis

● Classloader information

● Numa

Page 14: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

14/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Upcoming Features

● Finish NUMA support● JVM tuning● Systemtap / oprofile backend● Memory leak & deadlock analysis● Eclipse client/IDE integration● Web client● Host / JVM issues overview● Open Shift deployment. Maybe?

Page 15: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

15

Cool!How Does It Work?

Page 16: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

16/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Agent, Client, Storage Approach

Page 17: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

17/34 Severin Gehwolf & Mario Torre Feb 23, 2013

How Does It Work?

Agents

Page 18: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

18/34 Severin Gehwolf & Mario Torre Feb 23, 2013

How Does It Work?

Storage

Page 19: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

19/34 Severin Gehwolf & Mario Torre Feb 23, 2013

How Does It Work?

Clients

Page 20: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

20/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Where Is The Data Coming From?

● JvmStat

● JMX

● /proc

● Systemtap

● Oprofile

● App Server

Page 21: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

21/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Where Is The Data Coming From?

● JvmStat

● JMX

● /proc

● Systemtap

● Oprofile

● App Server

At Present

In Future

Page 22: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

22

Plug-in 101

Page 23: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

23/34 Severin Gehwolf & Mario Torre Feb 23, 2013

The Basics (1)

● Extensible through plug-ins

● OSGi

● Write your own agent extensions

● Write your own client extensions

● plugin.xml file tells Thermostat about your new

bundles

Page 24: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

24/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Recall...

Agents

Page 25: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

25/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Agent Extensions

Numa

Backends

Page 26: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

26/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Storage Extensions

NumaDAO

DAOs

Page 27: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

27/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Client Extensions

InformationService

VmRef HostRef

Page 28: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

28/34 Severin Gehwolf & Mario Torre Feb 23, 2013

The Basics (2)

● Backend's extend agents

● Data Access Objects (DAO) extend Storage

● InformationService's extend GUI

● Can bind UI to...

– HostRef (a specific host/agent)

– VmRef (a specific JVM)

Page 29: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

29/34 Severin Gehwolf & Mario Torre Feb 23, 2013

plugin.xml<?xml version="1.0" ?><plugin> <commands> <command type="extends"> <name>gui</name> <bundles> <bundle>your-plugin-0.1-SNAPSHOT.jar</bundle> </bundles> </command> <command type="provides"> <name>hello</name> <description>Prints hello</description> <usage>hello</usage> <bundles> <bundle>your-hello-world-plugin-0.1-SNAPSHOT.jar</bundle> </bundles> <dependencies> <dependency>thermostat-client-core-0.6.0-SNAPSHOT.jar</dependency> </dependencies> </command> </commands></plugin>

Page 30: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

30

Questions?

Page 31: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

31/34 Severin Gehwolf & Mario Torre Feb 23, 2013

Why This New Tool?

● Scalability● Avoiding unwanted dependencies.● Written in Java, by Java devs, for Java devs.● Flexible data model● Developer ego (This is joke. You laugh

now).

Page 32: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

32

Demo/Hack Session Time!

Page 33: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

33/34 Severin Gehwolf & Mario Torre Feb 23, 2013

References

● Homepage: http://icedtea.classpath.org/thermostat/

● Code: http://icedtea.classpath.org/hg/thermostat

● Mailing list: http://icedtea.classpath.org/mailman/listinfo/thermostat

● IRC: #thermostat on freenode.net

● Duke images from around the net

● http://jroller.com/neugens/entry/thermostat_scheduler_plugin_a_walk

Page 34: An Open Source Instrumentation Tool for the Hotspot JVMjerboaa.fedorapeople.org/presentations/Thermostat... · 23.02.2013  · Hotspot JVM Severin Gehwolf, Red Hat Mario Torre, Red

34

Thank You!Kudos to Mario and Omair for providing most of the plug-in code!