SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
OpenBlend Ljubljana
September 15th, 2011




   Introduction to Byteman
   and
   The Jokre

                                   Sanne Grinovero
                       Software Engineer at Red Hat
                                               1
Byteman
• It's a scriptable java agent
• Lets you change behavior at runtime
  – Without changing any sources
  – Simulating unexpected behaviour
  – Setting up specific scenarios
How are you going to test for...
• How is your flush operation going to
  behave when the disk crashes ?
• Is your code good enough to not corrupt
  in-flight processed data when an OOM
  excepion happens?
• What if the TCP connection is terminated
  during that?
Byteman can crash your disk
Byteman can cut your LAN cable
Byteman can generate an OutOfMemory
    exception right where you want it
Or it can do simple things too
Code deep dive: disk full



Proper error handling for IO exceptions are
tested by:
org.hibernate.search.test.errorhandling.Co
ncurrentMergeErrorHandledTest
Event-driven scripts

• You can avoid mocks, conditional
  builds, and have the code change when
  chosen conditions trigger.
  – Cleaner code
• Can attach dynamically after the
  running code was written
  – Used for “debug” and hot-patching of
    running production applications
Byte(code) man(ipulation)

Available right now in a JVM near you
– transform code/class structure at load
– retransform code only after load
– java.lang.instrument
Byte(code) man(ipulation)
• Byteman makes it easy
  – inject Java code direct into Java code
• Byteman makes it cheap
  – low transformation cost
  – tightly scoped changes
• Byteman produces reversible changes
  – no structural changes
Byteman built-in methods
Tracing
• traceOpen, traceClose, traceln,
  traceStack, ...
Managing Shared Rule State
• flag, clear, countDown, incrementCounter,
Timing
• createTimer, getElapsedTime, resetTimer,
Helper Classes

Built-ins are POJO public methods
• take a look
  org.jboss.byteman.rule.Helper
• You can use any POJO you like
class DBHelper {
public void trace(String msg,
Record rec);
Timing issues

• org.hibernate.search.test.query.timeout.
  JPATimeoutTest
  – Verifies a timeout is thrown if the query is
    too slow
How to enable it

• As an explicit agent
    -javaagent:/path/to/agent.jar=agentoptions
 Auto-loading the agent
  – As with the BMunit examples
  – Works with JUnit and TestNG
  – Requires the JDK's /lib/tools.jar on
    classpath
• See website and our projects for details
The Jokre

• https://github.com/infinispan/jokre
• A proof of concept of an advanced
  optimization technique
• Requires some knowledge of Infinispan
Infinispan API:
    mandates a return value

map.put( “user-34”, userInstance );

V put(K key, V value);
A return value forces an RPC

Assuming a DIST_ASYNC Infinispan cache:
map.put( “k-1”, userInstance );

1) ask the node storing “k-1” what the
current value is
2) return that.. to nobody
3) eventually perform the put
asynchronously
A return value forces an RPC

• So even async caches often perform as
  sync caches, unless flags are used:
cache.withFlags(
    Flag.SKIP_REMOTE_LOOKUP,
    Flag.SKIP_CACHE_LOAD
    ).put( “k-1”, “hi!” );
A return value forces an RPC

• So even async caches often perform as
  sync caches, unless flags are used:
cache.withFlags(
    Flag.SKIP_REMOTE_LOOKUP,
    Flag.SKIP_CACHE_LOAD
    ).put( “k-1”, “hi!” );
           Hey, that's not the Map API anymore!
Tradeoff: use proprietary or
        standard API?
• We all prefer well known APIs
  – JPA/Hibernate ?
  – Interface and standardization often lags
    behind: there is a performance hit you pay.
• It seems in some cases you can have
  both: let's see some magic in action
Jokr demo
2011-09-15 10:43:15,794 WARN [Skynet]
 (main) JKR-00012 Problem XYZ detected
within your code. No worries, we just fixed
                it for you.
Just use Map, we fix it

• This is a new concept: an “illegal”
  optimization is performed.
• It's a proof of concept
  – feel free to suggest more use cases.
Questions?
Project Page
 http://www.jboss.org/byteman
– downloads
– documentation
– user & developer forums
– code repository

https://github.com/bytemanproject
https://github.com/infinispan

Contenu connexe

Tendances

Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan Edstrom
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoringSimon Ritter
 
Advanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectAdvanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectSencha
 
Lets build-ruby-app-server: Vineet tyagi
Lets build-ruby-app-server: Vineet tyagiLets build-ruby-app-server: Vineet tyagi
Lets build-ruby-app-server: Vineet tyagiThoughtWorks
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro MerbPaul Pajo
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivationjistr
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of RubySATOSHI TAGOMORI
 
Event Driven Architecture with Apache Camel
Event Driven Architecture with Apache CamelEvent Driven Architecture with Apache Camel
Event Driven Architecture with Apache Camelprajods
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
 
Introduction to ACI APIs
Introduction to ACI APIsIntroduction to ACI APIs
Introduction to ACI APIsCisco DevNet
 
Parsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby TemplatesParsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby TemplatesJohn Hawthorn
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipseMike Slinn
 
What is Serialization in Java? | Java Tutorial | Edureka
What is Serialization in Java? | Java Tutorial | EdurekaWhat is Serialization in Java? | Java Tutorial | Edureka
What is Serialization in Java? | Java Tutorial | EdurekaEdureka!
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprisesMike Slinn
 
Composable Futures with Akka 2.0
Composable Futures with Akka 2.0Composable Futures with Akka 2.0
Composable Futures with Akka 2.0Mike Slinn
 
Testing Alfresco extensions
Testing Alfresco extensionsTesting Alfresco extensions
Testing Alfresco extensionsITD Systems
 

Tendances (20)

Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Advanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectAdvanced Server Integration with Data and Direct
Advanced Server Integration with Data and Direct
 
Lets build-ruby-app-server: Vineet tyagi
Lets build-ruby-app-server: Vineet tyagiLets build-ruby-app-server: Vineet tyagi
Lets build-ruby-app-server: Vineet tyagi
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro Merb
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of Ruby
 
Maccro Strikes Back
Maccro Strikes BackMaccro Strikes Back
Maccro Strikes Back
 
Event Driven Architecture with Apache Camel
Event Driven Architecture with Apache CamelEvent Driven Architecture with Apache Camel
Event Driven Architecture with Apache Camel
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Introduction to ACI APIs
Introduction to ACI APIsIntroduction to ACI APIs
Introduction to ACI APIs
 
Perl-Critic
Perl-CriticPerl-Critic
Perl-Critic
 
Parsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby TemplatesParsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby Templates
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 
What is Serialization in Java? | Java Tutorial | Edureka
What is Serialization in Java? | Java Tutorial | EdurekaWhat is Serialization in Java? | Java Tutorial | Edureka
What is Serialization in Java? | Java Tutorial | Edureka
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
 
Composable Futures with Akka 2.0
Composable Futures with Akka 2.0Composable Futures with Akka 2.0
Composable Futures with Akka 2.0
 
Testing Alfresco extensions
Testing Alfresco extensionsTesting Alfresco extensions
Testing Alfresco extensions
 

En vedette

Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)OpenBlend society
 
Scan 01 Dec 2015 17.38
Scan 01 Dec 2015 17.38Scan 01 Dec 2015 17.38
Scan 01 Dec 2015 17.38Łukasz Ozimek
 
Integracja Red Hat JBoss Fuse w przetwarzaniu płatności
Integracja Red Hat JBoss Fuse w przetwarzaniu płatnościIntegracja Red Hat JBoss Fuse w przetwarzaniu płatności
Integracja Red Hat JBoss Fuse w przetwarzaniu płatnościMichal Balinski
 
Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...OpenBlend society
 
How to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfHow to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfOpenBlend society
 
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikTackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikOpenBlend society
 
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)OpenBlend society
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...OpenBlend society
 
National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)OpenBlend society
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)OpenBlend society
 
Head neck ppt
Head neck pptHead neck ppt
Head neck pptnnrao40
 

En vedette (12)

Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
 
Scan 01 Dec 2015 17.38
Scan 01 Dec 2015 17.38Scan 01 Dec 2015 17.38
Scan 01 Dec 2015 17.38
 
Integracja Red Hat JBoss Fuse w przetwarzaniu płatności
Integracja Red Hat JBoss Fuse w przetwarzaniu płatnościIntegracja Red Hat JBoss Fuse w przetwarzaniu płatności
Integracja Red Hat JBoss Fuse w przetwarzaniu płatności
 
Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...
 
Migracao gae-openshift
Migracao gae-openshiftMigracao gae-openshift
Migracao gae-openshift
 
How to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfHow to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de Wolf
 
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikTackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
 
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
 
National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
 
Head neck ppt
Head neck pptHead neck ppt
Head neck ppt
 

Similaire à Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)

Determinism in finance
Determinism in financeDeterminism in finance
Determinism in financePeter Lawrey
 
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-finalMarcus Lagergren
 
Jython in workflow and rules engines
Jython in workflow and rules enginesJython in workflow and rules engines
Jython in workflow and rules enginesVaclav Tunka
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksKernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksAnne Nicolas
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performancepradeepfn
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updatesVinay H G
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and PerformanceWSO2
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGTomek Borek
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceESUG
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangLyon Yang
 
Exploitation and State Machines
Exploitation and State MachinesExploitation and State Machines
Exploitation and State MachinesMichael Scovetta
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the Worldjhugg
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone CivettaCocoaHeads France
 
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Flink Forward
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.jsNitin Gupta
 
New Java features: Simplified Design Patterns[LIT3826]
New Java features: Simplified Design Patterns[LIT3826]New Java features: Simplified Design Patterns[LIT3826]
New Java features: Simplified Design Patterns[LIT3826]Miro Wengner
 

Similaire à Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat) (20)

Determinism in finance
Determinism in financeDeterminism in finance
Determinism in finance
 
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-final
 
Jython in workflow and rules engines
Jython in workflow and rules enginesJython in workflow and rules engines
Jython in workflow and rules engines
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksKernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUG
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Exploitation and State Machines
Exploitation and State MachinesExploitation and State Machines
Exploitation and State Machines
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone Civetta
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
 
New Java features: Simplified Design Patterns[LIT3826]
New Java features: Simplified Design Patterns[LIT3826]New Java features: Simplified Design Patterns[LIT3826]
New Java features: Simplified Design Patterns[LIT3826]
 

Dernier

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 

Dernier (20)

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)

  • 1. OpenBlend Ljubljana September 15th, 2011 Introduction to Byteman and The Jokre Sanne Grinovero Software Engineer at Red Hat 1
  • 2. Byteman • It's a scriptable java agent • Lets you change behavior at runtime – Without changing any sources – Simulating unexpected behaviour – Setting up specific scenarios
  • 3. How are you going to test for... • How is your flush operation going to behave when the disk crashes ? • Is your code good enough to not corrupt in-flight processed data when an OOM excepion happens? • What if the TCP connection is terminated during that?
  • 4. Byteman can crash your disk
  • 5. Byteman can cut your LAN cable
  • 6. Byteman can generate an OutOfMemory exception right where you want it
  • 7. Or it can do simple things too
  • 8. Code deep dive: disk full Proper error handling for IO exceptions are tested by: org.hibernate.search.test.errorhandling.Co ncurrentMergeErrorHandledTest
  • 9. Event-driven scripts • You can avoid mocks, conditional builds, and have the code change when chosen conditions trigger. – Cleaner code • Can attach dynamically after the running code was written – Used for “debug” and hot-patching of running production applications
  • 10. Byte(code) man(ipulation) Available right now in a JVM near you – transform code/class structure at load – retransform code only after load – java.lang.instrument
  • 11. Byte(code) man(ipulation) • Byteman makes it easy – inject Java code direct into Java code • Byteman makes it cheap – low transformation cost – tightly scoped changes • Byteman produces reversible changes – no structural changes
  • 12. Byteman built-in methods Tracing • traceOpen, traceClose, traceln, traceStack, ... Managing Shared Rule State • flag, clear, countDown, incrementCounter, Timing • createTimer, getElapsedTime, resetTimer,
  • 13. Helper Classes Built-ins are POJO public methods • take a look org.jboss.byteman.rule.Helper • You can use any POJO you like class DBHelper { public void trace(String msg, Record rec);
  • 14. Timing issues • org.hibernate.search.test.query.timeout. JPATimeoutTest – Verifies a timeout is thrown if the query is too slow
  • 15. How to enable it • As an explicit agent -javaagent:/path/to/agent.jar=agentoptions Auto-loading the agent – As with the BMunit examples – Works with JUnit and TestNG – Requires the JDK's /lib/tools.jar on classpath • See website and our projects for details
  • 16. The Jokre • https://github.com/infinispan/jokre • A proof of concept of an advanced optimization technique • Requires some knowledge of Infinispan
  • 17. Infinispan API: mandates a return value map.put( “user-34”, userInstance ); V put(K key, V value);
  • 18. A return value forces an RPC Assuming a DIST_ASYNC Infinispan cache: map.put( “k-1”, userInstance ); 1) ask the node storing “k-1” what the current value is 2) return that.. to nobody 3) eventually perform the put asynchronously
  • 19. A return value forces an RPC • So even async caches often perform as sync caches, unless flags are used: cache.withFlags( Flag.SKIP_REMOTE_LOOKUP, Flag.SKIP_CACHE_LOAD ).put( “k-1”, “hi!” );
  • 20. A return value forces an RPC • So even async caches often perform as sync caches, unless flags are used: cache.withFlags( Flag.SKIP_REMOTE_LOOKUP, Flag.SKIP_CACHE_LOAD ).put( “k-1”, “hi!” ); Hey, that's not the Map API anymore!
  • 21. Tradeoff: use proprietary or standard API? • We all prefer well known APIs – JPA/Hibernate ? – Interface and standardization often lags behind: there is a performance hit you pay. • It seems in some cases you can have both: let's see some magic in action
  • 23. 2011-09-15 10:43:15,794 WARN [Skynet] (main) JKR-00012 Problem XYZ detected within your code. No worries, we just fixed it for you.
  • 24. Just use Map, we fix it • This is a new concept: an “illegal” optimization is performed. • It's a proof of concept – feel free to suggest more use cases.
  • 25. Questions? Project Page http://www.jboss.org/byteman – downloads – documentation – user & developer forums – code repository https://github.com/bytemanproject https://github.com/infinispan