Paris Devops - Monitoring And Feature Toggle Pattern With JMX

Cyrille Le Clerc
Cyrille Le ClercProduct Manager at Elastic
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
1 of 33

Recommended

DevOps Roadtrip Minneapolis by
DevOps Roadtrip Minneapolis DevOps Roadtrip Minneapolis
DevOps Roadtrip Minneapolis VictorOps
502 views184 slides
JMX Introduction by
JMX IntroductionJMX Introduction
JMX Introductionzeroproductionincidents
2.6K views27 slides
WebLogic JMX for DevOps by
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOpsFrank Munz
3.4K views40 slides
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013) by
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)Cyrille Le Clerc
26K views66 slides
DevconTLV 2014 (Jan) - DIY DevOps by
DevconTLV 2014 (Jan) - DIY DevOpsDevconTLV 2014 (Jan) - DIY DevOps
DevconTLV 2014 (Jan) - DIY DevOpsLeonid Mirsky
1.7K views42 slides
Customer Ops: DevOps &lt;3 customer support by
Customer Ops: DevOps &lt;3 customer supportCustomer Ops: DevOps &lt;3 customer support
Customer Ops: DevOps &lt;3 customer supportDatadog
860 views47 slides

More Related Content

Viewers also liked

Practical Monitoring Techniques by
Practical Monitoring TechniquesPractical Monitoring Techniques
Practical Monitoring TechniquesAriel Moskovich
663 views12 slides
Which watcher watches CloudWatch by
Which watcher watches CloudWatch Which watcher watches CloudWatch
Which watcher watches CloudWatch David Lutz
2.6K views41 slides
Measured availability - Sanjay Singh - DevOps Bangalore meetup March 28th 2015 by
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 2015DevOpsBangalore
576 views11 slides
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar by
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 WebinarITSM Academy, Inc.
451 views24 slides
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics by
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 AppDynamicsNima Badiey
3.9K views52 slides
DevOps/Flow workshop for agile india 2015 by
DevOps/Flow workshop for agile india 2015DevOps/Flow workshop for agile india 2015
DevOps/Flow workshop for agile india 2015Yuval Yeret
4.3K views85 slides

Viewers also liked(15)

Which watcher watches CloudWatch by David Lutz
Which watcher watches CloudWatch Which watcher watches CloudWatch
Which watcher watches CloudWatch
David Lutz2.6K views
Measured availability - Sanjay Singh - DevOps Bangalore meetup March 28th 2015 by DevOpsBangalore
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
DevOpsBangalore576 views
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar by ITSM Academy, Inc.
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
ITSM Academy, Inc.451 views
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics by Nima Badiey
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
Nima Badiey3.9K views
DevOps/Flow workshop for agile india 2015 by Yuval Yeret
DevOps/Flow workshop for agile india 2015DevOps/Flow workshop for agile india 2015
DevOps/Flow workshop for agile india 2015
Yuval Yeret4.3K views
DevOps - Retour d'expérience - MarsJug du 29 Juin 2011 by Henri Gomez
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
Henri Gomez2.8K views
Run IT Support the DevOps Way by Atlassian
Run IT Support the DevOps WayRun IT Support the DevOps Way
Run IT Support the DevOps Way
Atlassian3.3K views
Jolokia - JMX on Capsaicin (Devoxx 2011) by roland.huss
Jolokia - JMX on Capsaicin (Devoxx 2011)Jolokia - JMX on Capsaicin (Devoxx 2011)
Jolokia - JMX on Capsaicin (Devoxx 2011)
roland.huss21.9K views
Jelastic - DevOps PaaS Business with Docker Support for Service Providers by Jelastic Multi-Cloud PaaS
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 by GloverParkGroup
Public Opinion Landscape: Economy 5.25.16Public Opinion Landscape: Economy 5.25.16
Public Opinion Landscape: Economy 5.25.16
GloverParkGroup892 views
戴紅玫瑰的醜女人 by He Yan
戴紅玫瑰的醜女人戴紅玫瑰的醜女人
戴紅玫瑰的醜女人
He Yan1.1K views

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

Taiwan Web Standards Talk 2011 by
Taiwan Web Standards Talk 2011Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011Zi Bin Cheah
1.4K views60 slides
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets by
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 TabletsStefan Kolb
572 views53 slides
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets by
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 TabletsIndiginox
483 views52 slides
WCXM marketplace 2012 by
WCXM marketplace 2012WCXM marketplace 2012
WCXM marketplace 2012Irina Guseva
1.1K views14 slides
Measuring web performance. Velocity EU 2011 by
Measuring web performance. Velocity EU 2011Measuring web performance. Velocity EU 2011
Measuring web performance. Velocity EU 2011Stephen Thair
2.7K views57 slides
Smart Parking Solution using Camera Networks and Real-time Computer Vision by
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 VisionIRJET Journal
10 views6 slides

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

Taiwan Web Standards Talk 2011 by Zi Bin Cheah
Taiwan Web Standards Talk 2011Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011
Zi Bin Cheah1.4K views
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets by Stefan Kolb
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
Stefan Kolb572 views
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets by Indiginox
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
Indiginox483 views
WCXM marketplace 2012 by Irina Guseva
WCXM marketplace 2012WCXM marketplace 2012
WCXM marketplace 2012
Irina Guseva1.1K views
Measuring web performance. Velocity EU 2011 by Stephen Thair
Measuring web performance. Velocity EU 2011Measuring web performance. Velocity EU 2011
Measuring web performance. Velocity EU 2011
Stephen Thair2.7K views
Smart Parking Solution using Camera Networks and Real-time Computer Vision by IRJET Journal
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
IRJET Journal10 views
APPLICATION OF VARIOUS DEEP LEARNING MODELS FOR AUTOMATIC TRAFFIC VIOLATION D... by ijitcs
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...
ijitcs5 views
Applying BDD/TDD practices, using Jasmine.js by Anil Tarte
Applying BDD/TDD practices, using Jasmine.jsApplying BDD/TDD practices, using Jasmine.js
Applying BDD/TDD practices, using Jasmine.js
Anil Tarte893 views
Keeping Your Digital Office Clean Wim Putzeys Panoptic by Wim Putzeys
Keeping Your Digital Office Clean Wim Putzeys PanopticKeeping Your Digital Office Clean Wim Putzeys Panoptic
Keeping Your Digital Office Clean Wim Putzeys Panoptic
Wim Putzeys569 views
MT5で実現するマルチデバイス、クロスプラットフォーム by Six Apart KK
MT5で実現するマルチデバイス、クロスプラットフォームMT5で実現するマルチデバイス、クロスプラットフォーム
MT5で実現するマルチデバイス、クロスプラットフォーム
Six Apart KK2K views
ROLE Vision RWTH Aachen by Ralf Klamma
ROLE Vision RWTH AachenROLE Vision RWTH Aachen
ROLE Vision RWTH Aachen
Ralf Klamma443 views
Smart Traffic System using Machine Learning by IRJET Journal
Smart Traffic System using Machine LearningSmart Traffic System using Machine Learning
Smart Traffic System using Machine Learning
IRJET Journal17 views
Curriculum Vitae Fabio Vitaterna - ENG by Fabio Vitaterna
Curriculum Vitae Fabio Vitaterna - ENGCurriculum Vitae Fabio Vitaterna - ENG
Curriculum Vitae Fabio Vitaterna - ENG
Fabio Vitaterna172 views
What is going on - Application diagnostics on Azure - TechDays Finland by Maarten Balliauw
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
Maarten Balliauw746 views
Html5 performance by fanqstefan
Html5 performanceHtml5 performance
Html5 performance
fanqstefan1.2K views
Credit card fraud detection using random forest &amp; cart algorithm by Venkat Projects
Credit card fraud detection using random forest &amp; cart algorithmCredit card fraud detection using random forest &amp; cart algorithm
Credit card fraud detection using random forest &amp; cart algorithm
Venkat Projects492 views

More from Cyrille Le Clerc

Embracing Observability in CI/CD with OpenTelemetry by
Embracing Observability in CI/CD with OpenTelemetryEmbracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetryCyrille Le Clerc
464 views17 slides
Joe Mobile sur le Cloud - DevoxxFR 2013 by
Joe Mobile sur le Cloud - DevoxxFR 2013Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013Cyrille Le Clerc
1.1K views16 slides
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR... by
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...Cyrille Le Clerc
4.8K views70 slides
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions... by
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...Cyrille Le Clerc
1.7K views76 slides
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective by
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 perspectiveCyrille Le Clerc
1.5K views73 slides
Java Application Monitoring with AppDynamics' Founder by
Java Application Monitoring with AppDynamics' FounderJava Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' FounderCyrille Le Clerc
2.6K views20 slides

More from Cyrille Le Clerc(10)

Embracing Observability in CI/CD with OpenTelemetry by Cyrille Le Clerc
Embracing Observability in CI/CD with OpenTelemetryEmbracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetry
Cyrille Le Clerc464 views
Joe Mobile sur le Cloud - DevoxxFR 2013 by Cyrille Le Clerc
Joe Mobile sur le Cloud - DevoxxFR 2013Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013
Cyrille Le Clerc1.1K views
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR... by Cyrille Le Clerc
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...
Cyrille Le Clerc4.8K views
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions... by Cyrille Le Clerc
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...
Cyrille Le Clerc1.7K views
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective by Cyrille Le Clerc
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
Cyrille Le Clerc1.5K views
Java Application Monitoring with AppDynamics' Founder by Cyrille Le Clerc
Java Application Monitoring with AppDynamics' FounderJava Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' Founder
Cyrille Le Clerc2.6K views
Bonnes pratiques des applications java prêtes pour la production by Cyrille Le Clerc
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
Cyrille Le Clerc1.9K views
Xebia Knowledge Exchange - Owasp Top Ten by Cyrille Le Clerc
Xebia Knowledge Exchange - Owasp Top TenXebia Knowledge Exchange - Owasp Top Ten
Xebia Knowledge Exchange - Owasp Top Ten
Cyrille Le Clerc1.8K views
Soirée Data Grid au Paris JUG (2009/05/12) by 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)
Cyrille Le Clerc1.4K views

Recently uploaded

Kyo - Functional Scala 2023.pdf by
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
418 views92 slides
MVP and prioritization.pdf by
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
37 views8 slides
20231123_Camunda Meetup Vienna.pdf by
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
45 views73 slides
Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
66 views46 slides
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
38 views34 slides
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueShapeBlue
25 views13 slides

Recently uploaded(20)

CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue38 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue25 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue31 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue61 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue71 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue106 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays33 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue70 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely29 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue28 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman38 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue66 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue54 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue75 views

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