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
70
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
310
BetaBeers Salamanca
ydarias
1
170
Runnics at ProductHunt Madrid
ydarias
0
200
Otogami at Tetuan Valley
ydarias
0
77
Other Decks in Programming
See All in Programming
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
310
Realtime API 入門
riofujimon
0
150
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
1
640
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
5
1.7k
CSC509 Lecture 09
javiergs
PRO
0
140
現場で役立つモデリング 超入門
masuda220
PRO
15
3.1k
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
510
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
320
ヤプリ新卒SREの オンボーディング
masaki12
0
120
Java ジェネリクス入門 2024
nagise
0
710
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
510
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
290
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.8k
Making Projects Easy
brettharned
115
5.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Unsuck your backbone
ammeep
668
57k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
A designer walks into a library…
pauljervisheath
202
24k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Docker and Python
trallard
40
3.1k
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