Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Fig. 1 shows the schematic diagram of performance monitoring system 100 according to an embodiment of the invention.As shown in Figure 1, performance monitoring system 100 according to the present invention comprises application server 200, client 300 and performance monitoring server 400.The web application of usual enterprise-level can adopt distributed framework, the application realizing enterprise's miscellaneous service logic is comprised in application server 200. application server 200 can directly communicate with the client 300 of this application server 200 of access, or can be communicated with client 300 by web server.Such application server 200 can be absorbed in the realization of service logic, and application server also couples with database.Here, application server 200 includes but not limited to jboss, bea Weblogic and ibm webspere.Web server is the Enerprise etc. of Apache, IIS and Iplanet.
Client 300 refers to the application carrying out with application server 200 communicating, and can reside in the intelligent terminal such as computing equipment or mobile terminal.Such as, client 300 can be browser or the client application being exclusively used in this application server 200 of access.Performance monitoring server 400 can collect the monitor data of application server 200 and client 300, to carry out performance evaluation and to judge resource bottleneck.
Fig. 2 shows the schematic diagram of application server according to an embodiment of the invention.As shown in Figure 2, application according to the present invention server 200 comprises config memory 210, request processor 230 and processing engine 220.Config memory 210 is for store configuration information, and this configuration information is processing engine 220 deal with data and before performing application, the configuration file of use when carrying out preliminary treatment to data or application.Such as, the compiling config option used when configuration information comprises compiling data or application and link path information.Further, can also comprise monitoring indication information in configuration information, namely instruction will insert the first object of monitor message wherein.Here the first object is the object that processing engine 220 processes or performs.Such as, the first object can be the script write with various analytic language, such as executable xml, jsp script etc.Certainly, the object that processing engine 220 processes or performs also can comprise the object not inserting monitor message wherein.
Request processor 230 is suitable for receiving the access request from client 300, such as to the access request of xml or jsp, then request processor 230 understands the object (can be performed by processing engine 220 or be processed) that find access request corresponding according to access request, and then can determine whether this object will insert the first object of monitor message according to configuration information.Correspondingly, when this object is first object that will insert monitor message, request processor 230 can carry out the operation relevant to monitor message by notifier processes engine 220.
Processing engine 220 processes according to configuration information the first object that request processor 230 is determined or performs.Particularly, processing engine 220 loads and performs the first object, and can carry out adding monitor message in the process loading and perform, and then generates the result with monitor message, i.e. the second object.Request processor 230 can by this second object responsively message send to client 300.It should be noted that, the object adding monitor message is here the performance parameter in order to monitor client 300.Therefore, when client 300 performs this second object, meeting performs the policer operation to client 300, to obtain performance parameter according to monitor message.Such as, client 300 is browser, second object is the info web that browser loads, like this when performing policer operation, the performance parameter such as response time of such as web page loading time, script time of implementation, code execution error, client release information, throughput, client resource consumption and access application server 200 can be obtained.Client 300 also can when performing policer operation, the performance parameter of Real-time Collection is periodically sent to performance monitoring server 400, so that performance monitoring server 400 can according to the performance parameter obtained during client 300 run time version, carry out client performance analysis, and the communication process of client 300 and application server 200 is analyzed, thus can quick position resource bottleneck, solution is proposed.
In addition, processing engine 220 also comprises Network Performance Monitor 221, and this watch-dog 221 can be embedded in application server 200 not changing in the original code base of application server 200.This watch-dog 221 is as resident monitor component in the application server, can application server 200 process that processes the run time versions such as client 300 access request monitor, and server performance parameter can be sent to performance monitoring server 400, so that performance monitoring server 400 carries out Cooperative Analysis according to client performance parameter and server performance parameter.
Fig. 3 shows the schematic diagram of the application server 200 according to another embodiment of the present invention.In application according to the present invention server 200, configuration information memory 210, request processor 230 and processing engine 220 may operate on software virtual machine 240, such as Java Virtual Machine (JVM).
As shown in Figure 3, application according to the present invention server runs and has JVM, JVM runs configuration information memory, request processor 230 and processing engine 220.Wherein processing engine also comprises Network Performance Monitor 221 (Agent, probe) and Classloader (not shown).Network Performance Monitor 221 is for being embedded into the monitor component in application server 200.Particularly, by using intermediate language (such as Java) dynamic instrumentation technology, allow on the basis of not changing the original business logic codes of application server 200, and the fast integration monitoring application when not installing any SDK (Integrated Simulation developing instrument).Like this when application server 200 carries out Business Processing, Network Performance Monitor 221 can application server 200 be monitored for the process of the run time version such as process of client 300 access request.Meanwhile, Network Performance Monitor 221 can also operate the configuration information in configuration information memory 210, to determine the incidence relation with monitor message and the first object.When client 300 access application server 200, request processor 230 according to this access request, can search asked object.When this object is the first object, processing engine 220 can perform the operation of inserting monitor message.
Particularly, the first object according to the present invention can be the script utilizing various analytic language to write, such as JSP script, and can be the link information of JS script or this JS script with the monitor message of the first object association.Here the mode that processing engine 220 inserts monitor message can have multiple.According to one embodiment of present invention, processing engine 220 includes before the first object loads, to the JSP compiler that JSP code compiles.Correspondingly, the configuration information in config memory 210 can be yml configuration file.Wherein the example of yml configuration file is as follows:
This yml configuration file is arranged by Agent 221.Before processing engine 220 loads and performs the first object, JSP compiler (not shown) can compile the first object according to this configuration file, and in compilation process, insert monitor message (JS code), and after compiling completes, generate class class file.Then, class class file corresponding for this first object can be loaded into the runtime data area (runtime data) performing this first object by class loading.Class class file in processing engine 220 pairs of runtime data areas performs, and then generates the second object (such as, xml or html data).
According to still another embodiment of the invention, when Classloader loads class class, by Classloader, monitor message is inserted in class class, and then processing engine 220 performs the class class inserting monitor message, generate html webpage, i.e. the second object.In addition, processing engine 220 can also adopt other modes according to the present invention to make the second object have monitor message, all should belong to protection scope of the present invention.
In the various embodiments described above, request processor 230 can by second object with monitor message responsively message send to client.Like this, client 300, when loading this response message, can carry out policer operation according to monitor message.Generally for the load time of the webpage reducing response message, monitor message comprises the chained address of monitoring script, and client 300, when loading the second object, can obtain monitoring script (such as js script) according to this link address.In addition, in monitor message or the monitoring script that obtains, there is identification information (such as transactionName), the performance parameter that the server end that the Network Performance Monitor 221 of this identification information and application server 200 sends to performance monitoring server 400 is relevant with process the first object is corresponding, be convenient to performance monitoring server 400 like this, according to this identification information, the performance parameter that client 300 performance parameter obtains at application server 200 end corresponding thereto carried out association analysis, to obtain complete performance evaluation and resource bottleneck location.Wherein monitor message example is as follows:
Further, the policer operation of client can obtain multiple performance parameter.
Such as, performance parameter comprises client (such as browser) load time parameter.Scripted code example wherein for obtaining web page loading time is as follows:
In an embodiment in accordance with the invention, client 300 policer operation also comprises the version information obtaining browser.
Client 300 performs in policer operation process, periodically can send to performance monitoring server 400 the client performance parameter obtained, and if Network Abnormal, can carry out follow-up asynchronous transmission.Example code wherein to performance monitoring server transmission client performance parameter is as follows:
Further, performance monitoring server 400 according to the present invention can receive client 300 (the special APP of such as browser or access application server) and application server 200 carrying out communicating and finishing service logical process process in correlation performance parameters.In this network topology realizing business logic processing, performance monitoring server 400 obtains the handling property parameter of each link of applied logic process (every single stepping of such as user) respectively from client 300 and application server 400 end, and can pass through obtained performance parameter and identify the code of poor efficiency or mistake and tuning.In addition, performance monitoring server 400 can carry out visual presenting according to the topological diagram that performance parameter is depicted as of performance parameter.Such as, Fig. 4 is the display example of client 300 performance parameter, and Fig. 5 is the display example of the performance parameter of the application server 200 of enterprise.
Fig. 6 shows the flow chart of method for monitoring performance 600 according to an embodiment of the invention.The method 600 is suitable for performing in the application server.
As shown in Figure 6, the method 600 starts from step S610.In step S610, store configuration information, the instruction of this configuration information will insert the first object of monitor message wherein.According to one embodiment of present invention, after the monitor message of indication comprises and is sent to client by application server, the chained address of monitoring script or this monitoring script performed is carried out in client here.And first to as if application server responses data (such as with the script that various analytic language is write, as the JSP script etc.) data object that to perform in client-requested or process.Be suitable in these data objects adding monitor message (such as the link of JS script or this script).
In step S620, receive the access request from client, and determine the first object corresponding to this access request.In this step, when determining that the access request of client to correspond in multiple object any one, the update of monitor message can be performed in subsequent step.Otherwise, if the data object that client is asked does not belong to the first object, then can not carry out the operation of inserting monitor message in subsequent step.
In step S630, load and perform determined first object, and this first object is carried out described loading and the term of execution insert monitor message, to generate second object with monitor message.Particularly, in the second object that the mode that plurality of optional can be adopted to select makes application server generate according to the first object, there is monitor message.In an embodiment in accordance with the invention, after determining the first object (such as JSP script), first monitor message (such as the chained address of JS script or script) is inserted in the first object (being such as inserted into the head portion of html data), then load and perform the first object inserting monitor message, and then generating the second object.In yet another embodiment, first the first object is compiled, then at first object of loading through compiling, monitor message is inserted in the data of loading.Such as, in JVM, Classloader loads class class corresponding to the first object, and can insert monitor message in loading procedure.Like this, there is performed by JVM the class class of monitor message, make, in the second object generated, there is this monitor message.Subsequently, in step S640, the second generated object is responsively sent to described client, so that described in described client executing during the second object, policer operation can be performed according to monitor message wherein.Here, the second object includes but not limited to the data message of the forms such as HTML, XML, JSON.Client can carry out webpage loading and further asynchronous access and asynchronous execution when receiving these data messages, and then monitors relevant performance parameter in the client whole Business Processing relevant to the first object and network service breath process according to monitoring script.
Such as, the general process performing policer operation is in a browser: browser is when loading the second object, according to the chained address in monitor message, request and etc. monitoring script to be loaded (such as JS script), then this monitoring script is performed, to the monitoring performance such as version information, web page loading time, Business Processing duration of browser, obtain client performance parameter.
In addition, method for monitoring performance 600 also comprises the monitoring of application server.
In step S650, monitoring application server to the handling property of the first object, and obtains corresponding server performance parameter.The handling property of the first object is comprised and receives client to the performance parameter in the process the access request of the first object to generation second object, in the process that processes of the Asynchronous Request that sends during loading the second object to client of the performance parameter of application server and application server from application server.In step S660, this server performance parameter is sent to performance server, so that performance server is added up and analyzed this server performance parameter.
Further, performance monitoring server receives the performance parameter of application server and the performance parameter of client, and then carries out multiple statistical analysis according to performance parameter.In an embodiment in accordance with the invention, the performance parameter that performance monitoring server receives comprises the load and execution time of the second object corresponding to the loading of first object at server end place and time of implementation and this first object in client, such performance monitoring server just can in the complete process process of service request, the overall performance of client and application server carries out accurate analysis, and can quick position resource bottleneck and clearly improve the improvement direction of systematic function.In addition, performance monitoring server can also receive performance parameter (such as, the response time of script time of implementation of client, code execution error, client release information, throughput, client resource consumption and access application server sent by client and application server.The server resource consumption of application server end and application server version information), repeat no longer one by one here.
A1: according to method for monitoring performance of the present invention, wherein said monitor message comprises the chained address of monitoring script; And the step of described execution policer operation comprises: load this monitoring script according to this chained address; Perform monitoring script to obtain client performance parameter, and this client performance parameter is sent so that this client performance parameter of this performance server statistical analysis to performance server.A2: according to method for monitoring performance of the present invention, also comprise: monitoring application server to the handling property of described first object, and obtains corresponding server performance parameter; And this server performance parameter is sent to described performance server, so that this server performance parameter of performance server statistical analysis.A3: the method for monitoring performance as described in A2, wherein said client performance parameter comprises: the response time of load time of described second object, script time of implementation, code execution error, client release information, throughput, client resource consumption and access application server; And described server performance parameter comprises: the loading of described first object and time of implementation, server resource consumption and application server version information.
In specification provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires than the feature more multiple features clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are to be understood that the module of the equipment in example disclosed herein or unit or assembly can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned in one or more equipment different from the equipment in this example.Module in aforementioned exemplary can be combined as a module or can be divided into multiple submodule in addition.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary compound mode.
In addition, some in described embodiment are described as at this can by the processor of computer system or the method implemented by other device performing described function or the combination of method element.Therefore, there is the device of processor formation for implementing the method or method element of the necessary instruction for implementing described method or method element.In addition, the element described herein of device embodiment is the example as lower device: this device is for implementing the function performed by the element of the object in order to implement this invention.
As used in this, unless specifically stated so, use ordinal number " first ", " second ", " the 3rd " etc. to describe plain objects and only represent the different instances relating to similar object, and be not intended to imply the object be described like this must have the time upper, spatially, sequence aspect or in any other manner to definite sequence.
Although the embodiment according to limited quantity describes the present invention, benefit from description above, those skilled in the art understand, in the scope of the present invention described thus, it is contemplated that other embodiment.In addition, it should be noted that the language used in this specification is mainly in order to object that is readable and instruction is selected, instead of select to explain or limiting theme of the present invention.Therefore, when not departing from the scope and spirit of appended claims, many modifications and changes are all apparent for those skilled in the art.For scope of the present invention, be illustrative to disclosing of doing of the present invention, and nonrestrictive, and scope of the present invention is defined by the appended claims.