SlideShare a Scribd company logo
1 of 33
Download to read offline
Monitoring and
                          Feature Toggle Pattern
                                with JMX

                                 Bruno Bonfils
                                Cyrille Le Clerc   15/06/2011




Thursday, June 16, 2011
Speaker



                          @cyrilleleclerc
                          blog.xebia.fr


                               Cyrille Le Clerc
                                                                 Large Scale


                                                       In Memory Data Grid
       Open Source
       (Apache CXF, ...)

                                            “you build it, you run it”

                                                                               2
Thursday, June 16, 2011
The use case




                                         3
Thursday, June 16, 2011
The Use Case

                                         Corporate Data Center




                          travel-ecommerce
                                                                 anti-fraud
                              Tomcat
                                                                  Tomcat


                          travel-ecommerce                       anti-fraud
                              Tomcat                              Tomcat



                                                                 Credit Card Service




                          Travel e-commerce application

                                                                                       4
Thursday, June 16, 2011
The Use Case

 xebia-spring-travel source code
      ▶   http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/

      ▶ Groovy            JMX scripts
            » http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel-
              ecommerce/src/main/scripts/

      ▶ JMXTrans             Configuration
            » http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel-
              ecommerce/src/main/jmxtrans/

      ▶ JMeter            plan
            » http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel-
              ecommerce/src/main/jmeter/


 xebia-management-extras JMX library
      ▶   http://code.google.com/p/xebia-france/wiki/XebiaManagementExtras




                                                                                                                                        5
Thursday, June 16, 2011
Part 1
                          Monitoring with JMX




                                                6
Thursday, June 16, 2011
Simplified Use Case




                                                7
Thursday, June 16, 2011
Simplified Use Case


                                    Corporate Data Center




                                 travel-ecommerce
                                      Tomcat


                                                              Credit Card Service
                                                                   Mock




                          Monitoring Booking and Credit Card Service

                                                                                    8
Thursday, June 16, 2011
Simplified Use Case


                                    Corporate Data Center




                                 travel-ecommerce
                                      Tomcat


                                                              Credit Card Service
                                                                   Mock




                          Monitoring Booking and Credit Card Service

                                                                                    9
Thursday, June 16, 2011
Custom/business indicator monitoring
                                      with JMX




                                                                 10
Thursday, June 16, 2011
Custom Indicator Monitoring with JMX



                                                 CreditCardService

                                                    #purchase()



                     CreditCardService MonitoringImpl                CreditCardServiceImpl

                               #purchase()                               #purchase()




             monitoring logic isolated with a delegate pattern



                                                                                             11
Thursday, June 16, 2011
Custom Indicator Monitoring with JMX
@ManagedResource
public class CreditCardServiceMonitoringImpl implements CreditCardService {

  // delegate
  private CreditCardService creditCardService;
  // counters
  private final AtomicInteger purchaseInvocationCounter = new AtomicInteger();
  private final AtomicLong purchaseInvocationDurationInNanosCounter = new AtomicLong();
  private final AtomicInteger threeDSecureVerificationExceptionCounter = new AtomicInteger();

  @Override
  public PaymentTransaction purchase(MonetaryAmount total, Order order, String requestId) {
    long nanosBefore = System.nanoTime();

      try {

         return creditCardService.purchase(total, order, requestId);

      } catch (ThreeDSecureVerificationException e) {
        threeDSecureVerificationExceptionCounter.incrementAndGet();
        throw e;
      } finally {
        purchaseInvocationCounter.incrementAndGet();
        purchaseInvocationDurationInNanosCounter.addAndGet(System.nanoTime() - nanosBefore);
      }
  }
                  http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel-ecommerce/src/main/java/fr/
                  xebia/monitoring/demo/payment/CreditCardServiceMonitoringImpl.java


                                                                                                                                                                                    12
Thursday, June 16, 2011
Accessing JMX is not so difficult




                                                              13
Thursday, June 16, 2011
JMX Monitoring with Visual VM




                                14
Thursday, June 16, 2011
JMX Monitoring with JSP Pages

                          Powered by JMX !




 Human friendly or script friendly pages

 Beware of security
      ▶ BasicAuth
      ▶ Obfuscated URL : /my-app/seye5E7E/jmx/cxf.jsp

                                                        15
Thursday, June 16, 2011
Graphite - JMXTrans Style Reporting Tools




 {
     "servers" : [ {
       "port" : "6969",
       "host" : "my-server-1",
       "alias" : "travel-ecommerce-1",
       "queries" : [
       {
           "outputWriters" : [ {
                 "@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
                 "settings" : { "port" : 2003, "host" : "graphite-server" }

       	
               }],
       "obj": "travel-ecommerce:name=CreditCardServiceMonitoringImpl,...",
                                                                                                                                             Graphite
       	
       "resultAlias" : "CreditCardService",
       	
       "attr":["PurchaseInvocationCount", "ThreeDSecureVerificationExceptionCount", ...]
       }
       ],
       "numQueryThreads" : 2

                   JMX Trans Configuration
     } ]
 }


                          http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel-
                          ecommerce/src/main/jmxtrans/xebia-spring-travel-ecommerce-jmxtrans.json                                                                16
Thursday, June 16, 2011
Monotoring systems




                              AppDynamics




                    Hyperic
                              All others ...
                                               17
Thursday, June 16, 2011
JVM Based Scripting Language




                          http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring-
                          travel-1.0.0/xebia-spring-travel-ecommerce/src/main/scripts/getAntiFraudVerificationStatus.groovy
                                                                                                                                18
Thursday, June 16, 2011
Part 2
                          Feature Toggle Pattern with JMX




                                                            19
Thursday, June 16, 2011
Simplified Use Case




                                                20
Thursday, June 16, 2011
Simplified Use Case




                                         Corporate Data Center




                          travel-ecommerce
                                                                 anti-fraud
                              Tomcat
                                                                  Tomcat


                                                                 Credit Card Service




                          Enable anti-fraud



                                                                                       21
Thursday, June 16, 2011
What ? Why ?




                                         22
Thursday, June 16, 2011
What is it ?


 Technique to enable/disable a feature without
    redeploying

 Can be simple : on/off

 Can be sophisticated : f(user), f(server), etc




                                                   23
Thursday, June 16, 2011
Benefits of the Feature Toggle Pattern

 Dissociate deployment & feature activation

 Progressive activation of a feature
                     Canary Testing

 Measure impacts of a new version
               A/B Testing

 Differ feature activation on production

 Trunk based development

                                               24
Thursday, June 16, 2011
Coding Patterns




                                            25
Thursday, June 16, 2011
Coding Patterns
Dispatcher

                                                       AntiFraudService
                                                         <<Interface>>




                                                                           AntiFraudServiceV1Impl
                               AntiFraudService
                                DispatchingImpl
                                                                           AntiFraudServiceV2Impl




           JMX
            transient                persistent



                   The dispatcher holds the feature toggle
                          http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring-
                          travel-1.0.0/xebia-spring-travel-ecommerce/src/main/java/fr/xebia/ws/travel/antifraud/v1_0/
                          AntiFraudServiceDispatchingImpl.java                                                                  26
Thursday, June 16, 2011
Coding Patterns
To duplicate or not to duplicate ?



                      Dispatching




                               Smart reuse and mutualization


                          Dispatching




                                        Brutal duplication
              Version 1

              Version 2



                                                               27
Thursday, June 16, 2011
Coding Patterns
To duplicate or not to duplicate ?



                   Dispatching




                               Smart reuse and mutualization


                          Dispatching




                                        Brutal duplication
              Version 1

              Version 2



                                                               28
Thursday, June 16, 2011
Coding Patterns
To duplicate or not to duplicate ?



                   Dispatching




                               Smart reuse and mutualization


                          Dispatching




                                        Brutal duplication
              Version 1

              Version 2



                                                               29
Thursday, June 16, 2011
Coding Patterns
To duplicate or not to duplicate ?

                          Old version removal requires cleanup


                          Smart reuse and mutualization



                             Old version removal is clean

                             Brutal duplication
              Version 1

              Version 2



                                                                 30
Thursday, June 16, 2011
Coding Patterns
To duplicate or not to duplicate ?




       Old code removal is simpler with brutal duplication




                                                             31
Thursday, June 16, 2011
Demo




                                 32
Thursday, June 16, 2011
Questions / Answers




                          ?

                              33
Thursday, June 16, 2011

More Related Content

Viewers also liked

DevOps/Flow workshop for agile india 2015
DevOps/Flow workshop for agile india 2015DevOps/Flow workshop for agile india 2015
DevOps/Flow workshop for agile india 2015
Yuval Yeret
 

Viewers also liked (15)

Practical Monitoring Techniques
Practical Monitoring TechniquesPractical Monitoring Techniques
Practical Monitoring Techniques
 
Which watcher watches CloudWatch
Which watcher watches CloudWatch Which watcher watches CloudWatch
Which watcher watches CloudWatch
 
Measured availability - Sanjay Singh - DevOps Bangalore meetup March 28th 2015
Measured availability - Sanjay Singh - DevOps Bangalore meetup March 28th 2015Measured availability - Sanjay Singh - DevOps Bangalore meetup March 28th 2015
Measured availability - Sanjay Singh - DevOps Bangalore meetup March 28th 2015
 
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
 
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamicsMonitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
 
DevOps/Flow workshop for agile india 2015
DevOps/Flow workshop for agile india 2015DevOps/Flow workshop for agile india 2015
DevOps/Flow workshop for agile india 2015
 
Devoxx 2014 monitoring
Devoxx 2014 monitoringDevoxx 2014 monitoring
Devoxx 2014 monitoring
 
DevOps - Retour d'expérience - MarsJug du 29 Juin 2011
DevOps - Retour d'expérience - MarsJug du 29 Juin 2011DevOps - Retour d'expérience - MarsJug du 29 Juin 2011
DevOps - Retour d'expérience - MarsJug du 29 Juin 2011
 
Run IT Support the DevOps Way
Run IT Support the DevOps WayRun IT Support the DevOps Way
Run IT Support the DevOps Way
 
Jolokia - JMX on Capsaicin (Devoxx 2011)
Jolokia - JMX on Capsaicin (Devoxx 2011)Jolokia - JMX on Capsaicin (Devoxx 2011)
Jolokia - JMX on Capsaicin (Devoxx 2011)
 
Jelastic - DevOps PaaS Business with Docker Support for Service Providers
Jelastic - DevOps PaaS Business with Docker Support for Service ProvidersJelastic - DevOps PaaS Business with Docker Support for Service Providers
Jelastic - DevOps PaaS Business with Docker Support for Service Providers
 
Public Opinion Landscape: Economy 5.25.16
Public Opinion Landscape: Economy 5.25.16Public Opinion Landscape: Economy 5.25.16
Public Opinion Landscape: Economy 5.25.16
 
戴紅玫瑰的醜女人
戴紅玫瑰的醜女人戴紅玫瑰的醜女人
戴紅玫瑰的醜女人
 
Evaluation q2
Evaluation q2Evaluation q2
Evaluation q2
 
Resources
ResourcesResources
Resources
 

Similar to Paris Devops - Monitoring And Feature Toggle Pattern With JMX

Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011
Zi Bin Cheah
 
Applying BDD/TDD practices, using Jasmine.js
Applying BDD/TDD practices, using Jasmine.jsApplying BDD/TDD practices, using Jasmine.js
Applying BDD/TDD practices, using Jasmine.js
Anil Tarte
 
Curriculum Vitae Fabio Vitaterna - ENG
Curriculum Vitae Fabio Vitaterna - ENGCurriculum Vitae Fabio Vitaterna - ENG
Curriculum Vitae Fabio Vitaterna - ENG
Fabio Vitaterna
 
Html5 performance
Html5 performanceHtml5 performance
Html5 performance
fanqstefan
 
Wipolo fb startupday paris 16th june
Wipolo fb startupday paris 16th juneWipolo fb startupday paris 16th june
Wipolo fb startupday paris 16th june
Matthieu Heslouin
 

Similar to Paris Devops - Monitoring And Feature Toggle Pattern With JMX (20)

Good Data: Collaborative Analytics On Demand
Good Data: Collaborative Analytics On DemandGood Data: Collaborative Analytics On Demand
Good Data: Collaborative Analytics On Demand
 
Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011
 
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für TabletsiEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
 
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für TabletsiEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
 
WCXM marketplace 2012
WCXM marketplace 2012WCXM marketplace 2012
WCXM marketplace 2012
 
Measuring web performance. Velocity EU 2011
Measuring web performance. Velocity EU 2011Measuring web performance. Velocity EU 2011
Measuring web performance. Velocity EU 2011
 
Smart Parking Solution using Camera Networks and Real-time Computer Vision
Smart Parking Solution using Camera Networks and Real-time Computer VisionSmart Parking Solution using Camera Networks and Real-time Computer Vision
Smart Parking Solution using Camera Networks and Real-time Computer Vision
 
My Name is E & Open Standards
My Name is E & Open StandardsMy Name is E & Open Standards
My Name is E & Open Standards
 
APPLICATION OF VARIOUS DEEP LEARNING MODELS FOR AUTOMATIC TRAFFIC VIOLATION D...
APPLICATION OF VARIOUS DEEP LEARNING MODELS FOR AUTOMATIC TRAFFIC VIOLATION D...APPLICATION OF VARIOUS DEEP LEARNING MODELS FOR AUTOMATIC TRAFFIC VIOLATION D...
APPLICATION OF VARIOUS DEEP LEARNING MODELS FOR AUTOMATIC TRAFFIC VIOLATION D...
 
STKI Mobile brainstorming -MDM Panel
STKI Mobile brainstorming -MDM PanelSTKI Mobile brainstorming -MDM Panel
STKI Mobile brainstorming -MDM Panel
 
Applying BDD/TDD practices, using Jasmine.js
Applying BDD/TDD practices, using Jasmine.jsApplying BDD/TDD practices, using Jasmine.js
Applying BDD/TDD practices, using Jasmine.js
 
Keeping Your Digital Office Clean Wim Putzeys Panoptic
Keeping Your Digital Office Clean Wim Putzeys PanopticKeeping Your Digital Office Clean Wim Putzeys Panoptic
Keeping Your Digital Office Clean Wim Putzeys Panoptic
 
MT5で実現するマルチデバイス、クロスプラットフォーム
MT5で実現するマルチデバイス、クロスプラットフォームMT5で実現するマルチデバイス、クロスプラットフォーム
MT5で実現するマルチデバイス、クロスプラットフォーム
 
ROLE Vision RWTH Aachen
ROLE Vision RWTH AachenROLE Vision RWTH Aachen
ROLE Vision RWTH Aachen
 
Smart Traffic System using Machine Learning
Smart Traffic System using Machine LearningSmart Traffic System using Machine Learning
Smart Traffic System using Machine Learning
 
Curriculum Vitae Fabio Vitaterna - ENG
Curriculum Vitae Fabio Vitaterna - ENGCurriculum Vitae Fabio Vitaterna - ENG
Curriculum Vitae Fabio Vitaterna - ENG
 
What is going on - Application diagnostics on Azure - TechDays Finland
What is going on - Application diagnostics on Azure - TechDays FinlandWhat is going on - Application diagnostics on Azure - TechDays Finland
What is going on - Application diagnostics on Azure - TechDays Finland
 
Html5 performance
Html5 performanceHtml5 performance
Html5 performance
 
Wipolo fb startupday paris 16th june
Wipolo fb startupday paris 16th juneWipolo fb startupday paris 16th june
Wipolo fb startupday paris 16th june
 
Mobile game changer 2011
Mobile game changer 2011Mobile game changer 2011
Mobile game changer 2011
 

More from Cyrille Le Clerc

Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)
Cyrille Le Clerc
 
Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)
Cyrille Le Clerc
 

More from Cyrille Le Clerc (10)

Embracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetryEmbracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetry
 
Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013
 
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
 
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
 
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspectiveGeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
 
Java Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' FounderJava Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' Founder
 
Bonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la productionBonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la production
 
Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)
 
Xebia Knowledge Exchange - Owasp Top Ten
Xebia Knowledge Exchange - Owasp Top TenXebia Knowledge Exchange - Owasp Top Ten
Xebia Knowledge Exchange - Owasp Top Ten
 
Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Paris Devops - Monitoring And Feature Toggle Pattern With JMX

  • 1. Monitoring and Feature Toggle Pattern with JMX Bruno Bonfils Cyrille Le Clerc 15/06/2011 Thursday, June 16, 2011
  • 2. Speaker @cyrilleleclerc blog.xebia.fr Cyrille Le Clerc Large Scale In Memory Data Grid Open Source (Apache CXF, ...) “you build it, you run it” 2 Thursday, June 16, 2011
  • 3. The use case 3 Thursday, June 16, 2011
  • 4. The Use Case Corporate Data Center travel-ecommerce anti-fraud Tomcat Tomcat travel-ecommerce anti-fraud Tomcat Tomcat Credit Card Service Travel e-commerce application 4 Thursday, June 16, 2011
  • 5. The Use Case  xebia-spring-travel source code ▶ http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/ ▶ Groovy JMX scripts » http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel- ecommerce/src/main/scripts/ ▶ JMXTrans Configuration » http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel- ecommerce/src/main/jmxtrans/ ▶ JMeter plan » http://xebia-france.googlecode.com/svn/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel- ecommerce/src/main/jmeter/  xebia-management-extras JMX library ▶ http://code.google.com/p/xebia-france/wiki/XebiaManagementExtras 5 Thursday, June 16, 2011
  • 6. Part 1 Monitoring with JMX 6 Thursday, June 16, 2011
  • 7. Simplified Use Case 7 Thursday, June 16, 2011
  • 8. Simplified Use Case Corporate Data Center travel-ecommerce Tomcat Credit Card Service Mock Monitoring Booking and Credit Card Service 8 Thursday, June 16, 2011
  • 9. Simplified Use Case Corporate Data Center travel-ecommerce Tomcat Credit Card Service Mock Monitoring Booking and Credit Card Service 9 Thursday, June 16, 2011
  • 10. Custom/business indicator monitoring with JMX 10 Thursday, June 16, 2011
  • 11. Custom Indicator Monitoring with JMX CreditCardService #purchase() CreditCardService MonitoringImpl CreditCardServiceImpl #purchase() #purchase() monitoring logic isolated with a delegate pattern 11 Thursday, June 16, 2011
  • 12. Custom Indicator Monitoring with JMX @ManagedResource public class CreditCardServiceMonitoringImpl implements CreditCardService { // delegate private CreditCardService creditCardService; // counters private final AtomicInteger purchaseInvocationCounter = new AtomicInteger(); private final AtomicLong purchaseInvocationDurationInNanosCounter = new AtomicLong(); private final AtomicInteger threeDSecureVerificationExceptionCounter = new AtomicInteger(); @Override public PaymentTransaction purchase(MonetaryAmount total, Order order, String requestId) { long nanosBefore = System.nanoTime(); try { return creditCardService.purchase(total, order, requestId); } catch (ThreeDSecureVerificationException e) { threeDSecureVerificationExceptionCounter.incrementAndGet(); throw e; } finally { purchaseInvocationCounter.incrementAndGet(); purchaseInvocationDurationInNanosCounter.addAndGet(System.nanoTime() - nanosBefore); } } http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel-ecommerce/src/main/java/fr/ xebia/monitoring/demo/payment/CreditCardServiceMonitoringImpl.java 12 Thursday, June 16, 2011
  • 13. Accessing JMX is not so difficult 13 Thursday, June 16, 2011
  • 14. JMX Monitoring with Visual VM 14 Thursday, June 16, 2011
  • 15. JMX Monitoring with JSP Pages Powered by JMX !  Human friendly or script friendly pages  Beware of security ▶ BasicAuth ▶ Obfuscated URL : /my-app/seye5E7E/jmx/cxf.jsp 15 Thursday, June 16, 2011
  • 16. Graphite - JMXTrans Style Reporting Tools { "servers" : [ { "port" : "6969", "host" : "my-server-1", "alias" : "travel-ecommerce-1", "queries" : [ { "outputWriters" : [ { "@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter", "settings" : { "port" : 2003, "host" : "graphite-server" } }], "obj": "travel-ecommerce:name=CreditCardServiceMonitoringImpl,...", Graphite "resultAlias" : "CreditCardService", "attr":["PurchaseInvocationCount", "ThreeDSecureVerificationExceptionCount", ...] } ], "numQueryThreads" : 2 JMX Trans Configuration } ] } http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring-travel-1.0.0/xebia-spring-travel- ecommerce/src/main/jmxtrans/xebia-spring-travel-ecommerce-jmxtrans.json 16 Thursday, June 16, 2011
  • 17. Monotoring systems AppDynamics Hyperic All others ... 17 Thursday, June 16, 2011
  • 18. JVM Based Scripting Language http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring- travel-1.0.0/xebia-spring-travel-ecommerce/src/main/scripts/getAntiFraudVerificationStatus.groovy 18 Thursday, June 16, 2011
  • 19. Part 2 Feature Toggle Pattern with JMX 19 Thursday, June 16, 2011
  • 20. Simplified Use Case 20 Thursday, June 16, 2011
  • 21. Simplified Use Case Corporate Data Center travel-ecommerce anti-fraud Tomcat Tomcat Credit Card Service Enable anti-fraud 21 Thursday, June 16, 2011
  • 22. What ? Why ? 22 Thursday, June 16, 2011
  • 23. What is it ?  Technique to enable/disable a feature without redeploying  Can be simple : on/off  Can be sophisticated : f(user), f(server), etc 23 Thursday, June 16, 2011
  • 24. Benefits of the Feature Toggle Pattern  Dissociate deployment & feature activation  Progressive activation of a feature Canary Testing  Measure impacts of a new version A/B Testing  Differ feature activation on production  Trunk based development 24 Thursday, June 16, 2011
  • 25. Coding Patterns 25 Thursday, June 16, 2011
  • 26. Coding Patterns Dispatcher AntiFraudService <<Interface>> AntiFraudServiceV1Impl AntiFraudService DispatchingImpl AntiFraudServiceV2Impl JMX transient persistent The dispatcher holds the feature toggle http://code.google.com/p/xebia-france/source/browse/training/xebia-spring-travel/tags/xebia-spring- travel-1.0.0/xebia-spring-travel-ecommerce/src/main/java/fr/xebia/ws/travel/antifraud/v1_0/ AntiFraudServiceDispatchingImpl.java 26 Thursday, June 16, 2011
  • 27. Coding Patterns To duplicate or not to duplicate ? Dispatching Smart reuse and mutualization Dispatching Brutal duplication Version 1 Version 2 27 Thursday, June 16, 2011
  • 28. Coding Patterns To duplicate or not to duplicate ? Dispatching Smart reuse and mutualization Dispatching Brutal duplication Version 1 Version 2 28 Thursday, June 16, 2011
  • 29. Coding Patterns To duplicate or not to duplicate ? Dispatching Smart reuse and mutualization Dispatching Brutal duplication Version 1 Version 2 29 Thursday, June 16, 2011
  • 30. Coding Patterns To duplicate or not to duplicate ? Old version removal requires cleanup Smart reuse and mutualization Old version removal is clean Brutal duplication Version 1 Version 2 30 Thursday, June 16, 2011
  • 31. Coding Patterns To duplicate or not to duplicate ? Old code removal is simpler with brutal duplication 31 Thursday, June 16, 2011
  • 32. Demo 32 Thursday, June 16, 2011
  • 33. Questions / Answers ? 33 Thursday, June 16, 2011