Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Java and the Furious (JMX)
Search
Yeray Darias
November 18, 2016
Programming
2
540
The Java and the Furious (JMX)
Talk given at Codemotion 2016 in Madrid about how to measure (Java) code speed and health with JMX.
Yeray Darias
November 18, 2016
Tweet
Share
More Decks by Yeray Darias
See All by Yeray Darias
Ingeniería vs Product: Una historia de (des)amor
ydarias
0
71
Comunicarse en tiempos de remoto
ydarias
0
320
No Code vs Code
ydarias
0
29
12 Factor Applications
ydarias
2
130
Evolutionary Architectures
ydarias
1
260
Microservices lightningtalk
ydarias
1
320
BetaBeers Salamanca
ydarias
1
180
Runnics at ProductHunt Madrid
ydarias
0
210
Otogami at Tetuan Valley
ydarias
0
78
Other Decks in Programming
See All in Programming
103 Early Hints
sugi_0000
1
200
Jakarta EE meets AI
ivargrimstad
0
210
命名をリントする
chiroruxx
1
370
From Translations to Multi Dimension Entities
alexanderschranz
2
120
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
430
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
240
talk-with-local-llm-with-web-streams-api
kbaba1001
0
170
Recoilを剥がしている話
kirik
5
6.6k
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
競技プログラミングで 基礎体力を身につけよう / You can get basic skills through competitive programming
mdstoy
0
170
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
0
190
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
We Have a Design System, Now What?
morganepeng
51
7.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
A designer walks into a library…
pauljervisheath
204
24k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.3k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Being A Developer After 40
akosma
87
590k
Rails Girls Zürich Keynote
gr2m
94
13k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Transcript
The JAVA and the FURIOUS Talk by Yeray Darias at
Codemotion in Madrid on Friday, 18 November 2016
The JAVA and the FURIOUS Cómo medir la velocidad de
tu código Java con JMX
JMX Java Management eXtensions
None
@ydarias Yeray Darias SOFTWARE DEVELOPER
[email protected]
• 35YO • BSc Computer Science • Agile evangelist •
Cook • Science geek • Future space rocket builder • Sketchnoting practitioner Yeray Darias
Let’s start
None
None
What is JMX?
JMX manage Web Browser MBean Server MBean MBean MBean JVM
Agent level Instrumentation level Services level
JMX manage Web Browser MBean Server MBean MBean MBean JVM
Agent level Instrumentation level Services level
What is JMX?
What is JMX for?
Monitoring
Manage
None
JMX manager Web Browser MBean Server MBean MBean MBean JVM
Instrumentation Level
Define the interface public interface SystemStatsMBean { public long getTotalWrites();
public long setTimeout(long timeout); }
Implement the interface public class SystemStats implements SystemStatsMBean { public
long getTotalWrites() { … } public void setTimeout(long timeout) { … } }
Register MBean SystemStats systemStats = new SystemStats(metrics, configuration); MBeanServer
beansServer = ManagementFactory.getPlatformMBeanServer(); ObjectName beanName = new ObjectName(“…”); beansServer.registerMBean( systemStats, beanName);
Launch & connect
Where is the f·$%& demo?
Good practices defining MBeans Good practices
None
No way
Single responsibility principle Don’t mix your “core” with instrumentation code.
It is a lot of work, isn’t it?
None
Demo time
JMX manager Web Browser MBean Server MBean MBean MBean JVM
Services Level
The “official” options
None
None
None
The “unofficial” options
None
None
None
Tons of options
The options “ultra pro”
The options “expensive”
None
None
None
None
The “craftsman” option
Connect to the server JMXServiceURL url = new JMXServiceURL(…); JMXConnector
connector = JMXConnectorFactory.connect(url); MBeanServerConnection serverConnection = connector.getMBeanServerConnection();
Search the MBean ObjectName mbeanName = new ObjectName(…); SystemStatsMBean statsProxy
= MBeanServerInvocationHandler.newProxyInstance( serverConnection, mbeanName, SystemStatsMBean.class, true);
None
Last demo Last demo
This is all?
Interesting links http://bit.ly/codemotion2016-links
Slides Speaker Deck http://bit.ly/codemotion2016-slides
Q & A