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
560
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
85
Comunicarse en tiempos de remoto
ydarias
0
330
No Code vs Code
ydarias
0
30
12 Factor Applications
ydarias
2
140
Evolutionary Architectures
ydarias
1
270
Microservices lightningtalk
ydarias
1
350
BetaBeers Salamanca
ydarias
1
200
Runnics at ProductHunt Madrid
ydarias
0
210
Otogami at Tetuan Valley
ydarias
0
80
Other Decks in Programming
See All in Programming
テスト駆動Kaggle
isax1015
0
370
チームで開発し事業を加速するための"良い"設計の考え方 @ サポーターズCoLab 2025-07-08
agatan
1
440
NPOでのDevinの活用
codeforeveryone
0
850
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
740
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
790
ふつうの技術スタックでアート作品を作ってみる
akira888
1
890
Python型ヒント完全ガイド 初心者でも分かる、現代的で実践的な使い方
mickey_kubo
1
130
効率的な開発手段として VRTを活用する
ishkawa
0
140
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
290
Deep Dive into ~/.claude/projects
hiragram
14
2.6k
Team operations that are not burdened by SRE
kazatohiei
1
320
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
130
Featured
See All Featured
Become a Pro
speakerdeck
PRO
29
5.4k
Building Adaptive Systems
keathley
43
2.7k
Adopting Sorbet at Scale
ufuk
77
9.5k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Side Projects
sachag
455
42k
How STYLIGHT went responsive
nonsquared
100
5.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
690
Writing Fast Ruby
sferik
628
62k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
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