CN105426310B - A kind of method and apparatus for the performance for detecting target process - Google Patents

A kind of method and apparatus for the performance for detecting target process Download PDF

Info

Publication number
CN105426310B
CN105426310B CN201510850213.8A CN201510850213A CN105426310B CN 105426310 B CN105426310 B CN 105426310B CN 201510850213 A CN201510850213 A CN 201510850213A CN 105426310 B CN105426310 B CN 105426310B
Authority
CN
China
Prior art keywords
class
target
target process
hook
goal approach
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201510850213.8A
Other languages
Chinese (zh)
Other versions
CN105426310A (en
Inventor
冯刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510850213.8A priority Critical patent/CN105426310B/en
Publication of CN105426310A publication Critical patent/CN105426310A/en
Application granted granted Critical
Publication of CN105426310B publication Critical patent/CN105426310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing

Abstract

An embodiment of the present invention provides a kind of method and apparatus for the performance for detecting target process, this method includes:When target process starts, hook Hook is carried out to the goal approach of target class in the target process;Collection to the target process sending performance data instructs;The target process is read according to the performance data of the goal approach of target class collecting instruction acquisition, being linked up with Hook.The embodiment of the present invention realizes gradation degree monitoring strategies, since monitoring granularity can control, therefore, test performance is controllable, not only it can conveniently find out performance bottleneck with the hot spot inside precise positioning process, improve testing efficiency, and without doing any change to measurand, it ensure that the stability of measurand.

Description

A kind of method and apparatus for the performance for detecting target process
Technical field
The present invention relates to the technical field of computer disposal, more particularly to a kind of method for the performance for detecting target process With a kind of device for the performance for detecting target process.
Background technology
In the life cycle model of application, these stages of demand analysis, design, coding, test and operation and maintenance are all Fundamental therein.
In order to verify using whether reaching the performance indicator of user's proposition, while performance bottleneck present in finding to apply, The purpose of optimization application is played, usually application is tested for the property.
It in traditional performance test, has developed for one and has finished or develop substantially the application finished, tester is with one Kind or several performance testing tools carry out concurrent operations in a manner of simulating real user behavior as possible to the software, collect simultaneously Compare different scenes as a result, then analyzing the performance of software.
In certain performance testing tools, the emphasis of performance test is the performance monitoring of whole system, testing efficiency It is relatively low, it is difficult to find out the bottleneck of performance.
It in certain performance testing tools, generally requires to add in certain code in measurand, destroys measurand Stability.
Invention content
In view of the above problems, it is proposed that the present invention overcomes the above problem in order to provide one kind or solves at least partly State a kind of method of the performance of detection target process of problem and a kind of device of corresponding performance for detecting target process.
One side according to the present invention provides a kind of method for the performance for detecting target process, including:
When target process starts, hook Hook is carried out to the goal approach of target class in the target process;
Collection to the target process sending performance data instructs;
The target process is read according to the goal approach of target class collecting instruction acquisition, being linked up with Hook Performance data.
Optionally, it further includes:
The executable file of target process is read by tool processes;
The goal approach of according to target class is identified in the executable file;
The number in the affiliated public directory of tool processes will be written into the title of the target class, the title of the goal approach According to file.
Optionally, the step of goal approach to target class in the target process carries out hook Hook includes:
Read the public directory belonging to tool processes;
When detecting data file relevant with target process, from the data file read target class title, The title of goal approach;
The goal approach of target class is linked up with according to the title of the target class, the title of the goal approach Hook。
Optionally, the step of collection to the target process sending performance data instructs includes:
It is instructed by collection of the Intent mechanism to the target process sending performance data.
Optionally, it is described to read the target process according to the target class collecting instruction acquisition, being linked up with Hook Goal approach performance data the step of include:
When the target process receives performance number in the OnCreate methods of operation Activity, by Intent mechanism According to collection instruct when, read it is being returned by the target process, by hook Hook target class goal approach performance number According to.
Optionally, it is described to read the target process according to the target class collecting instruction acquisition, being linked up with Hook Goal approach performance data the step of include:
From the public directory belonging to tool processes, read the target process and collect instruction storage, quilt according to described Link up with the performance data of the goal approach of the target class of Hook.
Optionally, the goal approach of the target class includes:
The rewrite method of component class, the run methods of thread class;
Alternatively,
The rewrite method of component class, rewrite method, the public method of derived class, the run methods of thread class;
Alternatively,
Rewrite method, the public method of non-custom class;
Alternatively,
All methods of all classes.
Optionally, the performance data includes as follows one or more:
Call number, operation duration.
According to another aspect of the present invention, a kind of device for the performance for detecting target process is provided, including:
Hooking module, suitable for when target process starts, being hung to the goal approach of target class in the target process Hook Hook;
Instruction sending module is collected, suitable for being instructed to the collection of the target process sending performance data;
Performance data read module, suitable for read the target process according to it is described collect instruction acquisition, linked up with The performance data of the goal approach of the target class of Hook.
Optionally, it further includes:
Executable file read module, suitable for reading the executable file of target process by tool processes;
Goal approach identification module, suitable for identifying the goal approach of according to target class in the executable file;
Data file writing module, suitable for by the title of the title of the target class, the goal approach will be written tool into Data file in the affiliated public directory of journey.
Optionally, the Hooking module is further adapted for:
Read the public directory belonging to tool processes;
When detecting data file relevant with target process, from the data file read target class title, The title of goal approach;
The goal approach of target class is linked up with according to the title of the target class, the title of the goal approach Hook。
Optionally, the collection instruction sending module is further adapted for:
It is instructed by collection of the Intent mechanism to the target process sending performance data.
Optionally, the performance data read module is further adapted for:
When the target process receives performance number in the OnCreate methods of operation Activity, by Intent mechanism According to collection instruct when, read it is being returned by the target process, by hook Hook target class goal approach performance number According to.
Optionally, the performance data read module is further adapted for:
From the public directory belonging to tool processes, read the target process and collect instruction storage, quilt according to described Link up with the performance data of the goal approach of the target class of Hook.
Optionally, the goal approach of the target class includes:
The rewrite method of component class, the run methods of thread class;
Alternatively,
The rewrite method of component class, rewrite method, the public method of derived class, the run methods of thread class;
Alternatively,
Rewrite method, the public method of non-custom class;
Alternatively,
All methods of all classes.
Optionally, the performance data includes as follows one or more:
Call number, operation duration.
The embodiment of the present invention can be accurately obtained in target class by the goal approach of target class in Hook target process The performance data of goal approach realizes gradation degree monitoring strategies, since monitoring granularity can control, test performance is controllable, Not only can performance bottleneck conveniently be found out with the hot spot inside precise positioning process, improve testing efficiency, and without to tested Object does any change, ensure that the stability of measurand.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, below the special specific embodiment for lifting the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this field Technical staff will become clear.Attached drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of embodiment of the method 1 of performance for detecting target process according to an embodiment of the invention Flow chart of steps;
Fig. 2 shows a kind of embodiments of the method 2 for the performance for detecting target process according to an embodiment of the invention Flow chart of steps;And
Fig. 3 shows a kind of knot of the device embodiment of performance for detecting target process according to an embodiment of the invention Structure block diagram.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
With reference to Fig. 1, the method for showing a kind of performance for detecting target process according to an embodiment of the invention is implemented The step flow chart of example 1, specifically may include steps of:
Step 101, when target process starts, the goal approach of target class in the target process is linked up with Hook;
It should be noted that the embodiment of the present invention can be applied in various mobile equipment, for example, mobile phone, tablet computer, Personal digital assistant, wearable device (such as glasses, wrist-watch) etc..
The operating system of the movement equipment can include Android (Android), IOS, Windows Phone, Windows etc. Deng usually supporting the operation of various applications, such as camera shooting application, immediate communication tool, map application.
Using in the process of running, with process (process) carry out activity, i.e. process is the reality for the program being currently running Example.
In practical applications, since the application by java language developments is made of java classes, the implementation procedure of application then by Method composition in java classes, therefore, the monitoring to application performance method can carry out hook Hook according to actual needs, turn It is changed to the monitoring to method.
Hook is to certain process is kidnapped and controlled in process method.For example, it is assumed that method A is the original in target class The address of goal approach A, is substituted for the address of method B by some goal approach, and when operation will perform method B and no longer perform mesh Mark method A, this process are known as Hook.
It should be noted that target process is for monitored, by the process of carry out performance monitoring, target Method is also for monitored, is the method for needing to carry out performance monitoring.
In general, an application comprising method be very much, the method for performing Hook has cost in itself, so It if being not added with distinguishing whole Hook, can increase the error of performance monitoring, so, in some cases, a part can be excluded Method, method more crucial Hook.
In embodiments of the present invention, the class during android system can be applied is defined as following several:
1st, application component class
For example, from the Android frames such as Activity, Service, ContentProvider, BroadcastReceiver The class or the class of realization component relevant interface that frame composition class derives from, such as the click of button.
The time-consuming performance for directly representing application of method in these classes.
2nd, Android derived class
Non- Android components class, but be the class in Android frames, as SQLiteOpenHelper, Bundle, View etc., the derived class of these classes or the class for realizing relevant interface, can be referred to as derived class.
3rd, thread class
It is derived from by the Thread classes of Java or realizes the class of Runnable interfaces.
The execution time of thread is also one of key project of performance test.
4th, internal java class
By the class of derivation all kinds of in Java SDK (Software Development Kit, Software Development Kit), The class such as derived from from HashMap, List class.
5th, self defined class
Not from the derivation of any class and the class of any system interface and the subclass of these classes is not implemented.
It, can be by class each in target process by above 5 kinds classification, by the granularity of different stage i.e. in the embodiment of the present invention Providing target process needs the method for Hook.
Internal java class, self defined class are except Android frames, often in application component class, derived class or thread The object of these classes is called in the method for class, so the performance of these classes eventually reflects component class or the method for thread class In, therefore, the method for these classes can suitably be ignored.
And for abstract class, interface, enumerate the unrelated class of the performances such as class and can also directly ignore.
Furthermore, the goal approach of target class can include:
The rewrite method of component class, the run methods of thread class;
Key method in component class is all rewriting (Override) method of its base class, such as Activity classes OnCreate methods, the OnReceive methods of BroadcastReceiver classes, OnItemClickListener interfaces OnItemClick methods etc., critical process when these rewrite methods are application executions, the implementation procedure of an application is also It is the implementation procedure of these methods.
Run methods in thread class are also rewrite method, the time that the time i.e. thread that run methods perform perform.
Alternatively,
The rewrite method of component class, rewrite method, the public method (method modified by public) of derived class, thread The run methods of class;
Alternatively,
Rewrite method, the public method of non-custom class;
Alternatively,
All methods of all classes.
Certainly, above-mentioned target class and goal approach are intended only as example, can be according to reality when implementing the embodiment of the present invention Border situation sets other target class and goal approach, and the embodiment of the present invention does not limit this.In addition, in addition to above-mentioned target class And outside goal approach, those skilled in the art can also use other target class and goal approach according to actual needs, the present invention Embodiment does not also limit this.
Step 102, it is instructed to the collection of the target process sending performance data;
In the concrete realization, it can be instructed with the collection of target process sending performance data, i.e. the mesh of target class is collected in instruction The performance data of mark method.
Step 103, the target process is read according to the mesh of target class collecting instruction acquisition, being linked up with Hook The performance data of mark method.
If target process receives collection instruction, its performance data can be read and responded.
In the concrete realization, performance data can include as follows one or more:
Call number, operation duration.
Assuming that method A is original goal approach in target class, if the operation duration of monitoring objective method A and calling time Number, then can be substituted for method B by goal approach A by the method for Hook.
Goal approach A is recalled in method B, current system time t is recorded before invocation target method A0, method A return and then thus when system time subtract t0Value, be exactly goal approach A perform duration.
And the call number of goal approach A is exactly the call number of method B, and the calling of itself time can be recorded in method B Number.
Certainly, above-mentioned performance data is intended only as example, when implementing the embodiment of the present invention, can be set according to actual conditions Put other performance datas, such as CPU occupancies, EMS memory occupation amount, flow consumption figures, electric quantity consumption value, the embodiment of the present invention This is not limited.In addition, other than above-mentioned performance data, those skilled in the art can also use it according to actual needs Its performance data, the embodiment of the present invention also do not limit this.
The embodiment of the present invention can be accurately obtained in target class by the goal approach of target class in Hook target process The performance data of goal approach realizes gradation degree monitoring strategies, since monitoring granularity can control, test performance is controllable, Not only can performance bottleneck conveniently be found out with the hot spot inside precise positioning process, improve testing efficiency, and without to tested Object does any change, ensure that the stability of measurand.
With reference to Fig. 2, the method for showing a kind of performance for detecting target process according to an embodiment of the invention is implemented The step flow chart of example 2, specifically may include steps of:
Step 201, the executable file of target process is read by tool processes;
If operating system is Android, the embodiment of the present invention can be applied in Xposed frames.
In android system, the process of application be all by Zygote processes hatch Lai, and Zygote processes be by Init process initiations.
Zygote processes can create a Dalvik virtual machine example on startup, whenever it hatches a new application journey During sequence process, this Dalvik virtual machine example can be all copied to inside new program process and gone, so that each All there are one independent Dalvik virtual machine examples for a program process.
Xposed frames are that a dynamic for Android platform kidnaps project, pass through replacement/system/bin/ App_process programs control zygote processes so that app_process (process of application) is loaded in the first meeting of startup This jar packet of XposedBridge.jar, so as to complete the abduction of the Dalvik virtual machine to Zygote processes and its establishment, institute Behavior of each process at the beginning of startup under Xposed frames, can be controlled.
Therefore, in Xposed frames can in the case where not changing application installation package APK Hook application installation packages Designation method in APK, i.e. Xposed frames can allow target process to complete the Hook processes to designation method on startup.
It should be noted that tool processes are for monitoring, to carry out the process of performance monitoring.
Step 202, the goal approach of according to target class is identified in the executable file;
By taking Android as an example, executable file (Dex files) characteristic of itself based on application, tool processes can lead to The executable file of analysis target process is crossed, gets the title of all classes in target process, and the reflex mechanism for passing through Java Each attribute of analysis classes, the base class including class, the method included, method attribute etc..
Step 203, the title of the target process, the title of the goal approach will be written public belonging to tool processes Data file in catalogue;
Tool processes read the executable file of target process, and the granularity parsing specified by user needs the target class of Hook And its goal approach, it would be desirable to the class name and method of Hook is output to data file, catalogue where the data file for tool into A subdirectory under journey own directory, tool processes are this catalogue and the readable power of all users of following file opening Limit, this catalogue are properly termed as public directory.
Step 204, by Xposed frames, each process is made to read the public mesh belonging to tool processes when itself starts Record;
Step 205, when detecting data file relevant with target process, target class is read from the data file Title, the title of goal approach;
Step 206, target process according to the title of the target class, the title of the goal approach to the target of target class Method carries out hook Hook;
In the concrete realization, behavior when specifying the target process to start using Xposed, reads tool processes on startup Public directory, if it find that have with itself relevant data file, then read data file, and Hook residences have in this document The goal approach specified.
Step 207, various operations are carried out to target process, if user inputs, data base read-write etc., target after Hook into Journey can record the performance data of each operation;
Step 208, it is instructed by collection of the Intent mechanism to target process sending performance data;
Step 209, it when the target process receives the collection instruction of performance data, reads and is returned by the target process The performance data of the goal approach of target class returning, by hook Hook, and will be in the file of performance data write-in public directory.
In embodiments of the present invention, it can be implanted into the OnCreate methods of Activity and receive tool processes instruction Method.
It collects the transmission of instruction, receive, can be realized by Intent mechanism.
Intent mechanism is provided in Android to assist the interaction and communication between applying, Intent is responsible for in application The action of once-through operation, action is related to data, additional data is described.
Android then according to the description of this Intent, is responsible for finding corresponding component, Intent is passed to the group of calling Part, and complete the calling of component.
Intent cannot be only used between application program, it can also be used to Activity/Service inside application program it Between interaction.
Therefore, Intent plays a part of a media mediation herein, the special related letter for providing component and calling mutually Breath realizes the decoupling between caller and callee.
When tool processes send out the instruction for collecting performance data, tool processes can be written in performance data by target process Public directory under.
Then in embodiments of the present invention, tool processes can from the public directory belonging to tool processes, read target into Journey according to it is described collect instruction storage, by hook Hook target class goal approach performance data, check this document or Copy this document to SD (Secure Digital Memory Card) cards.
For embodiment of the method, in order to be briefly described, therefore it is all expressed as to a series of combination of actions, but this field Technical staff should know that the embodiment of the present invention is not limited by described sequence of movement, because implementing according to the present invention Example, certain steps may be used other sequences or are carried out at the same time.Secondly, those skilled in the art should also know, specification Described in embodiment belong to preferred embodiment, necessary to the involved action not necessarily embodiment of the present invention.
With reference to Fig. 3, show that a kind of device of performance for detecting target process according to an embodiment of the invention is implemented The structure diagram of example, can specifically include following module:
Hooking module 301, suitable for when target process starts, being carried out to the goal approach of target class in the target process Link up with Hook;
Instruction sending module 302 is collected, suitable for being instructed to the collection of the target process sending performance data;
Performance data read module 303, suitable for read the target process according to it is described collect instruction acquisition, linked up with The performance data of the goal approach of the target class of Hook.
In a kind of alternative embodiment of the present invention, which can also include following module:
Executable file read module, suitable for reading the executable file of target process by tool processes;
Goal approach identification module, suitable for identifying the goal approach of according to target class in the executable file;
Data file writing module, suitable for by the title of the title of the target class, the goal approach will be written tool into Data file in the affiliated public directory of journey.
In a kind of alternative embodiment of the present invention, the Hooking module 301 can be adapted to:
Read the public directory belonging to tool processes;
When detecting data file relevant with target process, from the data file read target class title, The title of goal approach;
The goal approach of target class is linked up with according to the title of the target class, the title of the goal approach Hook。
In a kind of alternative embodiment of the present invention, the collection instruction sending module 302 can be adapted to:
It is instructed by collection of the Intent mechanism to target process sending performance data.
In a kind of alternative embodiment of the present invention, the performance data read module 303 can be adapted to:
When the target process receives performance number in the OnCreate methods of operation Activity, by Intent mechanism According to collection instruct when, read it is being returned by the target process, by hook Hook target class goal approach performance number According to.
In a kind of alternative embodiment of the present invention, the performance data read module 303 can be adapted to:
From the catalogue belonging to tool processes, read the target process according to it is described collect instruction storage, linked up with The performance data of the goal approach of the target class of Hook.
In the concrete realization, the goal approach of the target class includes:
The rewrite method of component class, the run methods of thread class;
Alternatively,
The rewrite method of component class, rewrite method, the public method of derived class, the run methods of thread class;
Alternatively,
Rewrite method, the public method of non-custom class;
Alternatively,
All methods of all classes.
In practical applications, the performance data includes as follows one or more:
Call number, operation duration.
For device embodiment, since it is basicly similar to embodiment of the method, so description is fairly simple, it is related Part illustrates referring to the part of embodiment of the method.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification provided in this place, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.It can be the module or list in embodiment Member or component be combined into a module or unit or component and can be divided into addition multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification is (including adjoint power Profit requirement, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization or to be run on one or more processor Software module realize or realized with combination thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) realize setting for the performance of detection target process according to embodiments of the present invention The some or all functions of some or all components in standby.The present invention is also implemented as described here for performing Some or all equipment of method or program of device (for example, computer program and computer program product).This The program of the realization present invention of sample can may be stored on the computer-readable medium or can have one or more signal Form.Such signal can be downloaded from internet website to be obtained either providing or with any other on carrier signal Form provides.
It should be noted that the present invention will be described rather than limits the invention, and ability for above-described embodiment Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and run after fame Claim.

Claims (14)

1. a kind of method for the performance for detecting target process, including:
When target process starts, hook Hook is carried out to the goal approach of target class in the target process, wherein further Including:The executable file of target process is read by tool processes;Read the public directory belonging to tool processes;When detect with During the relevant data file of target process, title, the title of goal approach of target class are read from the data file;According to The title of the target class, the title of the goal approach carry out hook Hook to the goal approach of target class;
Collection to the target process sending performance data instructs;
The target process is read according to the performance of the goal approach of target class collecting instruction acquisition, being linked up with Hook Data.
2. the method as described in claim 1, which is characterized in that further include:
The goal approach of according to target class is identified in the executable file;
By the data text in the title of the target class, the title of the goal approach write-in affiliated public directory of tool processes Part.
3. the method as described in claim 1, which is characterized in that the collection to the target process sending performance data refers to The step of enabling includes:
It is instructed by collection of the Intent mechanism to the target process sending performance data.
4. method as claimed in claim 3, which is characterized in that described to read the target process according to the collection instruction receipts The step of performance data of the goal approach of target class collecting, by hook Hook, includes:
When the target process receives performance data in the OnCreate methods of operation Activity, by Intent mechanism When collecting instruction, the performance data of the goal approach of target class being returned by the target process, by hook Hook is read.
5. method as claimed in claim 1 or 2, which is characterized in that the reading target process refers to according to the collection The step of performance data for enabling the goal approach of target class collecting, by hook Hook, includes:
From the public directory belonging to tool processes, read the target process according to it is described collect instruction storage, linked up with The performance data of the goal approach of the target class of Hook.
6. method as claimed in claim 1 or 2 or 3 or 4, which is characterized in that the goal approach of the target class includes:
The rewrite method of component class, the run methods of thread class;
Alternatively,
The rewrite method of component class, rewrite method, the public method of derived class, the run methods of thread class;
Alternatively,
Rewrite method, the public method of non-custom class;
Alternatively,
All methods of all classes.
7. method as claimed in claim 1 or 2 or 3 or 4, which is characterized in that the performance data include following one kind or It is a variety of:
Call number, operation duration.
8. a kind of device for the performance for detecting target process, including:
Hooking module, suitable for when target process starts, being linked up with to the goal approach of target class in the target process Hook, wherein further comprising:Read the public directory belonging to tool processes;When detecting relevant with target process data text During part, title, the title of goal approach of target class are read from the data file;According to the title of the target class, institute The title for stating goal approach carries out hook Hook to the goal approach of target class;
Executable file read module, suitable for reading the executable file of target process by tool processes;
Instruction sending module is collected, suitable for being instructed to the collection of the target process sending performance data;
Performance data read module, suitable for reading the target process according to the collection instruction acquisition, by hook Hook The performance data of the goal approach of target class.
9. device as claimed in claim 8, which is characterized in that further include:
Goal approach identification module, suitable for identifying the goal approach of according to target class in the executable file;
Data file writing module, suitable for the title of the title of the target class, the goal approach will be written tool processes institute Belong to the data file in public directory.
10. device as claimed in claim 8, which is characterized in that the collection instruction sending module is further adapted for:
It is instructed by collection of the Intent mechanism to the target process sending performance data.
11. device as claimed in claim 10, which is characterized in that the performance data read module is further adapted for:
When the target process receives performance data in the OnCreate methods of operation Activity, by Intent mechanism When collecting instruction, the performance data of the goal approach of target class being returned by the target process, by hook Hook is read.
12. device as claimed in claim 8 or 9, which is characterized in that the performance data read module is further adapted for:
From the public directory belonging to tool processes, read the target process according to it is described collect instruction storage, linked up with The performance data of the goal approach of the target class of Hook.
13. the device as described in claim 8 or 9 or 10 or 11, which is characterized in that the goal approach packet of the target class It includes:
The rewrite method of component class, the run methods of thread class;
Alternatively,
The rewrite method of component class, rewrite method, the public method of derived class, the run methods of thread class;
Alternatively,
Rewrite method, the public method of non-custom class;
Alternatively,
All methods of all classes.
14. the device as described in claim 8 or 9 or 10 or 11, which is characterized in that the performance data includes following one kind It is or a variety of:
Call number, operation duration.
CN201510850213.8A 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process Active CN105426310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510850213.8A CN105426310B (en) 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510850213.8A CN105426310B (en) 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process

Publications (2)

Publication Number Publication Date
CN105426310A CN105426310A (en) 2016-03-23
CN105426310B true CN105426310B (en) 2018-06-26

Family

ID=55504528

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510850213.8A Active CN105426310B (en) 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process

Country Status (1)

Country Link
CN (1) CN105426310B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943676B (en) * 2016-10-12 2020-10-30 腾讯科技(深圳)有限公司 Performance test data processing method and device for operating nonvolatile memory by application
CN106657358A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Service proxy method and device for Android applications
CN107025173B (en) * 2017-04-05 2021-08-31 腾讯科技(深圳)有限公司 Method and device for testing function execution time
CN107092828A (en) * 2017-04-13 2017-08-25 深圳海云安网络安全技术有限公司 A kind of Android dynamic debuggings detection method
CN109726067B (en) * 2017-10-30 2021-08-24 腾讯科技(深圳)有限公司 Process monitoring method and client device
CN108446216A (en) * 2018-02-05 2018-08-24 捷开通讯(深圳)有限公司 The method, apparatus and storage device of trace flow track
CN108809763B (en) * 2018-06-14 2022-03-25 武汉斗鱼网络科技有限公司 Network performance parameter acquisition method, terminal device and storage medium
CN109684219A (en) * 2018-12-26 2019-04-26 百度在线网络技术(北京)有限公司 System performance testing method, apparatus and storage medium
CN109857650B (en) * 2019-01-14 2022-07-01 珠海金山网络游戏科技有限公司 Game performance monitoring method and system
CN111694724B (en) * 2019-03-15 2023-05-05 百度在线网络技术(北京)有限公司 Test method and device of distributed form system, electronic equipment and storage medium
CN112148253A (en) * 2019-06-26 2020-12-29 北京达佳互联信息技术有限公司 Program generation method, Java object replacement method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414305A (en) * 2008-12-01 2009-04-22 浙大网新科技股份有限公司 Method for acquisition of PASS headspring information based on proceeding graininess and opening file aggregation
CN102890643A (en) * 2012-07-26 2013-01-23 上海交通大学 Resource scheduling system based on immediate feedback of application effect under display card virtualization
CN102959519A (en) * 2010-06-28 2013-03-06 现代自动车株式会社 System test apparatus
CN103825783A (en) * 2014-03-10 2014-05-28 珠海市君天电子科技有限公司 Test method and device
CN104951375A (en) * 2015-07-01 2015-09-30 北京博睿宏远科技发展有限公司 Mobile phone APP performance data collecting method based on function interception technology

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5528640B2 (en) * 2011-05-09 2014-06-25 ヒョンダイ モーター カンパニー Exception processing test apparatus and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414305A (en) * 2008-12-01 2009-04-22 浙大网新科技股份有限公司 Method for acquisition of PASS headspring information based on proceeding graininess and opening file aggregation
CN102959519A (en) * 2010-06-28 2013-03-06 现代自动车株式会社 System test apparatus
CN102890643A (en) * 2012-07-26 2013-01-23 上海交通大学 Resource scheduling system based on immediate feedback of application effect under display card virtualization
CN103825783A (en) * 2014-03-10 2014-05-28 珠海市君天电子科技有限公司 Test method and device
CN104951375A (en) * 2015-07-01 2015-09-30 北京博睿宏远科技发展有限公司 Mobile phone APP performance data collecting method based on function interception technology

Also Published As

Publication number Publication date
CN105426310A (en) 2016-03-23

Similar Documents

Publication Publication Date Title
CN105426310B (en) A kind of method and apparatus for the performance for detecting target process
CN109302522B (en) Test method, test device, computer system, and computer medium
CN106844217B (en) Method and device for embedding point of applied control and readable storage medium
CN104461898B (en) Using the method for test, control server, test terminal and system
CN104407980B (en) Mobile solution automatic test device and method
CN111756575B (en) Performance analysis method and device of storage server and electronic equipment
CN105630463B (en) For detecting the method and device of JAR packet conflict
CN107832207A (en) Interface performance test method, apparatus, storage medium and computer equipment
CN105446868B (en) System compatibility test method, testing case management and relevant apparatus
CN104035863B (en) A kind of browser testing method and device
WO2019227708A1 (en) Online debugging apparatus and method for test case, and computer-readable storage medium
CN110457211A (en) Script performance test methods, device and equipment and computer storage medium
CN103577309A (en) Automatic test method and device
CN107045475B (en) Test method and device
CN103903312B (en) The execution method and apparatus of automatic detecting
CN106776334A (en) Based on annotation generation method of test example and device
CN105868097A (en) System testing method and apparatus thereof
KR101976629B1 (en) Commit sensitive tests
CN106528429A (en) UI testing method and device
US11119899B2 (en) Determining potential test actions
CN104484176B (en) A kind of Android system window object acquisition methods and device
CN101719091A (en) Method and monitoring system for the rule-based monitoring of a service-oriented architecture
WO2016053298A1 (en) Evaluating documentation coverage
CN107704391A (en) A kind of method of testing and device based on Selenium
CN116662197A (en) Automatic interface testing method, system, computer and readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220729

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right