Paris Devops - Monitoring And Feature Toggle Pattern With JMX
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Paris Devops - Monitoring And Feature Toggle Pattern With JMX

on

  • 4,228 views

Monitoring and Feature Toggle Pattern with JMX @ Paris Devops Meetup

Monitoring and Feature Toggle Pattern with JMX @ Paris Devops Meetup

Statistics

Views

Total Views
4,228
Views on SlideShare
4,156
Embed Views
72

Actions

Likes
6
Downloads
44
Comments
0

6 Embeds 72

http://lanyrd.com 64
https://twitter.com 2
http://twitter.com 2
http://www.slashdocs.com 2
http://paper.li 1
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Paris Devops - Monitoring And Feature Toggle Pattern With JMX Presentation Transcript

  • 1. Monitoring and Feature Toggle Pattern with JMX Bruno Bonfils Cyrille Le Clerc 15/06/2011Thursday, 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” 2Thursday, June 16, 2011
  • 3. The use case 3Thursday, 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 4Thursday, 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 5Thursday, June 16, 2011
  • 6. Part 1 Monitoring with JMX 6Thursday, June 16, 2011
  • 7. Simplified Use Case 7Thursday, June 16, 2011
  • 8. Simplified Use Case Corporate Data Center travel-ecommerce Tomcat Credit Card Service Mock Monitoring Booking and Credit Card Service 8Thursday, June 16, 2011
  • 9. Simplified Use Case Corporate Data Center travel-ecommerce Tomcat Credit Card Service Mock Monitoring Booking and Credit Card Service 9Thursday, June 16, 2011
  • 10. Custom/business indicator monitoring with JMX 10Thursday, June 16, 2011
  • 11. Custom Indicator Monitoring with JMX CreditCardService #purchase() CreditCardService MonitoringImpl CreditCardServiceImpl #purchase() #purchase() monitoring logic isolated with a delegate pattern 11Thursday, June 16, 2011
  • 12. Custom Indicator Monitoring with JMX@ManagedResourcepublic 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 12Thursday, June 16, 2011
  • 13. Accessing JMX is not so difficult 13Thursday, June 16, 2011
  • 14. JMX Monitoring with Visual VM 14Thursday, 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 15Thursday, 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 16Thursday, June 16, 2011
  • 17. Monotoring systems AppDynamics Hyperic All others ... 17Thursday, 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 18Thursday, June 16, 2011
  • 19. Part 2 Feature Toggle Pattern with JMX 19Thursday, June 16, 2011
  • 20. Simplified Use Case 20Thursday, June 16, 2011
  • 21. Simplified Use Case Corporate Data Center travel-ecommerce anti-fraud Tomcat Tomcat Credit Card Service Enable anti-fraud 21Thursday, June 16, 2011
  • 22. What ? Why ? 22Thursday, 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 23Thursday, 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 24Thursday, June 16, 2011
  • 25. Coding Patterns 25Thursday, June 16, 2011
  • 26. Coding PatternsDispatcher 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 26Thursday, June 16, 2011
  • 27. Coding PatternsTo duplicate or not to duplicate ? Dispatching Smart reuse and mutualization Dispatching Brutal duplication Version 1 Version 2 27Thursday, June 16, 2011
  • 28. Coding PatternsTo duplicate or not to duplicate ? Dispatching Smart reuse and mutualization Dispatching Brutal duplication Version 1 Version 2 28Thursday, June 16, 2011
  • 29. Coding PatternsTo duplicate or not to duplicate ? Dispatching Smart reuse and mutualization Dispatching Brutal duplication Version 1 Version 2 29Thursday, June 16, 2011
  • 30. Coding PatternsTo 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 30Thursday, June 16, 2011
  • 31. Coding PatternsTo duplicate or not to duplicate ? Old code removal is simpler with brutal duplication 31Thursday, June 16, 2011
  • 32. Demo 32Thursday, June 16, 2011
  • 33. Questions / Answers ? 33Thursday, June 16, 2011