KR100750834B1 - A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type - Google Patents

A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type Download PDF

Info

Publication number
KR100750834B1
KR100750834B1 KR1020050093795A KR20050093795A KR100750834B1 KR 100750834 B1 KR100750834 B1 KR 100750834B1 KR 1020050093795 A KR1020050093795 A KR 1020050093795A KR 20050093795 A KR20050093795 A KR 20050093795A KR 100750834 B1 KR100750834 B1 KR 100750834B1
Authority
KR
South Korea
Prior art keywords
code
monitoring
class
java
monitored
Prior art date
Application number
KR1020050093795A
Other languages
Korean (ko)
Other versions
KR20070038637A (en
Inventor
전재성
Original Assignee
(주)아이피엠에스
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by (주)아이피엠에스 filed Critical (주)아이피엠에스
Priority to KR1020050093795A priority Critical patent/KR100750834B1/en
Publication of KR20070038637A publication Critical patent/KR20070038637A/en
Application granted granted Critical
Publication of KR100750834B1 publication Critical patent/KR100750834B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators

Abstract

자바 어플리케이션에서 성능 데이터 추출을 위한 모니터링 방법 및 호출 관계 추적 방법이 개시된다. 본 발명에 따른 모니터링 방법은, 자바 클래스로더가 디스크 혹은 네트워크상에서 클래스 바이트 스트림을 메모리에 로드하여 클래스를 생성하기 직전, 로딩된 바이트 스트림의 자바 버추얼 머신 바이트 코드 인스트럭션 셋 분석을 통해 모니터링 대상이 되는 클래스 및 메소드를 식별할 수 있으며 또한 모니터링 대상 클래스 메소드에 추가적인 성능 추출코드를 삽입함으로써 클래스 및 메소드의 호출정보를 수집할 수 있다. 또한, 모니터링 대상이 되는 클래스를 실행한 자바 스레드 및 스택, 링크된 리스트의 자료구조를 이용하여 특정 스레드가 수행한 모든 클래스 및 메소드의 호출 관계를 규명할 수 있다.A monitoring method and a call relationship tracking method for extracting performance data from a Java application are disclosed. In the monitoring method according to the present invention, a class to be monitored by analyzing a Java virtual machine byte code instruction set of the loaded byte stream immediately before the Java class loader loads the class byte stream into memory on disk or network to generate a class And method can be identified, and additional information extraction code can be inserted into the monitored class method to collect class and method call information. In addition, it is possible to identify the calling relationship of all classes and methods executed by a specific thread by using the data structure of the Java thread and stack executing the class to be monitored and the linked list.

자바 바이트 코드, 데이터 모니터링, JVM, 자바 바이트 코드 인스트루먼테이션 Java Byte Code, Data Monitoring, JVM, Java Byte Code Instrumentation

Description

자바 바이트 코드의 데이터 모니터링 시 모니터링된 데이터의 호출관계 규명 방법 및 이 방법을 이용한 알고리즘을 통해 자바 어플리케이션의 각종 성능 데이터를 추출하기 위한 컴퓨터 판독 가능한 기록 매체{A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type}A method of data call stack tracing in data monitoring of extracting performance data of a Java application through a method of identifying the call relationship of the monitored data and the algorithm using the method when monitoring the data of Java byte code JAVA byte code and a device for storing the method in compter program type}

도 1은 본 발명에 따른 데이터 추출을 위한 모니터링 방법을 대략적으로 나타낸 흐름도이다.1 is a flowchart schematically illustrating a monitoring method for extracting data according to the present invention.

도 2는 성능 정보 추출 코드를 삽입하는 구체적인 단계를 나타낸 흐름도이다.2 is a flowchart illustrating specific steps of inserting a performance information extraction code.

도 3은 일반적인 웹 상에서 운영되는 어플리케이션의 클래스 구성도를 나타낸다.3 illustrates a class configuration diagram of an application running on a general web.

도 4는 도 3의 클래스 구성에 따른 어플리케이션 실행 순서를 나타낸 구성도이다.4 is a configuration diagram illustrating an application execution sequence according to the class configuration of FIG. 3.

도 5는 도 3의 어플리케이션을 실행하여 본 발명에 따라 성능 정보를 추출하여 모니터링한 결과를 예시적으로 나타낸다.5 exemplarily shows a result of extracting and monitoring performance information according to the present invention by executing the application of FIG. 3.

도 6은 본 발명에 따른 클래스 실행 과정을 나타낸 블록도이다.6 is a block diagram illustrating a class execution process according to the present invention.

도 7은 본 발명에 따른 데이터 모니터링 정보의 추적 방법을 나타낸 흐름도이다.7 is a flowchart illustrating a method of tracking data monitoring information according to the present invention.

도 8은 본 발명에 따른 트리 구조 형성 단계를 나타내는 흐름도이다.8 is a flowchart illustrating a tree structure forming step according to the present invention.

도 9는 도 3 및 도 4에 도시된 클래스 구성을 갖는 어플리케이션을 본 발명을 이용하여 호출 관계를 트리 구조로 나타낸 결과이다.FIG. 9 illustrates a call structure in a tree structure of an application having a class structure shown in FIGS. 3 and 4 using the present invention.

도 10은 본 발명의 호출 관계 추적 방법을 이용한 호출 관계를 디스플레이 하는 일 예를 나타낸다.10 illustrates an example of displaying a call relationship using the call relationship tracking method of the present invention.

본 발명은 자바 프로그래밍 방법에 관한 것으로, 구체적으로는 자바 바이트 코드 조작을 통해 필요한 데이터를 모니터링하는 방법에 관한 것이다. The present invention relates to a Java programming method, and more particularly, to a method for monitoring required data through Java byte code manipulation.

자바(JAVA)는 처음에는 가전 제품에서 운영된 소프트웨어 플랫폼을 개발하기 위해 만들어진 언어이다. 플랫폼에 독립적이고 네트웍을 통해 실행가능 코드를 다운로드하여 JVM이 실행할 수 있는 이점과 인터넷의 발전으로 인해, 1995년 썬 마이크로시스템즈(Sun Microsystems)에서 자바(Java) 언어와 핫자바(HotJava)를 발표하면서 세상에 나오기 시작했다. 핫자바(HotJava)는 자바 언어로 만든 웹브라우저를 말한다. 그리고 네스케이프(Netscape)와 라이센스 계약을 통해 Netscape 브라우저에서 자바가 시행됨으로써 전 세계로 자바가 확산되었다.JAVA was originally created to develop a software platform for consumer electronics. In 1995, Sun Microsystems announced the Java language and HotJava due to the platform-independent, JVM-enable download of executable code over the network, and the development of the Internet. It started to come to the world. HotJava is a web browser written in the Java language. And with Netscape, a license agreement made Java available to Netscape browsers, spreading Java worldwide.

한편, 안정적인 어플리케이션 운영을 위해 각 어플리케이션의 각종 모니터링 정보 예를 들어, 응답 속도에 대한 정보, 어플리케이션이 어느 정도 메모리를 차지 하고 있는 지에 대한 정보, 클래스 정보, 메소드 정보 및 각종 변수에 대한 정보를 파악할 필요가 있다. On the other hand, for stable application operation, it is necessary to grasp various monitoring information of each application, for example, information about response speed, how much memory the application occupies, class information, method information, and various variables. There is.

이 경우, 종래에는 자바 프로그래밍에서 클래스(Class) 및 메소드(Method)를 모니터링하기 위해서는 어플리케이션의 소스 코드에 모니터링을 위한 성능 정보 추출 코드를 삽입하는 방법을 사용하였다.In this case, in the related art, in order to monitor classes and methods in Java programming, a method of inserting performance information extraction code for monitoring is used in an application source code.

즉, 어플리케이션의 개발 단계에서부터 어플리케이션의 소스 코드에 성능 정보 추출 코드를 삽입하여 추출 코드가 삽입된 채로 컴파일을 한 후, 프로그램을 구동한다. 그리고 나서 프로그램을 구동하는 경우에는 성능 정보 추출 코드를 통해 필요한 정보를 모니터링하게 된다.That is, from the development stage of the application, the performance information extraction code is inserted into the application source code, compiled with the extraction code inserted, and the program is driven. Then, when running the program, the necessary information is monitored through the performance information extraction code.

예를 들어, 어플리케이션 소스 코드 내에 특정 클래스가 동작을 시작하는 CPU 시간과 상기 특정 클래스가 동작을 끝내는 CPU 시간을 추출하도록 하는 타이밍 정보 추출 코드를 통해, 상기 특정 클래스가 실행되는 시간을 측정할 수 있다.For example, the timing information extraction code for extracting the CPU time at which a specific class starts operation and the CPU time at which the specific class ends operation can be measured in the application source code. .

이와 같은 경우, 불필요한 소스 코드의 추가로 인해 어플리케이션의 크기가 늘어나게 되는 문제가 있다. 또한, 모니터링 대상이 되는 클래스(Class) 및 메소드(Method)는 동적으로 관리가 되어야 하나, 어플리케이션의 소스 코드를 수정하게 되면 매번 모니터링 정보를 수집하는 코드를 추가/삭제하게 재컴파일을 해야하는 반복적이고 소모적인 작업들이 필요하게 된다.In this case, there is a problem that the size of the application increases due to the addition of unnecessary source code. In addition, the classes and methods to be monitored should be managed dynamically, but if you modify the source code of the application, you need to recompile to add / delete the code that collects monitoring information every time. Work is required.

본 발명이 이루고자 하는 기술적 과제는, 모니터링 정보를 얻기 위해 소소 코드를 어플리케이션 개발 단계에서 삽입하지 않고도 용이하게 정보를 추출할 수 있는 방법을 제공하는 것이다.An object of the present invention is to provide a method for easily extracting information without inserting source code at application development stage to obtain monitoring information.

본 발명이 이루고자 하는 다른 기술적 과제는 어플리케이션의 소스 코드를 매번 수정하여 재컴파일하는 소모적인 작업 없이도 모니터링 정보를 추출하는 방법을 제공하는 것이다.Another technical problem to be achieved by the present invention is to provide a method of extracting monitoring information without the need for re-compiling by modifying the source code of the application every time.

본 발명이 이루고자 하는 다른 기술적 과제는 모니터링된 자바 클래스 및 메소드의 호출관계를 규명하는 방법을 제공하는 것이다. Another technical problem to be achieved by the present invention is to provide a method for identifying the invocation relationship of monitored Java classes and methods.

상술한 바와 같은 본 발명의 목적을 달성하기 위해, 본 발명의 특징에 의하면, 자바 바이트 코드 조작을 통해 성능 데이터를 추출하기 위한 모니터링 방법은, 어플리케이션 실행 명령이 인가되는 단계, 자바 버추얼 머신이 클래스 바이트 스트림을 로드하는 단계, 로딩된 바이트 스트림 판독 및 모니터링 바이트 코드를 삽입하여 변조하는 단계, 상기 모니터링 코드가 삽입된 변조 바이트 코드에 해당하는 클래스 생성 단계, 및 모니터링 대상 정보를 추출하는 단계를 포함한다.In order to achieve the object of the present invention as described above, in accordance with a feature of the present invention, the monitoring method for extracting the performance data through the operation of Java byte code, the step of applying an application execution command, the Java virtual machine is a class byte Loading the stream, reading the loaded byte stream and inserting and modulating the monitoring byte code, generating a class corresponding to the modulation byte code into which the monitoring code is inserted, and extracting monitoring target information.

성능 데이터는 응답 시간, 클래스 정보, 메소드 정보, 및 각종 파라미터 정보를 포함하며, 모니터링 대상은 환경 파일로 지정되어 동적으로 변경이 가능하다.The performance data includes response time, class information, method information, and various parameter information. The monitoring target is designated as an environment file and can be changed dynamically.

바람직하게는, 상기 모니터링 코드 삽입 단계는 모니터링 대상 메소드의 시작 부분과 끝 부분에 시작과 끝 메소드를 삽입하는 단계를 포함한다. 상기 모니터링 코드 삽입 단계는, 파라미터가 있는 경우 상기 모니터링 코드는 상기 파라미터 를 수집하도록 자동코딩된다.Preferably, the monitoring code insertion step includes inserting a start and end method at the beginning and end of the method to be monitored. The monitoring code insertion step, if there is a parameter, the monitoring code is automatically coded to collect the parameter.

더욱 바람직하게는, 모니터링 코드 삽입 단계는, 자바 클래스 파일의 포맷을 분석하는 단계, 모니터링 대상이 되는 메소드의 바이트 코드 인스트럭션 셋(byte code instruction set)을 변경하는 단계, 및 성능 정보 추출 코드를 삽입하는 단계를 포함한다. 이때, 성능 정보 추출 코드 삽입 단계는, 자바 바이트 코드 인스트루먼테이션을 통해 삽입될 수 있다.More preferably, the step of inserting monitoring code includes analyzing a format of a Java class file, changing a byte code instruction set of a method to be monitored, and inserting performance information extraction code. Steps. In this case, the performance information extraction code insertion step may be inserted through Java byte code instrumentation.

본 발명의 다른 특징에 의하면, 자바 바이트 인스투르먼테이션(Java byte instrumentation)을 통해 모니터링된 클래스 및 메소드의 호출 관계를 규명하는 방법은, 모니터링 대상이 되는 클래스를 실행한 자바 바이트의 스레드(thread) 별로 스택을 생성하는 단계, 시작 메소드 호출 시 모니터링된 데이터를 상기 스택에 푸시(Push)하는 단계, 끝 메소드 호출 시 모니터링된 데이터를 상기 스택에서 팝(Pop)하는 단계, 및 각 실행되는 클래스 및 메소드의 링크 구조를 이용하여 호출 관계를 추적하는 단계를 포함한다.According to another aspect of the present invention, a method for identifying a monitored class and method call relationship through Java byte instrumentation includes a thread of a Java byte executing a class to be monitored. Creating a stack for each step, pushing the monitored data on the stack when the start method is called, popping the monitored data on the stack when the end method is called, and each executing class and method Tracking the call relationship using the link structure of the.

호출 관계 추적 단계는, 상기 스택에서 푸시 및 팝되는 데이터에 대응되는 클래스 및 메소드의 순서에 기초하여 상기 모니터링된 데이터를 트리 구조로 형성하는 단계를 더 포함한다.The call relationship tracking step further includes forming the monitored data in a tree structure based on the order of classes and methods corresponding to data pushed and popped in the stack.

바람직하게는, 상기 트리 구조 형성 단계는, 상기 스택으로 데이터를 푸시하는 경우에, 현재 메소드에 대응하는 트리 아래에 새롭게 호출된 메소드에 대응하는 하위 트리를 형성하는 단계, 상기 생성된 하위 트리에 모니터링된 데이터를 매핑하는 단계, 및 상기 스택으로 데이터를 팝하는 경우에, 현재 호출된 메소드에 대응하 는 트리의 상위 트리로 이동하는 단계를 포함할 수 있다.Preferably, the tree structure forming step includes: when pushing data to the stack, forming a subtree corresponding to a newly called method under a tree corresponding to a current method; monitoring the generated subtree Mapping the generated data, and when popping the data onto the stack, moving to a higher tree of the tree corresponding to the currently called method.

본 발명과 본 발명의 동작성의 이점 및 본 발명의 실시에 의하여 달성되는 목적을 충분히 이해하기 위해서는 본 발명의 바람직한 실시예를 예시하는 첨부 도면 및 첨부 도면에 기재된 내용을 참조하여야만 한다.In order to fully understand the present invention, the advantages of the operability of the present invention, and the objects achieved by the practice of the present invention, reference should be made to the accompanying drawings which illustrate preferred embodiments of the present invention and the contents described in the accompanying drawings.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 설명함으로써, 본 발명을 상세히 설명한다. 각 도면에 제시된 동일한 참조부호는 동일한 부재를 나타낸다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Like reference numerals in the drawings denote like elements.

도 1은 본 발명에 따른 데이터 추출을 위한 모니터링 방법을 대략적으로 나타낸 흐름도이다.1 is a flowchart schematically illustrating a monitoring method for extracting data according to the present invention.

도 1을 참조하면, 본 발명에 따른 데이터 추출을 위한 모니터링 방법은, 우선, 어플리케이션 실행 명령이 인가되어 어플리케이션을 실행하면(S100), 자바 버추얼 머신(JAVA Virtual Machine)의 클래스 로더가 바이트 스트림을 메모리에 적재한다(S200). 자바 버추얼 머신(JAVA Virtual Machine; JVM)은 자바로 작성된 프로그램이 어떤 환경에서든지 작동할 수 있도록 해주는 기능을 한다. 이때 자바 버추얼 머신에 의해 판독되는 어플리케이션 소스 코드에는 성능 정보 추출을 위한 코드는 삽입되지 않는 상태의 오리지널 어플리케이션 소스 코드만이 존재한다.Referring to FIG. 1, in the monitoring method for extracting data according to the present invention, first, when an application execution command is applied to execute an application (S100), a class loader of a Java virtual machine stores a byte stream. Load on (S200). The Java Virtual Machine (JVM) is a feature that allows programs written in Java to run in any environment. At this time, only the original application source code without the code for extracting the performance information exists in the application source code read by the Java virtual machine.

그런 다음, 자바 버추얼 머신은 모니터링 대상 클래스 및 메소드를 식별하고 성능 정보 추출 바이트 코드를 판독된 어플리케이션 소스 코드에 삽입한다(S300). 그리고, 자바 버추얼 머신이 변경된 바이트 코드를 가지고 클래스를 생성하고 (S400), 어플리케이션을 재실행한다(S500). 그리고, 실행되는 어플리케이션을 통해 필요한 성능 정보가 추출될 수 있다(S600).Then, the Java virtual machine identifies the monitored class and method and inserts the performance information extraction byte code into the read application source code (S300). Then, the Java virtual machine generates a class with the changed byte code (S400) and re-executes the application (S500). Then, necessary performance information may be extracted through the executed application (S600).

도 2는 성능 정보 추출 바이트 코드를 삽입하는 구체적인 단계를 나타낸 흐름도이다.2 is a flowchart illustrating specific steps of inserting the performance information extraction byte code.

도 2를 참조하면, 성능 정보 추출 바이트 코드 삽입 단계(S300)는, 우선 자바 클래스 파일의 포맷을 분석하고(S301), 모니터링 대상이 되는 메소드의 바이트 코드 인스트럭션 셋(byte code instruction set)을 변경한다(S302). 그리고, 성능 정보 추출 코드를 어플리케이션 소스 코드 내의 필요한 위치에 삽입한다(S303).Referring to FIG. 2, the performance information extraction byte code insertion step (S300) first analyzes a format of a Java class file (S301) and changes a byte code instruction set of a method to be monitored. (S302). Then, the performance information extraction code is inserted at a required position in the application source code (S303).

이때, 상기 성능 정보 추출 코드를 삽입하는 단계는 자바 바이트 코드 인스트루먼테이션(Java Byte Code Instrumentation)이라 불리는 바이트 코드 분석 및 조작기술을 통해 삽입한다.In this case, the step of inserting the performance information extraction code is inserted through a byte code analysis and manipulation technique called Java Byte Code Instrumentation.

자바 바이트 코드 인스트루먼테이션은 기존 어플리케이션 소스 코드의 수정 없이 자바 어플리케이션의 런타임(Runtime) 시에 모니터링 대상이 되는 클래스 및 메소드를 선별하여 모니터링 관련된 바이트 코드 인스트럭션(Byte Code Instruction)을 추가하는 일련의 코드 분석 및 조작기술이다.Java byte code instrumentation analyzes a series of codes that selects classes and methods to be monitored at runtime of Java application and adds monitoring related byte code instructions without modifying existing application source code. And operation technology.

다수의 클래스로 구성된 자바 어플리케이션이 실행되기 위해서는 커스텀 클래스 로더(Custom Class Loader) 및 JDK(Java Development Kit)의 내부 클래스 로더가 디스크 혹은 네트워크를 통해 해당 클래스를 구성하는 바이트 코드 인스트럭션 셋들로 구성된 바이트 스트림을 메모리에 로드한 후, 자바 버추얼 버신(Java Virtual Machine)이 제공하는 네이티브 메소드(Native Method) 즉, defineClass0() 호출을 통해 어플리케이션에서 사용할 수 있는 클래스를 생성하는 과정을 반드시 거치게 된다.In order to run a Java application consisting of multiple classes, the custom class loader and the internal class loader of the Java Development Kit (JDK) create a byte stream consisting of the set of byte code instructions that make up the class over disk or over the network. After loading into memory, it is necessary to create a class that can be used in an application through a native method provided by the Java Virtual Machine, that is, defineClass0 () call.

이 과정에서 네이티브 메소드 호출로 클래스를 생성하기 직전, 로딩된 바이트 스트림의 자바 버추얼 머신 바이트 코드 인스트럭션 셋 분석을 통해 모니터링 대상이 되는 클래스 및 메소드를 식별할 수 있다. 또한, 성능 및 실행정보를 위한 바이트 코드 인스트럭션 셋을 동적으로 해당 클래스 및 메소드 내 즉, 메소드의 시작 및 종료 시점에 추가할 수 있다.In the process, just before creating a class with a native method call, you can identify the classes and methods being monitored by analyzing the Java virtual machine bytecode instruction set of the loaded byte stream. In addition, a set of byte code instructions for performance and execution information can be added dynamically within the class and method, that is, at the start and end of the method.

예를 들어, 다음과 같은 원본 소스 코드가 존재하는 경우,For example, if the following source code exists:

public void monitorMethod()public void monitorMethod ()

{{

system.out.println("monitorMethod() called..");system.out.println ("monitorMethod () called ..");

}}

성능 데이터를 추출하기 위해 소소 코드 레벨에서 성능 정보 추출 코드를 추가하지 않고, 어플리케이션 실행 시 동적으로 성능 수집 코드를 삽입한다. 즉, 자바 버추얼 머신이 로딩된 바이트 스트림으로 클래스를 생성하기 전에 성능 정보 추출 코드를 동적으로 삽입한다.Instead of adding performance information extraction code at the source code level to extract performance data, the performance collection code is inserted dynamically when the application is executed. That is, the Java virtual machine dynamically inserts the performance information extraction code before generating a class from the loaded byte stream.

성능 정보 추출 코드가 삽입되면, 소소 코드는When the performance information extraction code is inserted, the source code

public void monitorMethod()public void monitorMethod ()

{{

J2EECallStackTracer.startGenMethod(this,"monitorMehtod");J2EECallStackTracer.startGenMethod (this, "monitorMehtod");

system.out.println("monitorMethod() called..");system.out.println ("monitorMethod () called ..");

J2EECallStackTracer.endGenMethod(this,"monitorMethod");J2EECallStackTracer.endGenMethod (this, "monitorMethod");

}}

가 된다. Becomes

위와 같이, 모니터링 대상 메소드의 시작 부분과 끝 부분에 start Method(즉, PerColllector.startGenMethod) 와 end Method (즉, PerCollector.endGenMethod) 가 삽입된다.As above, the start method (ie PerColllector.startGenMethod) and the end method (ie PerCollector.endGenMethod) are inserted at the beginning and end of the monitored method.

또한, 성능 정보에는 메소드의 아규먼트(argument)로 넘어가는 파라미터(Parameter)가 있을 경우 경우에 따라 파라미터도 성능수집 정보에 포함시킬 수 있다.In addition, the performance information may include the parameter in the performance collection information in some cases when there is a parameter that passes to the argument of the method.

예를 들어, 다음과 같은 원본 소스 코드가 존재하는 경우,For example, if the following source code exists:

public void monitorMethod(Object param1)public void monitorMethod (Object param1)

{{

system.out.println("captureMethod() called..");system.out.println ("captureMethod () called ..");

}}

자바 버추얼 머신이 파라미터 정보를 포함하는 성능 정보 추출 코드를 삽입하면, 소소 코드는When the Java virtual machine inserts performance information extraction code that includes parameter information, the source code

public void monitorMethod(Object param)public void monitorMethod (Object param)

{{

J2EECallStackTracer.startGenMethod(this,"monitorMehtod", parameter);J2EECallStackTracer.startGenMethod (this, "monitorMehtod", parameter);

system.out.println("captureMethod() called..");system.out.println ("captureMethod () called ..");

J2EECallStackTracer.endGenMethod(this,"monitorMethod", parameter);J2EECallStackTracer.endGenMethod (this, "monitorMethod", parameter);

}}

가 된다. Becomes

도 3은 일반적인 웹 상에서 운영되는 어플리케이션의 클래스 구성도를 나타낸다.3 illustrates a class configuration diagram of an application running on a general web.

도 3의 어플리케이션 클래스 구성도는 WAS 의 스레드 풀(Thread Pool) 내의 개별 스레드(Thread)가 특정 URL의 요청(request)를 받아서 다양한 자바 클래스를 수행하고 최종적으로 JDBC를 통해 데이터베이스에서 데이터를 질의한 후 결과를 클라이언트에게 보내주는 웹 어플리케이션(Web application)을 클래스 구성도로 나타낸 것이다.The application class diagram of FIG. 3 shows that individual threads in a thread pool of a WAS receive a request of a specific URL, execute various Java classes, and finally query data from a database through JDBC. The class diagram shows a Web application that sends results back to the client.

도 3을 참조하면, 어플리케이션은 메인서블렛(MainServlet; 301)이 세션파사드 클래스(SessionFacad; 302)를 호출하고, 세션파사드클래스는 비즈니스 오브젝트(BusinessObject; 303), 비즈니스 엔티티(BusinessEntity; 304), 데이터 억세스 오브젝트(DataAccessObject; 305), 및 비즈니스 세션(BusinessSession; 306)을 호출한다. 데이터 억세스 오브젝트(305)는 JDBC(Java Database Connectivity) 클래스(307) 호출을 통해 DBMS 관련 작업을 수행한다.Referring to FIG. 3, the application may include a mainservlet 301 calling a session facade class 302, and the session facade class may include a business object 303, a business entity 304, and data access. Object (DataAccessObject) 305, and business session (BusinessSession) 306. The data access object 305 performs DBMS related tasks through a Java Database Connectivity (JDBC) class 307 call.

도 4는 도 3의 클래스 구성에 따른 어플리케이션 실행 순서를 나타낸 구성도 이다.4 is a configuration diagram illustrating an application execution sequence according to the class configuration of FIG. 3.

도 4를 참조하면, 특정 URL을 받은 후 WAS 내의 스레드(thread)가 메인서블렛(301)을 실행하고, 메인서블렛(301)은 세션파사드(302)를 실행하고, 세션파사드(302)는 비즈니스 엔티티(304)를 실행한다. 이러한 순서로, 비즈니스 엔티티(304)로의 제1 억세스(401)가 종료된다.Referring to FIG. 4, after receiving a specific URL, a thread in the WAS executes the main servlet 301, the main servlet 301 executes the session facade 302, and the session facade 302 is a business entity. 304 is executed. In this order, first access 401 to business entity 304 is terminated.

또한, 메인서블렛(301)은 세션파사드(302)를 실행하고, 세션파사드(302)는 비즈니스 세션(306)을 실행하고, 비즈니스 세션(306)은 비즈니스 엔티티(304)를 다시 실행한다. 이러한 순서로, 비즈니스 세션(306)으로의 제2 억세스(402)가 종료된다.In addition, the main servlet 301 executes the session facade 302, the session facade 302 executes the business session 306, and the business session 306 executes the business entity 304 again. In this order, the second access 402 to the business session 306 ends.

또한, 메인서블렛(301)은 세션 파사드(302)를 실행하고, 세션파사드(302)는 데이터 억세스 오브젝트(305)를 실행하고, 데이터 억세스 오브젝트(305)는 JDBC(307)를 실행한다. 이러한 순서로, 데이터 억세스 오브젝트(305)로의 제3 억세스(403)가 종료된다. 그리고, 메인서블렛(301)은 이러한 순서대로 각 클래스를 실행한 결과를 클라이언트(즉, 웹 브라우저)로 전송한다.In addition, the main servlet 301 executes the session facade 302, the session facade 302 executes the data access object 305, and the data access object 305 executes the JDBC 307. In this order, the third access 403 to the data access object 305 is terminated. The main servlet 301 transmits the results of executing each class in this order to the client (ie, a web browser).

도 3의 어플리케이션의 개략적인 소스 코드는 다음과 같이 표현될 수 있다.The schematic source code of the application of FIG. 3 may be expressed as follows.

(기존 소스 - MainServlet)(Existing Source-MainServlet)

public void doPost(HttpRequest req, HtpResponse resp)public void doPost (HttpRequest req, HtpResponse resp)

{{

..........

SessionFacad sesseionFacad = new SessionFacad()SessionFacad sesseionFacad = new SessionFacad ()

ret1 = sessionFacad.getEntity1();ret1 = sessionFacad.getEntity1 ();

ret2 = sessionFacad.getBusinessSession();ret2 = sessionFacad.getBusinessSession ();

ret3 = sessionFacad.seletMain();ret3 = sessionFacad.seletMain ();

..........

}}

그리고, 본 발명에 따라 자바 버추얼 머신이 원본 소스 코드를 판독한 뒤 메모리에 로딩하기 전 모니터링 코드가 삽입된 모습은 다음과 같다.In addition, according to the present invention, the Java virtual machine reads the original source code and then the monitoring code is inserted before loading into the memory as follows.

public void doPost(HttpRequest req, HtpResponse resp)public void doPost (HttpRequest req, HtpResponse resp)

{{

J2EECallStackTracer.beginServlet(this,"doPost", req);J2EECallStackTracer.beginServlet (this, "doPost", req);

..........

SessionFacad sessionFacad = new SessionFacad()SessionFacad sessionFacad = new SessionFacad ()

ret1 = sessionFacad.getEntity1()ret1 = sessionFacad.getEntity1 ()

ret2 = sessionFacad.getBusinessSession();ret2 = sessionFacad.getBusinessSession ();

ret3 = sessionFacad.selectMain();ret3 = sessionFacad.selectMain ();

..........

J2EECallStackTracer.endServlet(this, "doPost", req);J2EECallStackTracer.endServlet (this, "doPost", req);

}}

즉, 모니터링 대상 메소드의 시작과 종료 시점에 성능 데이터 수집에 관련된 method(위 예에서는, begin, end)를 추가하여 beginServlet()으로부터 endServlet() 까지의 응답시간 및 CPU 시간을 측정할 수 있다.That is, the response time and the CPU time from beginServlet () to endServlet () can be measured by adding methods related to performance data collection (start and end in the above example) at the start and end of the method to be monitored.

도 5는 도 3의 어플리케이션을 실행하여 본 발명에 따라 성능 정보를 추출하여 모니터링한 결과를 예시적으로 나타낸다.5 exemplarily shows a result of extracting and monitoring performance information according to the present invention by executing the application of FIG. 3.

도 5를 참조하면, 서블렛(SERVLET) 카테고리의 메인서블렛(MainServlet; 501)이 전체 2000ms 동안 수행된다. 이는 메인 서블렛(MainServlet) 아래의 세션파사드(SessionFacad)라는 세 개의 EJB(Enterprise JavaBeans) 카테고리(502, 503 및 504)가 수행되는 시간의 합이 된다. 도 5의 예에서는, SessionFacad의 EJB의 getEntity1(), getBusinessSession()을 호출하는 데 각각 500ms 가 걸리고, SessionFacad의 selectMain()이 1000ms 동안 수행됨을 쉽게 파악할 수 있게 된다.Referring to FIG. 5, the MainServlet 501 of the Servlet category is performed for a total of 2000 ms. This is the sum of the times when three Enterprise JavaBeans (EJB) categories 502, 503, and 504, called SessionFacad, under the MainServlet. In the example of FIG. 5, it is easy to understand that it takes 500ms to call getEntity1 () and getBusinessSession () of EJB of SessionFacad, and selectMain () of SessionFacad is performed for 1000ms.

한편, 상술한 바와 같이, 모니터링 대상은 응답 시간뿐만 아니라, 각종 파라미터, 클래스 정보, 메소드 정보가 될 수도 있다. 이러한 모니터링 대상은 환경 파일로 저장될 수 있다.On the other hand, as described above, the monitoring target may be not only response time but also various parameters, class information, and method information. These monitoring targets may be stored in an environment file.

이때, 모니터링 코드를 통한 클래스 및 메소드의 호출 시, 모니터링 대상 클래스 정보는 자바의 클래스 자체를 가리키는 키워드를 통해 호출하고, 수집하는 클래스에서는 넘겨받은 클래스 정보를 통해 대상 클래스 명을 추출할 수 있다. 그리고, 모니터링 대상 메소드 이름은 자바 클래스 파일의 Methods, Constant Pool 영역을 분석함으로써 추출할 수 있다. 또한, 모니터링 대상 메소드의 파라미터(parameter)는 추가된 바이트 코드 인스트럭션 셋(byte code instruction set)을 통해 파라미터를 추출할 수 있다. 그리고, 모니터링 대상 클래스의 메소드를 실행한 스레드(Thread) 정보는 JDK(Java Development Kit) 의 API(Application Program Interface)를 통해 추출가능하다. At this time, when invoking classes and methods through the monitoring code, the monitoring target class information is called through a keyword indicating a class of Java itself, and in the collecting class, the target class name can be extracted through the received class information. The method name to be monitored can be extracted by analyzing the method and constant pool area of the Java class file. In addition, the parameter of the monitored method may extract the parameter through the added byte code instruction set. Thread information that executes the method of the monitored class can be extracted through the API (Application Program Interface) of the JDK (Java Development Kit).

예를 들어 성능 정보를 수집하는 클래스에서는 현재 시간을 추출하는 메소드와 CPU 타임을 측정하는 JDK API 호출을 통해서 모니터링 대상 메소드의 시작과 종료 시점의 차이를 통해 응답 시간과 CPU 시간을 측정할 수 있게 된다.For example, in a class that collects performance information, the response time and CPU time can be measured by the difference between the start time and the end time of the monitored method through the method of extracting the current time and the JDK API call that measures CPU time. .

도 6은 본 발명에 따른 클래스 실행 과정을 나타낸 블록도이다.6 is a block diagram illustrating a class execution process according to the present invention.

도 6을 참조하면, 본 발명에 따른 클래스 실행 과정은, 먼저 자바 프로그램을 최초로 구동하게 하는 자바 스레드(601)가 실행된다. 그리고, 나서 모니터링 코드가 삽입된 자바 클래스, 즉 바이트 코드 인스투르먼테이션 된 자바 클래스(602)가 실행된다.Referring to FIG. 6, in the class execution process according to the present invention, a Java thread 601 for first running a Java program is executed. Then, the Java class into which the monitoring code is inserted, that is, the byte code instrumented Java class 602, is executed.

그러면, 본 발명에 따른 호출 정보 추적부(603)를 통해, 호출된 데이터의 상호 호출 관계를 판단한다. 이때, 본 발명에 따르면, 호출 정보 추적부(603)는 호출된 메소드 스택(stack)을 구성하고 데이터 호출 순서를 추적하는 메소드 스택 구성부(604)와 클래스 및 메소드 트리를 구성하는 클래스 및 메소드 트리 구성부(605)를 포함한다.Then, the call information tracking unit 603 according to the present invention determines the mutual call relationship of the called data. At this time, according to the present invention, the call information tracking unit 603 configures the method stack (stack) and the class and method tree constituting the method stack configuration unit 604 and the class and method tree to track the data call order A component 605 is included.

메소드 스택 구성부(604)는 자바 바이트의 스레드별로 스택을 구성하여, 시작 메소드 호출 시 모니터링된 데이터를 스택에 입력(즉, 푸시; push)하고, 끝 메소드 호출 시 모니터링된 데이터를 스택에서 출력(즉, 팝; pop)하는 기능을 한다. 메소드 스택 구성부(604)에서의 데이터 호출 순서 및 메소드 및 클래스 트리 구성부(605)에서의 트리 구조는 디스플레이부(606)에서 사용자에게 디스플레이 될 수 있다.The method stack configuration unit 604 constructs a stack for each thread of Java bytes, inputting (ie, pushing) the monitored data when the start method is called, and outputting the monitored data from the stack when the end method is called. That is, it functions to pop. The data call order in the method stack constructing unit 604 and the tree structure in the method and class tree constructing unit 605 may be displayed to the user in the display unit 606.

도 7은 본 발명에 따른 데이터 모니터링 정보의 추적 방법을 나타낸 흐름도이다.7 is a flowchart illustrating a method of tracking data monitoring information according to the present invention.

도 7을 참조하면, 본 발명에 따른 모니터링 정보 추적 방법은, 먼저 모니터링 코드가 삽입된 자바 클래스가 실행되면(S701), 자바 바이트의 스레드(thread) 별로 스택을 생성한다(S702). 그리고, 모니터링 코드에 의해 시작 메소드가 호출 되면 모니터링된 데이터를 생성된 스택에 푸시(push)한다(S703). 또한, 모니터링 코드에 의해 끝 메소드가 호출되면 대응되는 메소드의 모니터링된 데이터를 스택에서 팝(pop)한다(S704). 그리고 나서 상기 스택에 푸시 되거나 팝 되는 데이터를 그 순서에 따라 정리하여 호출 관계를 트리 구조로 형성한다(S705). 그런 다음, 트리 구조와 트리 구조에 대응되는 모니터링 정보를 사용자에게 디스플레이 한다(S706).Referring to FIG. 7, the monitoring information tracking method according to the present invention first generates a stack for each thread of Java bytes when a Java class into which monitoring code is inserted is executed (S701). When the start method is called by the monitoring code, the monitored data is pushed to the generated stack (S703). In addition, when the end method is called by the monitoring code, the monitored data of the corresponding method is popped from the stack (S704). Then, the data pushed or popped on the stack is sorted according to the order to form a call relationship in a tree structure (S705). Then, the tree structure and the monitoring information corresponding to the tree structure are displayed to the user (S706).

스택 구조는 FILO(First In Last Out)의 구조를 갖는다. 즉, 맨 처음 입력된 데이터는 맨 마지막에 출력되고, 맨 마지막에 입력된 데이터부터 출력되는 구조를 갖는다. 호출된 데이터를 이와 같은 스택 구조로 저장하고 이를 트리 구조로 생성하면 모든 클래스 및 메소드의 호출 관계를 추적할 수 있다. The stack structure has a structure of FILO (First In Last Out). That is, the first input data is output at the end, and has the structure output from the last input data. By storing the called data in a stack structure like this and creating it as a tree structure, you can track the invocation relationships of all classes and methods.

도 8은 본 발명에 따른 트리 구조 형성 단계를 나타내는 흐름도이다.8 is a flowchart illustrating a tree structure forming step according to the present invention.

도 8을 참조하면, 트리 구조 형성 단계는, 모니터링 코드가 삽입된 자바 클래스가 실행되어 데이터를 호출하면(S801), 시작 메소드 호출에 의해 스택에서 데이터를 푸시 하는 경우, 현재 메소드에 대응하는 트리 아래에 새롭게 호출된 메소드에 대응하는 하위 트리를 형성하고(S802), 생성된 하위 트리에 모니터링된 데이 터를 매핑한다(S804). 그리고, 끝 메소드 호출에 의해 스택에서 데이터를 팝하는 경우, 현재 호출된 메소드에 대응하는 트리의 상위 트리로 이동한다(S803). 그리고, 다시 다음 호출된 메소드의 데이터를 호출하는 것을 반복하여 트리 구조를 완성한다.Referring to FIG. 8, in the tree structure forming step, when a Java class in which monitoring code is inserted is executed to call data (S801), when pushing data from the stack by a start method call, the tree corresponding to the current method is below the tree corresponding to the current method. A subtree corresponding to the newly called method is formed at step S802, and the monitored data is mapped to the generated subtree at step S804. If data is popped from the stack by the end method call, the controller moves to the upper tree of the tree corresponding to the currently called method (S803). Then, we repeat the call to the data of the next called method to complete the tree structure.

이러한 트리 구조는, 모니터링 대상이 되는 클래스를 실행한 자바 스레드 및 스택, 링크된 리스트의 자료구조가 되며, 이를 이용하여 특정 스레드가 수행한 모든 클래스 및 메소드의 호출 관계를 규명할 수 있다..This tree structure becomes the data structure of the Java thread and stack executing the monitored class and the linked list, and can be used to identify the invocation relations of all classes and methods executed by a specific thread.

도 9는 도 3 및 도 4에 도시된 클래스 구성을 갖는 어플리케이션을 본 발명을 이용하여 호출 관계를 트리 구조로 나타낸 결과이다.FIG. 9 illustrates a call structure in a tree structure of an application having a class structure shown in FIGS. 3 and 4 using the present invention.

이하, 도 3, 도 4 및 9를 참조하여, 본 발명에 따른 모니터링 정보의 호출 관계 추적 방법 및 이를 이용한 트리 형성 과정을 구체적으로 설명한다.3, 4 and 9, a call relationship tracking method of monitoring information and a tree forming process using the same according to the present invention will be described in detail.

자바의 콜 스레드가 실행되면, 도 4의 제1 억세스 단계(401)에 나타낸 바와 같이, MainServlet 클래스(301)를 호출하여 MainServlet(301)에서 모니터링된 데이터를 스택에 입력한다(S901). 그리고, MainServlet(301)은 SessionFacad 클래스(302)를 호출한다(S902). 그러면, SessionFacad(302)에서 모니터링된 데이터가 스택에 입력된다. 그리고, SessionFacad(302)는 BusinessEntity(304)를 호출하고(S903), BusinessEntity(304)에서 모니터링된 데이터가 스택에 입력된다. 그런 다음, 끝 메소드 호출에 의해 BusinessEntity(304)에서 모니터링된 데이터를 스택에서 출력하고, 그런 다음 SessinFacad(302)에서 모니터링된 데이터를 스택에서 출력한다. When the Java call thread is executed, as shown in the first access step 401 of FIG. 4, the MainServlet class 301 is called to input data monitored by the MainServlet 301 to the stack (S901). The MainServlet 301 calls the SessionFacad class 302 (S902). The data monitored by SessionFacad 302 is then entered into the stack. SessionFacad 302 then calls BusinessEntity 304 (S903), and the data monitored by BusinessEntity 304 is input to the stack. Then, the monitored data is output from the stack by the business method 304 by the end method call, and then the monitored data is output from the stack by SessinFacad 302.

그런 다음, 도 4의 제2 억세스 단계(402)에 나타낸 바와 같이, 다시 MainServelt(301)은 SessionFacad(302)를 다시 호출하고(S904), SessionFacad(302)에서 모니터링된 다른 데이터가 스택에 입력된다. 그리고, SessionFacad(302)는 BusinessEntity(304)를 다시 호출한다(S905). 그리고, BusinessEntity(304)에서 모니터링된 데이터가 스택에 입력된다. 그런 다음, 각 클래스의 실행이 종료되면, BusinessEntity(304), SessionFacad(302)의 순으로 스택에서 데이터가 출력된다.Then, as shown in the second access step 402 of FIG. 4, the MainServelt 301 again calls the SessionFacad 302 again (S904), and other data monitored by the SessionFacad 302 is entered into the stack. . Then, SessionFacad 302 calls BusinessEntity 304 again (S905). Then, the data monitored by BusinessEntity 304 is entered into the stack. Then, when execution of each class is finished, data is output from the stack in the order of BusinessEntity 304 and SessionFacad 302.

그리고, 도 4의 제3 억세스 단계(403)에 나타낸 바와 같이, 다시 MainServlet(301)은 SessionFacad(302)를 다시 호출하고(S906), SessionFacad(302)에서 모니터링된 또 다른 데이터가 스택에 입력된다. 그리고, SessionFacad(302)는 BusinessDAO(DataAccessObject)(305)를 호출한다 (S907). 그러면, BusinessDAO(305)에서 모니터링된 데이터가 스택에 입력된다. BusinessDAO(305)는 JDBC(307)를 호출하고, JDBC(307)에서 모니터링 된 데이터가 스택에 입력된다(S908). 그리고, JDBC(307)의 실행이 완료되면, JDBC(307), BusinessDAO(305) 및 SessionFacad(302)의 순으로 스택에서 데이터가 출력된다.As shown in the third access step 403 of FIG. 4, the MainServlet 301 again calls the SessionFacad 302 again (S906), and another data monitored by the SessionFacad 302 is input to the stack. . SessionFacad 302 then calls BusinessDAO (DataAccessObject) 305 (S907). The data monitored by BusinessDAO 305 is then entered into the stack. The BusinessDAO 305 calls the JDBC 307, and the data monitored by the JDBC 307 is input to the stack (S908). When execution of the JDBC 307 is completed, data is output from the stack in the order of the JDBC 307, the BusinessDAO 305, and the SessionFacad 302.

이와 같은 과정을 끝내면 도 9에 도시된 트리 구조가 완성될 수 있다.After this process, the tree structure shown in FIG. 9 may be completed.

도 10은 본 발명의 호출 관계 추적 방법을 이용한 호출 관계를 디스플레이하는 일 예를 나타낸다.10 shows an example of displaying a call relationship using the call relationship tracking method of the present invention.

도 10을 참조하면, 넘버(No.) 2번의 Servlet 카테고리를 보면 모두 597ms의 시간이 걸리는 것을 볼 수 있다. Servlet의 하위 클래스 중에서는 5번에 표시된 Servlet 카테고리가 589ms 로 그 중에서 가장 많은 시간을 차지하고 있으며, 이 중 에서도 7번의 Servlet 카테고리가 528ms를 차지하여 가장 많은 시간을 소비하고 있다.Referring to FIG. 10, looking at the No. 2 Servlet category, it can be seen that all takes 597 ms. Among the subclasses of Servlet, the Servlet category shown in 5 is 589ms, which takes up the most time. Among them, the 7th Servlet category occupies 528ms, which consumes the most time.

이런 식으로 본 발명에 따른 호출 관계 추적 방법을 이용한 호출 관계 및 응답 시간 등의 모니터링 데이터를 통해 성능저하의 주 원인이 되는 어플리케이션 및 병목 구간을 쉽게 찾아 낼 수 있다. 이러한 성능저하의 원인을 찾을 수 있으면, 용이하게 이에 대한 대응방안도 찾을 수 있고 이에 따라 전산 시스템의 안정적이 운영과 기업 이미지 향상에도 크게 기여 할 수 있을 것이다.In this way, it is possible to easily find the applications and bottlenecks that are the main causes of performance degradation through monitoring data such as call relations and response times using the call relation tracking method according to the present invention. If the cause of such deterioration can be found, the countermeasures can be easily found, which will contribute to the stable operation of the computer system and the improvement of the corporate image.

도 10에 도시된 일 예에서는 11번 JDBC CONN 카테고리, 즉 java.sql.connection#prepareStatement 클래스가 성능 저하의 주 원인 임을 쉽게 찾을 수 있다In the example illustrated in FIG. 10, it is easy to find that the 11th JDBC CONN category, that is, the java.sql.connection # prepareStatement class is the main cause of the performance degradation.

이렇게 모니터링된 응답 시간, 각종 파라미터, 클래스 및 메소드 정보를 통해 해당 어플리케이션 코드의 각 정보를 파악하고 프로그램의 최적화 및 각종 문제를 적절하게 해결할 수 있게 된다.Through the monitored response time, various parameters, class and method information, it is possible to grasp each information of the corresponding application code, optimize the program, and solve various problems appropriately.

본 발명은 도면에 도시된 일 실시예를 참고로 설명되었으나, 이는 예시적인 것에 불과하며, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. 따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 등록청구범위의 기술적 사상에 의해 정해져야 할 것이다.Although the present invention has been described with reference to one embodiment shown in the drawings, this is merely exemplary, and those skilled in the art will understand that various modifications and equivalent other embodiments are possible therefrom. . Therefore, the true technical protection scope of the present invention will be defined by the technical spirit of the appended claims.

본 발명에 따른 모니터링 방법에 따르면, 모니터링 코드를 어플리케이션 개 발 단계에서 삽입하지 않고 각종 모니터링 대상을 검출할 수 있어 어플리케이션 소스 코드를 매번 수정하여 컴파일하는 소모적인 작업을 없앨 수 있다. According to the monitoring method according to the present invention, it is possible to detect various monitoring targets without inserting the monitoring code in the application development stage, thereby eliminating the consuming work of modifying and compiling the application source code every time.

또한, 본 발명에 따른 호출 관계 추적 방법을 이용하면, 수많은 클래스 및 메소드들로 이루어진 자바 어플리케이션의 병목 구간을 쉽게 파악하여 해당 클래스 및 메소드들 그리고 SQL 등을 수정함으로써 어플리케이션의 성능향상에 기여할 수 있다. In addition, using the call relationship tracking method according to the present invention, it is possible to easily identify the bottleneck section of the Java application composed of a number of classes and methods, and contribute to the performance improvement of the application by modifying the corresponding classes and methods and SQL.

Claims (13)

자바 바이트 코드 조작을 통해 성능 데이터를 추출하기 위한 모니터링 방법에 있어서,In the monitoring method for extracting performance data through Java byte code manipulation, 어플리케이션 실행 명령이 인가되는 단계;Applying an application execution command; 자바 버추얼 머신이 바이트 코드 스트림을 메모리에 로딩하는 단계;The Java virtual machine loading the byte code stream into memory; 로딩된 클랫의 바이트 코드 인스트럭션을 분석하여 상기 로딩된 소스 코드에 성능 데이터의 모니터링을 위한 모니터링 코드를 삽입하여 변조하는 단계;Analyzing a byte code instruction of a loaded clat and inserting and modulating a monitoring code for monitoring performance data in the loaded source code; 상기 모니터링 코드가 삽입된 바이트 코드로 클래스를 생성하는 단계; 및Generating a class with byte codes into which the monitoring code is inserted; And 모니터링 대상 정보를 추출하고 가공하는 단계를 포함하며,Extracting and processing the monitored information; 상기 모니터링 코드 삽입 단계는, Inserting the monitoring code, 자바 클래스 파일의 포맷을 분석하는 단계;Analyzing a format of a Java class file; 모니터링 대상이 되는 메소드의 바이트 코드 인스트럭션 셋(byte code instruction set)을 변경하는 단계; 및Changing a byte code instruction set of a method to be monitored; And 성능 정보 추출 코드를 삽입하는 단계를 포함하는 것을 특징으로 하는 모니터링 방법.And inserting the performance information extraction code. 제 1 항에 있어서,The method of claim 1, 상기 성능 데이터는 응답 시간, 클래스 정보, 메소드 정보, 및 각종 파라미터 정보를 포함하는 것을 특징으로 하는 모니터링 방법.The performance data includes a response time, class information, method information, and various parameter information. 제 2 항에 있어서,The method of claim 2, 상기 모니터링 대상은 환경 파일로 지정될 수 있는 것을 특징으로 하는 모니 터링 방법.The monitoring method may be specified as an environment file. 제 1 항에 있어서,The method of claim 1, 상기 모니터링 코드 삽입 단계는 모니터링 대상 메소드의 시작 부분과 끝 부분에 시작과 끝 메소드를 삽입하는 단계를 포함하는 것을 특징으로 하는 모니터링 방법.The step of inserting the monitoring code monitoring method comprising the step of inserting the start and end methods at the beginning and end of the method to be monitored. 제 4 항에 있어서,The method of claim 4, wherein 상기 모니터링 코드 삽입 단계는, Inserting the monitoring code, 상기 모니터링 대상 메소드내에 파라미터가 있는 경우 상기 모니터링 코드는 상기 모니터링 대상 메소드내의 파라미터를 수집하도록 자동코딩 되는 것을 특징으로 하는 모니터링 방법.And if there is a parameter in the monitored method, the monitoring code is automatically coded to collect the parameter in the monitored method. 삭제delete 제 1 항에 있어서,The method of claim 1, 상기 성능 정보 추출 코드 삽입 단계는, 일반적으로 자바 바이트 코드 인스트루먼테이션이라 불리는 바이트 코드 분석 및 조작기술을 통해 삽입하는 것을 특징으로 하는 모니터링 방법.The performance information extraction code insertion step, characterized in that the insertion through the byte code analysis and manipulation techniques commonly called Java byte code instrumentation. 제 1 또는 제 2항에 기재된 모니터링 방법을 이용한 알고리즘을 통해 자바 어플리케이션의 각종 성능 데이터를 추출하기 위한 컴퓨터 판독 가능한 기록 매체.A computer-readable recording medium for extracting various performance data of a Java application through an algorithm using the monitoring method according to claim 1. 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete
KR1020050093795A 2005-10-06 2005-10-06 A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type KR100750834B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020050093795A KR100750834B1 (en) 2005-10-06 2005-10-06 A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020050093795A KR100750834B1 (en) 2005-10-06 2005-10-06 A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type

Publications (2)

Publication Number Publication Date
KR20070038637A KR20070038637A (en) 2007-04-11
KR100750834B1 true KR100750834B1 (en) 2007-08-22

Family

ID=38159849

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020050093795A KR100750834B1 (en) 2005-10-06 2005-10-06 A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type

Country Status (1)

Country Link
KR (1) KR100750834B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190020374A (en) * 2017-08-21 2019-03-04 주식회사 스패로우 Method and apparatus for providing api call information for dynamic analysis of web application
KR20190136258A (en) 2018-05-30 2019-12-10 주식회사 티파이브온라인 Cross platform system and operation method for supporting multi thread
KR102416292B1 (en) 2021-01-29 2022-07-01 숭실대학교 산학협력단 Dynamic analysis method for android applications, recording medium and device for performing the method

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100920414B1 (en) * 2008-05-30 2009-10-07 (주)제니퍼소프트 A system and method tracing the java stack at the designated point of java process transactions
US9760351B2 (en) 2013-04-02 2017-09-12 Google Inc. Framework for user-directed profile-driven optimizations
KR102433764B1 (en) * 2016-04-19 2022-08-19 삼성에스디에스 주식회사 System and method for monitoring service
KR101869008B1 (en) * 2016-09-02 2018-07-20 단국대학교 산학협력단 Apparatus for authenticating input value based on bytecode in java application and method thereof
CN109684027B (en) * 2017-10-18 2020-11-24 北京京东尚科信息技术有限公司 Method and device for dynamically tracking running of Java virtual machine
JP7119096B2 (en) * 2018-01-04 2022-08-16 ライン プラス コーポレーション license verification device
CN111443902B (en) * 2020-03-20 2023-09-08 杭州有赞科技有限公司 Function call tree generation method, system, computer device and readable storage medium
CN111984346B (en) * 2020-08-12 2023-10-27 八维通科技有限公司 Method, system, device and storage medium for calling chain tracking in micro-service environment
CN113419919A (en) * 2021-06-24 2021-09-21 亿览在线网络技术(北京)有限公司 Method for thread monitoring of third-party SDK

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030225917A1 (en) 2002-05-30 2003-12-04 Noubar Partamian Performance of computer programs while they are running
WO2004001555A2 (en) 2002-06-25 2003-12-31 International Business Machines Corporation Method and system for monitoring performance of application in a distributed environment
US20050033945A1 (en) 2003-06-19 2005-02-10 Gerard Chauvel Dynamically changing the semantic of an instruction

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030225917A1 (en) 2002-05-30 2003-12-04 Noubar Partamian Performance of computer programs while they are running
WO2004001555A2 (en) 2002-06-25 2003-12-31 International Business Machines Corporation Method and system for monitoring performance of application in a distributed environment
US20050033945A1 (en) 2003-06-19 2005-02-10 Gerard Chauvel Dynamically changing the semantic of an instruction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"EJB 어플리케이션의 성능 모니터링 기법", 나학청외 1인, 정보과학회논문지

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190020374A (en) * 2017-08-21 2019-03-04 주식회사 스패로우 Method and apparatus for providing api call information for dynamic analysis of web application
KR101996358B1 (en) * 2017-08-21 2019-07-03 주식회사 스패로우 Method and apparatus for providing api call information for dynamic analysis of web application
KR20190136258A (en) 2018-05-30 2019-12-10 주식회사 티파이브온라인 Cross platform system and operation method for supporting multi thread
KR102416292B1 (en) 2021-01-29 2022-07-01 숭실대학교 산학협력단 Dynamic analysis method for android applications, recording medium and device for performing the method

Also Published As

Publication number Publication date
KR20070038637A (en) 2007-04-11

Similar Documents

Publication Publication Date Title
KR100750834B1 (en) A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type
CN109976761B (en) Software development kit generation method and device and terminal equipment
US9575939B2 (en) Linked code generation report
US9411616B2 (en) Classloader/instrumentation approach for invoking non-bound libraries
US20110119658A1 (en) Speculative compilation
CN109189469B (en) Reflection-based android application micro-servitization method and system
CN109117164B (en) Micro-service updating method and system based on difference analysis of key elements
US8621429B2 (en) Software development support apparatus, function extension method and storage medium for storing function extension program
CN109240666B (en) Function calling code generation method and system based on call stack and dependent path
WO2000017748A1 (en) Text object compilation method and system
US9038033B1 (en) Techniques and mechanisms for web application minification
US20120124462A1 (en) Web Application Optimization
Khatchadourian et al. [Engineering Paper] A Tool for Optimizing Java 8 Stream Software via Automated Refactoring
US20120124555A1 (en) Optimization of Compiled Control Objects
Brada et al. Practical verification of component substitutability using subtype relation
Alves et al. Comparative analysis of porting strategies in J2ME games
Courbot et al. Efficient off-board deployment and customization of virtual machine-based embedded systems
Kurniawan Java for Android
Dageförde et al. A constraint-logic object-oriented language
Hu et al. A static timing analysis environment using Java architecture for safety critical real-time systems
Jezek et al. Magic with Dynamo--Flexible Cross-Component Linking for Java with Invokedynamic
CN109299004B (en) Method and system for analyzing difference of key elements
Shahin Towards Assurance-Driven Architectural Decomposition of Software Systems
Fredriksson et al. Towards native higher-order remote procedure calls
CN113778432A (en) Page forming method and device, content management system and plug-in

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20120813

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20130722

Year of fee payment: 7

LAPS Lapse due to unpaid annual fee