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
94
Comunicarse en tiempos de remoto
ydarias
0
340
No Code vs Code
ydarias
0
38
12 Factor Applications
ydarias
2
150
Evolutionary Architectures
ydarias
1
270
Microservices lightningtalk
ydarias
1
360
BetaBeers Salamanca
ydarias
1
210
Runnics at ProductHunt Madrid
ydarias
0
220
Otogami at Tetuan Valley
ydarias
0
82
Other Decks in Programming
See All in Programming
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1.4k
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
330
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
130
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
7
3.1k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
310
Ruby and LLM Ecosystem 2nd
koic
1
1.3k
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
4.2k
Nuxt Server Components
wattanx
0
130
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
170
おれのAgentic Coding 2026/03
tsukasagr
1
100
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
550
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
170
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
54k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
220
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
250
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
76
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
490
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
110
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
The SEO identity crisis: Don't let AI make you average
varn
0
420
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