Spring insight what just happened

40
Spring Insight – What Just Happened? Derek Beauregard

description

Presentation by Derek Beauregard at the Boulder Java User's Group on August 13, 2013. See more at http://boulderjug.org

Transcript of Spring insight what just happened

Page 1: Spring insight   what just happened

Spring  Insight  –  What  Just  Happened?  

Derek  Beauregard  

Page 2: Spring insight   what just happened

Agenda  •  What  Just  Happened?  

– Agile  Development,  QA,  Stress  &  Performance  tesCng  –  Logging?  – Debugger?    

•  STS  &  Integrated  in  Tomcat  (tc  Server)  •  Spring  Insight  Demo  Time  •  JMeter  &  Google  Chrome  Speed  Tracer  •  How  it  works  •  Plugins  &  AnnotaCons  •  Wrap  up  

Page 3: Spring insight   what just happened

Who  is  this  guy?  

Page 4: Spring insight   what just happened

Contact  Info  

•  Derek  Beauregard  – Sr.  Field  Engineer,  Pivotal  (formerly  VMware  &  formerly  Spring  Source)  – [email protected]  – goPivotal.com  – vfabric.co  

Page 5: Spring insight   what just happened

My  Fancy  New  Web  ApplicaCon  

Page 6: Spring insight   what just happened

ApplicaCon  Development  &  TesCng  

•  So  your  building  your  fancy  new  web  applicaCon  –  Is  it  working  the  way  you  expected?  – What  caused  that  failure?  – How  is  the  performance?  – Why  is  it  slow?  – What  the  heck  is  Hibernate  (or  whatever)  doing?  

Page 7: Spring insight   what just happened

My  Fancy  New  Web  ApplicaCon  

Page 8: Spring insight   what just happened

What  do  you  do  when  it  fails?  

•  Check  the  logs?  – Timestamps  – Session  IDs,  User  IDs  – Log  all  the  parameters  –  UGH?  

•  Run  the  debugger?    – Typically  doesn’t  help  with  performance  

•  And  what  do  you  do  in  QA  and  Performance  TesCng?    When  it  fails?    When  it  is  slow?  

Page 9: Spring insight   what just happened
Page 10: Spring insight   what just happened
Page 11: Spring insight   what just happened
Page 12: Spring insight   what just happened
Page 13: Spring insight   what just happened

There  has  got  to  be  a  beXer  way!  

•  Spring  Insight!  

Page 14: Spring insight   what just happened

BETTER  WAY  

Page 15: Spring insight   what just happened

       Demo  

Page 16: Spring insight   what just happened
Page 17: Spring insight   what just happened
Page 18: Spring insight   what just happened
Page 19: Spring insight   what just happened
Page 20: Spring insight   what just happened
Page 21: Spring insight   what just happened
Page 22: Spring insight   what just happened
Page 23: Spring insight   what just happened
Page 24: Spring insight   what just happened
Page 25: Spring insight   what just happened
Page 26: Spring insight   what just happened

Google  Speed  Tracer    

Page 27: Spring insight   what just happened

Web  ApplicaCon  

Spring  Insight  

Client  (Browser,  

JMeter,  etc.)  

Web  Layer  

Service  Layer  

Data  Layer   DB  

Spring  Insight  

Messaging  

Caching  

Page 28: Spring insight   what just happened

How  does  it  work?  

•  Spring  Insight  uses  automaCc  code  instrumentaCon  to  monitor  your  applicaCon  

•  It  does  this  by  introspecCng  exisCng  annotaCons  and  interfaces  for  key  aspects  of  your  applicaCon  

•  It  then  uses  AspectJ  AOP  point  cuts  to  monitor  the  code    

•  Runs  in  tc  Server  (Tomcat)  beside  your  web  applicaCon  

Page 29: Spring insight   what just happened

Plugins  

Custom…  

Spring  Integra;on  

Page 30: Spring insight   what just happened

More  Plugins  •  AnnotaCons  •  Akka  •  Axion  •  BlazeDS  •  Cassandra  •  Eclipse-­‐Persistence  •  Ehcache  •  Ejb3  •  Files-­‐tracker  •  GemFire  •  Grails  •  Hadoop  •  Hibernate  •  HXpClient3/4  •  jax-­‐rs  •  Jcr  

•  JDBC  •  JMS  •  JMX  •  JNDI  •  Jolt  •  JPA  •  JTA  •  JWS  •  LDAP  •  Logging  •  Mail  •  MongoDB  •  Portlet  •  Quartz  •  RabbitMQ  •  Redis  

•  RMI  •  Run-­‐exec  •  Servlet  •  Socket  •  Spring-­‐Batch  •  Spring-­‐Core  •  Spring-­‐Data  •  Spring-­‐IntegraCon  •  Spring-­‐Neo4j  •  Spring-­‐Security  •  Spring-­‐tx  •  Spring-­‐web  •  Spring-­‐WebFlow  •  Struts2  •  Tomcat  •  Developer  Kit  &  GitHub  

Page 31: Spring insight   what just happened

Plugins  

•  Many  plugins  are  supported  out  of  the  box  •  You  can  get  more  from  GitHub  or  develop  your  own  using  the  Developer  Kit  

•  GitHub:  hXps://github.com/SpringSource/spring-­‐insight-­‐plugins  

Page 32: Spring insight   what just happened

@InsightOpera;on  

@InsightEndPoint  

@InsightObscure  

@InsightSensi;ve  

Page 33: Spring insight   what just happened

AnnotaCons  

•  If  you  want  to  monitor  more  aspects  of  your  code  you  can  simply  annotate  the  methods  

Page 34: Spring insight   what just happened

Dynamic  Concrete  Aspects  <?xml  version="1.0"  encoding="UTF-­‐8"?>  <aspectj>          <aspects>                <concrete-­‐aspect  name="foo.bar.BazAspect”  extends="com.springsource.insight.collecCon.method.custom.CustomConcreCzedOperaConCollecConAspect">                        <pointcut  name="collecConPoint"    

 expression="execu;on(*  foo.bar.Baz.mySuperDuperMethod(..))"  />                </concrete-­‐aspect>          </aspects>  </aspectj>  

Page 35: Spring insight   what just happened

Dynamic  Concrete  Aspects  

•  Instrument  classes  and  methods  that  are  not  covered  by  plugins  or  Insight  annotaCons  

•  Defined  in  AspectJ  XML  configuraCon  •  No  changes  to  source  code  required!  

Page 36: Spring insight   what just happened

Spring  Insight  •  AutomaCc  •  No  Coding  &  No  ConfiguraCon  

•  Shows  Errors  •  Shows  Performance  •  Pluggable  •  Answers:  “What  Just  Happened?”  

Page 37: Spring insight   what just happened

Wrap  Up  

•  Helps  developers,  QA  Testers,  and  in  Stress  and  Performance  tesCng  to  answer:  “What  Just  Happened?”  

Page 38: Spring insight   what just happened
Page 39: Spring insight   what just happened
Page 40: Spring insight   what just happened

40 © Copyright 2013 Pivotal. All rights reserved.

FURTHER INFORMATION •  Me: [email protected]

•  Main Page & Downloads: http://www.springsource.org/insight

•  Documentation: http://pubs.vmware.com/vfabric53/topic/com.vmware.vfabric.tc-server.2.9/devedition/about.html

•  Video: http://www.youtube.com/watch?v=nBqSh7nVNzc

•  GitHub: https://github.com/SpringSource/spring-insight-plugins