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
86
Comunicarse en tiempos de remoto
ydarias
0
340
No Code vs Code
ydarias
0
37
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
81
Other Decks in Programming
See All in Programming
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
580
connect-python: convenient protobuf RPC for Python
anuraaga
0
300
OSS開発者の憂鬱
yusukebe
14
11k
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
500
Flutterアプリ運用の現場で役立った監視Tips 5選
ostk0069
1
530
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
14
14k
関数の挙動書き換える
takatofukui
4
750
「文字列→日付」の落とし穴 〜Ruby Date.parseの意外な挙動〜
sg4k0
0
310
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 1
philipschwarz
PRO
0
110
Agentに至る道 〜なぜLLMは自動でコードを書けるようになったのか〜
mackee
5
2.3k
Level up your Gemini CLI - D&D Style!
palladius
1
130
海外登壇の心構え - コワクナイヨ - / how to prepare for a presentation abroad
kishida
2
100
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Bash Introduction
62gerente
615
210k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
The Language of Interfaces
destraynor
162
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
It's Worth the Effort
3n
187
29k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
680
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