90
JBoss의 애플리케이션 모니터링 플랫폼 오픈소스 프로젝트 RHQ와 Byteman 소개 원종석 kth 2013. 11. 9

JBoss Community's Application Monitoring Platform

  • Upload
    ted-won

  • View
    730

  • Download
    7

Embed Size (px)

DESCRIPTION

Introduction to RHQ and Byteman JBUG 2013 10th Anniversary Conference

Citation preview

Page 1: JBoss Community's Application Monitoring Platform

JBoss의����������� ������������������  애플리케이션����������� ������������������  모니터링����������� ������������������  플랫폼����������� ������������������  

오픈소스����������� ������������������  프로젝트����������� ������������������  RHQ와����������� ������������������  Byteman����������� ������������������  소개����������� ������������������  

원종석����������� ������������������  

kth����������� ������������������  

2013.����������� ������������������  11.����������� ������������������  9����������� ������������������  

����������� ������������������  

Page 2: JBoss Community's Application Monitoring Platform
Page 3: JBoss Community's Application Monitoring Platform
Page 4: JBoss Community's Application Monitoring Platform

tedwon����������� ������������������  

! 개발자����������� ������������������  인권에����������� ������������������  관심이����������� ������������������  많습니다.����������� ������������������  

����������� ������������������  

!  RHQ����������� ������������������  Evangelist����������� ������������������  

!  Data����������� ������������������  Platform����������� ������������������  Engineer����������� ������������������  

!  Real-time����������� ������������������  Expert����������� ������������������  Engineer����������� ������������������  

����������� ������������������  

4����������� ������������������  

Page 5: JBoss Community's Application Monitoring Platform

olleh����������� ������������������  tv����������� ������������������  smart����������� ������������������  

5����������� ������������������  

Page 6: JBoss Community's Application Monitoring Platform

tedwon����������� ������������������  

kth����������� ������������������  DAISY����������� ������������������  Data����������� ������������������  Platform����������� ������������������  

6����������� ������������������  

Page 7: JBoss Community's Application Monitoring Platform

Agenda����������� ������������������  

!  Prologue����������� ������������������  

!  RHQ����������� ������������������  이야기����������� ������������������  

!  Byteman����������� ������������������  이야기����������� ������������������  

!  Epilogue����������� ������������������  

7����������� ������������������  

Page 8: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

오늘의����������� ������������������  주제는����������� ������������������  

개발자가����������� ������������������  개발����������� ������������������  활동의����������� ������������������  폭을����������� ������������������  넓히는데����������� ������������������  ����������� ������������������  

도움이����������� ������������������  되는����������� ������������������  이야기����������� ������������������  

8����������� ������������������  

Page 9: JBoss Community's Application Monitoring Platform

Intro����������� ������������������  

9����������� ������������������  

Page 10: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

Software����������� ������������������  engineers����������� ������������������  apply����������� ������������������  

the����������� ������������������  principles����������� ������������������  of����������� ������������������  engineering����������� ������������������  ����������� ������������������  

to����������� ������������������  the����������� ������������������  design,����������� ������������������  development,����������� ������������������  maintenance,

����������� ������������������  testing,����������� ������������������  and����������� ������������������  evaluation����������� ������������������  of����������� ������������������  the����������� ������������������  software.����������� ������������������  

10����������� ������������������  

Page 11: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

자신의����������� ������������������  가치를����������� ������������������  높이는����������� ������������������  길����������� ������������������  

그����������� ������������������  가치만큼����������� ������������������  보상을����������� ������������������  받아야����������� ������������������  

11����������� ������������������  

Page 12: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

프로페셔널����������� ������������������  소프트웨어����������� ������������������  엔지니어가����������� ������������������  ����������� ������������������  

되기����������� ������������������  위해서는����������� ������������������  무엇이����������� ������������������  필요할까요?����������� ������������������  

12����������� ������������������  

Page 13: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

Monitoring����������� ������������������  &����������� ������������������  Measurements����������� ������������������  

13����������� ������������������  

Page 14: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

개발자가����������� ������������������  모니터링과����������� ������������������  측정을����������� ������������������  한다는����������� ������������������  것의����������� ������������������  의미����������� ������������������  

14����������� ������������������  

Page 15: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

결국,����������� ������������������  성능을����������� ������������������  관리하겠다는����������� ������������������  것����������� ������������������  

����������� ������������������  

애플리케이션이����������� ������������������  잘����������� ������������������  동작하는지����������� ������������������  끝까지����������� ������������������  확인하는����������� ������������������  것����������� ������������������  

����������� ������������������  

15����������� ������������������  

Page 16: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

반대로,����������� ������������������  이런����������� ������������������  것들을����������� ������������������  고려하지����������� ������������������  않는다면...����������� ������������������  

16����������� ������������������  

Page 17: JBoss Community's Application Monitoring Platform

Intro����������� ������������������  

17����������� ������������������  

Page 18: JBoss Community's Application Monitoring Platform

Intro����������� ������������������  

! 여기에����������� ������������������  내용을����������� ������������������  넣어주세요.����������� ������������������  

18����������� ������������������  

Page 19: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

결국!����������� ������������������  우리는����������� ������������������  결단을����������� ������������������  내립니다.����������� ������������������  

19����������� ������������������  

Page 20: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

서버����������� ������������������  Restart!����������� ������������������  

20����������� ������������������  

Page 21: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

21����������� ������������������  

Monitoring����������� ������������������  

Measurements����������� ������������������  

Page 22: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

모니터링����������� ������������������  도구들을����������� ������������������  이용하므로써����������� ������������������  

장애����������� ������������������  상황����������� ������������������  발생시����������� ������������������  ����������� ������������������  

정확하게����������� ������������������  파악하고����������� ������������������  수치로����������� ������������������  대응할����������� ������������������  수����������� ������������������  있다����������� ������������������  

22����������� ������������������  

Page 23: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

23����������� ������������������  

Page 24: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

24����������� ������������������  

Page 25: JBoss Community's Application Monitoring Platform

Prologue����������� ������������������  

25����������� ������������������  

Page 26: JBoss Community's Application Monitoring Platform

Agenda����������� ������������������  

!  Prologue����������� ������������������  

!  RHQ����������� ������������������  이야기����������� ������������������  

!  Byteman����������� ������������������  이야기����������� ������������������  

!  Epilogue����������� ������������������  

26����������� ������������������  

Page 27: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  소개����������� ������������������  

27����������� ������������������  

Monitoring����������� ������������������  &����������� ������������������  Management����������� ������������������  Platform����������� ������������������  

Page 28: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  소개����������� ������������������  

!  JBoss의����������� ������������������  대표적인����������� ������������������  Infrastructure����������� ������������������  Project����������� ������������������  

!  2005년����������� ������������������  부터����������� ������������������  시작����������� ������������������  -����������� ������������������  9년����������� ������������������  

! 최신����������� ������������������  RHQ����������� ������������������  4.9.0����������� ������������������  

–  D3����������� ������������������  Chart,����������� ������������������  Cassandra����������� ������������������  NoSQL����������� ������������������  

! 전세계의����������� ������������������  Contributor들의����������� ������������������  참여와����������� ������������������  기여에����������� ������������������  의해����������� ������������������  개발����������� ������������������  

28����������� ������������������  

Page 29: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Dashboard����������� ������������������  

29����������� ������������������  

Page 30: JBoss Community's Application Monitoring Platform

����������� ������������������  RHQ����������� ������������������  Java����������� ������������������  Application����������� ������������������  Monitoring����������� ������������������  

30����������� ������������������  

!  Custom����������� ������������������  Java����������� ������������������  Application����������� ������������������  /����������� ������������������  JVM����������� ������������������  모니터링����������� ������������������  

Page 31: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  D3����������� ������������������  Chart����������� ������������������  

31����������� ������������������  

Page 32: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Metric����������� ������������������  Chart����������� ������������������  

32����������� ������������������  

Page 33: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Remote����������� ������������������  Operation����������� ������������������  

33����������� ������������������  

! 원격����������� ������������������  명령����������� ������������������  실행����������� ������������������  기능����������� ������������������  제공����������� ������������������  

Page 34: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  REST����������� ������������������  API����������� ������������������  

34����������� ������������������  

!  3th����������� ������������������  party를����������� ������������������  위한����������� ������������������  API����������� ������������������  제공����������� ������������������  

Page 35: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  모니터링����������� ������������������  대상����������� ������������������  

!  Java����������� ������������������  JVM����������� ������������������  

–  Apache����������� ������������������  HTTP����������� ������������������  Server����������� ������������������  

–  Tomcat����������� ������������������  

–  JBoss����������� ������������������  AS,����������� ������������������  Infinispan����������� ������������������  

–  Hadoop����������� ������������������  

!  OS����������� ������������������  Resources����������� ������������������  –  CPU,����������� ������������������  Mem,����������� ������������������  Disk,����������� ������������������  Network����������� ������������������  

!  C-daemon����������� ������������������  

–  Scribe����������� ������������������  Log����������� ������������������  Aggregator����������� ������������������  

35����������� ������������������  

Page 36: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Architecture����������� ������������������  

!  Agent����������� ������������������  /����������� ������������������  Server����������� ������������������  Architecture����������� ������������������  !  Extending����������� ������������������  by����������� ������������������  Plugins����������� ������������������  

36����������� ������������������  

Page 37: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  구현����������� ������������������  기술����������� ������������������  

!  JBoss의����������� ������������������  프로젝트로����������� ������������������  구성됨����������� ������������������  

–  JBoss����������� ������������������  AS����������� ������������������  7,����������� ������������������  EJB,����������� ������������������  JPA,����������� ������������������  Hibernate,����������� ������������������  JBoss����������� ������������������  Remoting����������� ������������������  

–  JBoss����������� ������������������  Web����������� ������������������  /����������� ������������������  Transactions����������� ������������������  /����������� ������������������  Infinspan����������� ������������������  /����������� ������������������  Serialization����������� ������������������  

–  JBoss����������� ������������������  Seam����������� ������������������  /����������� ������������������  RishFaces����������� ������������������  

!  GWT����������� ������������������  

!  SIGAR����������� ������������������  API,����������� ������������������  JMX����������� ������������������  

37����������� ������������������  

Page 38: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  주요����������� ������������������  기능����������� ������������������  및����������� ������������������  강점����������� ������������������  

! 설치����������� ������������������  /����������� ������������������  제거����������� ������������������  용이����������� ������������������  

–  Unzip,����������� ������������������  Config,����������� ������������������  Run����������� ������������������  

!  Resource����������� ������������������  Auto����������� ������������������  discovery����������� ������������������  

! 사용자����������� ������������������  권한����������� ������������������  기능����������� ������������������  

38����������� ������������������  

Page 39: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  상용����������� ������������������  기술����������� ������������������  지원����������� ������������������  버전����������� ������������������  소개����������� ������������������  

!  RHQ����������� ������������������  유료����������� ������������������  기술����������� ������������������  지원����������� ������������������  버전����������� ������������������  

!  Code����������� ������������������  base����������� ������������������  동일����������� ������������������  

!  Fully����������� ������������������  quality-tested����������� ������������������  &����������� ������������������  certified����������� ������������������  by����������� ������������������  Red����������� ������������������  Hat����������� ������������������  

!  JBoss����������� ������������������  ON����������� ������������������  으로����������� ������������������  줄여서����������� ������������������  호칭����������� ������������������  

39����������� ������������������  

Page 40: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Android����������� ������������������  Client����������� ������������������  

!  RHQpocket����������� ������������������  -����������� ������������������  vimeo.com/29740860����������� ������������������  

40����������� ������������������  

Page 41: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Android����������� ������������������  Client����������� ������������������  

!  RHQpocket����������� ������������������  -����������� ������������������  vimeo.com/29740860����������� ������������������  

41����������� ������������������  

Page 42: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Positioning����������� ������������������  

42����������� ������������������  

RHQ

Page 43: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

43����������� ������������������  

How����������� ������������������  to����������� ������������������  monitor����������� ������������������  

Page 44: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  Apache����������� ������������������  Flume����������� ������������������  

44����������� ������������������  

JVM

Page 45: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  Apache����������� ������������������  Flume����������� ������������������  –  JVM����������� ������������������  Heap����������� ������������������  Usage����������� ������������������  

–  Sources’����������� ������������������  Stats����������� ������������������  –  Channels’����������� ������������������  Stats����������� ������������������  –  Sinks’����������� ������������������  Stats����������� ������������������  

45����������� ������������������  

Page 46: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  Apache����������� ������������������  Flume����������� ������������������  –  JVM����������� ������������������  Heap����������� ������������������  Usage����������� ������������������  

–  Sources’����������� ������������������  Stats����������� ������������������  –  Channels’����������� ������������������  Stats����������� ������������������  –  Sinks’����������� ������������������  Stats����������� ������������������  

46����������� ������������������  

Page 47: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  Apache����������� ������������������  Flume����������� ������������������  –  JVM����������� ������������������  Heap����������� ������������������  Usage����������� ������������������  

–  Sources’����������� ������������������  Stats����������� ������������������  –  Channels’����������� ������������������  Stats����������� ������������������  –  Sinks’����������� ������������������  Stats����������� ������������������  

47����������� ������������������  

Page 48: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  JVM����������� ������������������  Heap����������� ������������������  Usages����������� ������������������  

48����������� ������������������  

Page 49: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  Channels’����������� ������������������  Stats����������� ������������������  

49����������� ������������������  

Page 50: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

50����������� ������������������  

Generally����������� ������������������  How����������� ������������������  to����������� ������������������  monitor����������� ������������������  

Page 51: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  Live����������� ������������������  Charts����������� ������������������  

51����������� ������������������  

Page 52: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  CPU,����������� ������������������  Memory,����������� ������������������  Disk����������� ������������������  

52����������� ������������������  

Page 53: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

! Memory����������� ������������������  usage����������� ������������������  stats����������� ������������������  

53����������� ������������������  

Page 54: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  JVM����������� ������������������  Monitoring����������� ������������������  –  CPU����������� ������������������  /����������� ������������������  Heap����������� ������������������  /����������� ������������������  Classes����������� ������������������  /����������� ������������������  Thread����������� ������������������  

54����������� ������������������  

Page 55: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  JBoss����������� ������������������  Application����������� ������������������  Server����������� ������������������  7����������� ������������������  

55����������� ������������������  

Page 56: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  JBoss����������� ������������������  Application����������� ������������������  Server����������� ������������������  7����������� ������������������  

56����������� ������������������  

Page 57: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  JBoss����������� ������������������  Application����������� ������������������  Server����������� ������������������  7����������� ������������������  

57����������� ������������������  

Page 58: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  Monitoring����������� ������������������  Practices����������� ������������������  

!  Apache����������� ������������������  Kafka����������� ������������������  Broker����������� ������������������  모니터링����������� ������������������  

58����������� ������������������  

Page 59: JBoss Community's Application Monitoring Platform

RHQ����������� ������������������  소개����������� ������������������  

59����������� ������������������  

Monitoring����������� ������������������  &����������� ������������������  Management����������� ������������������  Platform����������� ������������������  

Page 60: JBoss Community's Application Monitoring Platform

Agenda����������� ������������������  

!  Prologue����������� ������������������  

!  RHQ����������� ������������������  이야기����������� ������������������  

!  Byteman����������� ������������������  이야기����������� ������������������  

!  Epilogue����������� ������������������  

60����������� ������������������  

Page 61: JBoss Community's Application Monitoring Platform

61����������� ������������������  

Byteman����������� ������������������  소개����������� ������������������  

Page 62: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  용도����������� ������������������  

! 장애����������� ������������������  상황시����������� ������������������  디버깅����������� ������������������  

! 성능����������� ������������������  측정����������� ������������������  

!  JDK����������� ������������������  class����������� ������������������  check����������� ������������������  –  java.lang.*����������� ������������������  

–  System.exit()����������� ������������������  and����������� ������������������  System.gc()����������� ������������������  

!  Analyze����������� ������������������  3rd����������� ������������������  party����������� ������������������  library,����������� ������������������  WAS����������� ������������������  

!  Synchronized����������� ������������������  block����������� ������������������  check����������� ������������������  

62����������� ������������������  

Page 63: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  용도����������� ������������������  

! WAR,����������� ������������������  Spring,����������� ������������������  Hibernate,����������� ������������������  JDBC����������� ������������������  on����������� ������������������  Tomcat����������� ������������������  

!  JDBC����������� ������������������  Driver에서����������� ������������������  Database����������� ������������������  connection����������� ������������������  에러����������� ������������������  

! 실행����������� ������������������  중����������� ������������������  간헐적으로����������� ������������������  발생!!����������� ������������������  

63����������� ������������������  

Page 64: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  용도����������� ������������������  

! 운영����������� ������������������  중����������� ������������������  로깅����������� ������������������  필요����������� ������������������  

!  Byteman����������� ������������������  적용����������� ������������������  결정����������� ������������������  

!  Rule����������� ������������������  정의����������� ������������������  

64����������� ������������������  

Page 65: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  용도����������� ������������������  

!  Byteman으로����������� ������������������  근본����������� ������������������  원인을����������� ������������������  밝혀냄����������� ������������������  

! 개발자의����������� ������������������  예외����������� ������������������  처리����������� ������������������  코드가����������� ������������������  충분하지����������� ������������������  못����������� ������������������  했음����������� ������������������  발견����������� ������������������  

! 동일한����������� ������������������  현상이����������� ������������������  반복되지����������� ������������������  않도록����������� ������������������  조치����������� ������������������  

65����������� ������������������  

Page 66: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  소개����������� ������������������  

66����������� ������������������  

개발자의 또 하나의 무기 Byteman

영국제 명품 무기

Thanks Andrew :-)

Page 67: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  소개����������� ������������������  

!  Bytecode����������� ������������������  Injection����������� ������������������  

! 디버깅����������� ������������������  코드를����������� ������������������  동적으로����������� ������������������  삽입����������� ������������������  하기����������� ������������������  

!  Rule-based����������� ������������������  scripting����������� ������������������  language로����������� ������������������  정의����������� ������������������  

! 소스����������� ������������������  코드,����������� ������������������  컴파일,����������� ������������������  재구동����������� ������������������  불필요����������� ������������������  

! 안전하게����������� ������������������  실행����������� ������������������  중인����������� ������������������  JVM의����������� ������������������  bytecode를����������� ������������������  들여다����������� ������������������  보����������� ������������������  

67����������� ������������������  

Page 68: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  소개����������� ������������������  

!  Java����������� ������������������  Agent����������� ������������������  API를����������� ������������������  기반으로����������� ������������������  Byteman����������� ������������������  Agent����������� ������������������  구현����������� ������������������  

–  java.lang.instrument����������� ������������������  API����������� ������������������  

!  Byteman����������� ������������������  is����������� ������������������  a����������� ������������������  Java����������� ������������������  agent����������� ������������������  program����������� ������������������  

–  Retransform����������� ������������������  code����������� ������������������  only����������� ������������������  after����������� ������������������  load����������� ������������������  

!  Injected����������� ������������������  codes����������� ������������������  are����������� ������������������  reversible����������� ������������������  –  Inject된����������� ������������������  bytecode는����������� ������������������  다시����������� ������������������  원복����������� ������������������  가능����������� ������������������  

68����������� ������������������  

Page 69: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

RULE trace main entry

CLASS MyAppMain

METHOD main

AT ENTRY IF true

DO traceln("entering main")

ENDRULE

69����������� ������������������  

Page 70: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

RULE trace main entry " Rule name

CLASS MyAppMain

METHOD main

AT ENTRY IF true

DO traceln("entering main")

ENDRULE

70����������� ������������������  

Page 71: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

RULE trace main entry

CLASS MyAppMain " Event (Trigger Point)

METHOD main

AT ENTRY IF true

DO traceln("entering main")

ENDRULE

71����������� ������������������  

Page 72: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

RULE trace main entry

CLASS MyAppMain

METHOD main

AT ENTRY IF true " Condition

DO traceln("entering main”)

ENDRULE

72����������� ������������������  

Page 73: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

RULE trace main entry

CLASS MyAppMain

METHOD main

AT ENTRY IF true

DO traceln("entering main") " Action

ENDRULE

73����������� ������������������  

Page 74: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

!  Event����������� ������������������  –  CLASS/INTERFACE,����������� ������������������  METHOD,����������� ������������������  AT����������� ������������������  

! defines����������� ������������������  trigger����������� ������������������  point(s)����������� ������������������  for����������� ������������������  rule����������� ������������������  

!  Binding����������� ������������������  –  introduces/initializes����������� ������������������  rule����������� ������������������  variables����������� ������������������  

!  Condition����������� ������������������  –  Java����������� ������������������  boolean����������� ������������������  expression����������� ������������������  

!  Action����������� ������������������  –  one����������� ������������������  or����������� ������������������  more����������� ������������������  Java����������� ������������������  expressions����������� ������������������  

74����������� ������������������  

Page 75: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  설치����������� ������������������  

!  Download����������� ������������������  and����������� ������������������  unzip����������� ������������������  

! 환경����������� ������������������  변수에����������� ������������������  BYTEMAN_HOME����������� ������������������  경로����������� ������������������  

75����������� ������������������  

Page 76: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Quick����������� ������������������  Start����������� ������������������  

# 대상 클래스 public class AppMain {

public����������� ������������������  static����������� ������������������  void����������� ������������������  main(String[]����������� ������������������  args)����������� ������������������  {����������� ������������������  

for����������� ������������������  (int����������� ������������������  i����������� ������������������  =����������� ������������������  0;����������� ������������������  i����������� ������������������  <����������� ������������������  args.length;����������� ������������������  i++)����������� ������������������  {����������� ������������������  

System.out.println(args[i]);����������� ������������������  

}����������� ������������������  

}����������� ������������������  

} # 실행 $ java AppMain foo bar baz foo bar baz

76����������� ������������������  

Page 77: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

!  AppMain����������� ������������������  main����������� ������������������  메소드����������� ������������������  호출����������� ������������������  시작����������� ������������������  시에����������� ������������������  로그를����������� ������������������  출력하라����������� ������������������  

#  appmain.btm����������� ������������������  룰����������� ������������������  파일����������� ������������������  

RULE����������� ������������������  trace����������� ������������������  main����������� ������������������  entry����������� ������������������  

CLASS����������� ������������������  AppMain����������� ������������������  

METHOD����������� ������������������  main����������� ������������������  

AT����������� ������������������  ENTRY����������� ������������������  

IF����������� ������������������  true����������� ������������������  

DO����������� ������������������  traceln("entering����������� ������������������  main")����������� ������������������  

ENDRULE����������� ������������������  

77����������� ������������������  

Page 78: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Quick����������� ������������������  Start����������� ������������������  

# 대상 클래스 public class AppMain {

public����������� ������������������  static����������� ������������������  void����������� ������������������  main(String[]����������� ������������������  args)����������� ������������������  {����������� ������������������  

for����������� ������������������  (int����������� ������������������  i����������� ������������������  =����������� ������������������  0;����������� ������������������  i����������� ������������������  <����������� ������������������  args.length;����������� ������������������  i++)����������� ������������������  {����������� ������������������  

System.out.println(args[i]);����������� ������������������  

}����������� ������������������  

}����������� ������������������  

} # 실행 $ java -javaagent:byteman.jar=script:appmain.btm AppMain foo bar baz entering main foo bar baz

78����������� ������������������  

Page 79: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Rule����������� ������������������  정의����������� ������������������  

http://github.com/tedwon/byteman-quickstart����������� ������������������  

79����������� ������������������  

Page 80: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Bulit-in����������� ������������������  기능����������� ������������������  ����������� ������������������  

!  Tracing����������� ������������������  

! Managing����������� ������������������  Shared����������� ������������������  Rule����������� ������������������  State����������� ������������������  

!  Timing����������� ������������������  

!  Checking����������� ������������������  Caller����������� ������������������  Stack����������� ������������������  

!  Thread����������� ������������������  Synchronization����������� ������������������  

!  Recursive����������� ������������������  Trigger����������� ������������������  Management����������� ������������������  

80����������� ������������������  

Page 81: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  References����������� ������������������  

81����������� ������������������  

Refer to Byteman Programmer’s Guide

http://tedwon.com/display/dev/Byteman

Page 82: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  References����������� ������������������  

82����������� ������������������  

Home: www.jboss.org/byteman

Downloads: www.jboss.org/byteman/downloads

Docs: www.jboss.org/byteman/documentation

Blog: bytemanblog.blogspot.com

Git: github.com/bytemanproject/byteman

Forum: community.jboss.org/en/byteman

JIRA: issues.jboss.org/browse/BYTEMAN

Page 83: JBoss Community's Application Monitoring Platform

Byteman����������� ������������������  Releases����������� ������������������  

83����������� ������������������  

Page 84: JBoss Community's Application Monitoring Platform

84����������� ������������������  

Page 85: JBoss Community's Application Monitoring Platform

References����������� ������������������  

!  http://en.wikipedia.org/wiki/Software_engineer����������� ������������������  

!  http://docs.jboss.org/author/display/RHQ/Home����������� ������������������  

!  JBoss����������� ������������������  Operations����������� ������������������  Network����������� ������������������  2.4.2����������� ������������������  Basic����������� ������������������  Admin����������� ������������������  Guide����������� ������������������  

!  http://www.jboss.com/products/jbosson����������� ������������������  

!  http://en.wikipedia.org/wiki/JBoss_operations_network����������� ������������������  

!  http://vimeo.com/29740860����������� ������������������  

!  http://tedwon.com/display/dev/RHQ����������� ������������������  

!  http://www.jboss.org/byteman����������� ������������������  ����������� ������������������  

!  http://www.jboss.org/byteman/downloads����������� ������������������  

!  http://www.jboss.org/byteman/documentation����������� ������������������  

!  http://bytemanblog.blogspot.com����������� ������������������  

!  http://github.com/bytemanproject/byteman����������� ������������������  

!  http://community.jboss.org/en/byteman����������� ������������������  

!  http://issues.jboss.org/browse/BYTEMAN����������� ������������������  

!  http://tedwon.com/display/dev/Byteman����������� ������������������  

!  http://github.com/tedwon/byteman-quickstart����������� ������������������  

85����������� ������������������  

Page 86: JBoss Community's Application Monitoring Platform

86����������� ������������������  

Q & A

Page 87: JBoss Community's Application Monitoring Platform

Agenda����������� ������������������  

!  Prologue����������� ������������������  

!  RHQ����������� ������������������  이야기����������� ������������������  

!  Byteman����������� ������������������  이야기����������� ������������������  

!  Epilogue����������� ������������������  

87����������� ������������������  

Page 88: JBoss Community's Application Monitoring Platform

Epilogue����������� ������������������  

자연스럽게����������� ������������������  실력을����������� ������������������  발전시키는����������� ������������������  방법����������� ������������������  

좀����������� ������������������  더����������� ������������������  빨리����������� ������������������  고급����������� ������������������  개발자로����������� ������������������  성장하시길����������� ������������������  

JBUG����������� ������������������  커뮤니티에����������� ������������������  참여하세요!����������� ������������������  

88����������� ������������������  

Page 89: JBoss Community's Application Monitoring Platform

jboss.org����������� ������������������  

facebook.com/groups/jbossusergroup����������� ������������������  

jbugkorea.org����������� ������������������  

����������� ������������������  

����������� ������������������   89����������� ������������������  

Page 90: JBoss Community's Application Monitoring Platform

tedwon.com����������� ������������������  

[email protected]����������� ������������������  

����������� ������������������  

90����������� ������������������