WO2016008398A1 - Program performance test method and device - Google Patents

Program performance test method and device Download PDF

Info

Publication number
WO2016008398A1
WO2016008398A1 PCT/CN2015/083886 CN2015083886W WO2016008398A1 WO 2016008398 A1 WO2016008398 A1 WO 2016008398A1 CN 2015083886 W CN2015083886 W CN 2015083886W WO 2016008398 A1 WO2016008398 A1 WO 2016008398A1
Authority
WO
WIPO (PCT)
Prior art keywords
performance test
function
performance
program
acquisition
Prior art date
Application number
PCT/CN2015/083886
Other languages
French (fr)
Chinese (zh)
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 北京奇虎科技有限公司
Publication of WO2016008398A1 publication Critical patent/WO2016008398A1/en

Links

Images

Classifications

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

Definitions

  • the invention relates to performance testing technology, in particular to a program performance testing method and a corresponding program performance testing device for performance testing of a Xhprof-based PHP program.
  • PHP Hypertext Preprocessor
  • PHP is a general-purpose open source scripting language.
  • PHP is mainly used in the field of web development.
  • PHP programs usually require performance testing during development.
  • the XHProf tool is usually used to test the performance of PHP programs.
  • the present invention has been made in order to provide a program performance testing method and apparatus that overcomes the above problems or at least partially solves the above problems.
  • a program performance testing method for a Xhprof-based PHP program performance test, including: an acquisition control parameter preset with a performance test indicator for a PHP program, and the acquisition control parameter is at least The method includes: collecting frequency of the performance test indicator; acquiring the acquisition control parameter in a process of simulating a mass user accessing the server to test the performance of the PHP program in the server; collecting each function in the PHP program according to the collection control parameter Performance test indicators during the test; each performance test record containing the function identifier and the performance test indicator formed by each acquisition in the PHP program running process is stored in the same database; according to the performance test stored in the database The record determines the performance of the function in the PHP program.
  • a computer program comprising computer readable code which, when run on a computer, performs the aforementioned program performance testing method.
  • a program performance testing apparatus for a Xhprof-based PHP program performance test, including: a storage module configured to preset an acquisition control parameter for a performance test indicator of a PHP program, and The acquisition control parameter includes at least: an acquisition frequency of the performance test indicator; and an acquisition module configured to acquire the acquisition control parameter in a process of simulating a mass user accessing the server to test the performance of the PHP program in the server; the acquisition module, Configuring to collect performance test indicators of each function in the PHP program during the test according to the collection control parameter; the recording module is configured to include a function identifier and a performance test indicator formed by each acquisition in the PHP program running process.
  • Each performance test record is stored in the same database; the performance module is configured to determine the performance of the function in the PHP program based on the performance test record stored in the database.
  • the program performance testing method and apparatus of the present invention collects the acquisition control parameters including the acquisition frequency of the performance test indicators in advance, and collects the functions of the PHP program in the test process according to the acquisition frequency and other parameters in the acquisition control parameters.
  • Performance test indicators in this way, in the simulation of massive users to access the server, in the process of testing the PHP program performance in the server, you can avoid the phenomenon that each function in the PHP program is called when the performance test indicators are collected, and then The performance test itself can reduce the consumption of the server resources; the collection control parameter of the present invention can set the corresponding parameter items according to the actual test requirements, so that the PHP program performance test result can meet the actual multiple test requirements;
  • each performance test record obtained in each process is stored in the same database.
  • FIG. 1 is a flow chart showing a method for testing a program performance according to a first embodiment of the present invention
  • FIG. 2 is a schematic diagram of a program performance testing apparatus according to Embodiment 2 of the present invention.
  • Figure 3 schematically shows a block diagram of a server for performing the method according to the invention
  • Fig. 4 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • Embodiment 1 The program performance test method.
  • S100 preset acquisition control parameters for performance test indicators of the PHP program to be tested, and the acquisition control parameters at least include: acquisition frequency of performance test indicators.
  • the frequency of collecting performance test indicators in this embodiment is mainly used to control the frequency of collection of performance test indicators.
  • the collection control parameters in this embodiment may also be included according to actual test requirements: a total acquisition control switch, a control switch for real-time monitoring performance test indicators, an acquisition control switch for a function occupying a CPU condition, an acquisition control switch for a function occupying a memory condition, and a function.
  • a total acquisition control switch a control switch for real-time monitoring performance test indicators
  • an acquisition control switch for a function occupying a CPU condition an acquisition control switch for a function occupying a memory condition
  • a function One or more (or even all) of the acquisition control switches of the number of calls and the acquisition control switches of the function response time within a predetermined time interval.
  • the collection control parameter in this embodiment may further include: one or two of path information and file name information of the text file, and path information and database name information of the database.
  • this embodiment may also add or delete corresponding parameter items according to specific test requirements in actual applications.
  • the above total acquisition control switch is mainly used to determine whether to execute the acquisition operation of the PHP program performance test indicator, for example, the total acquisition control switch is set to on, indicating that the performance test indicator acquisition operation is performed during the running of the PHP program; the total acquisition control switch is set to Off, indicating that the collection operation of the PHP program performance test indicator is not executed during the running of the PHP program.
  • the control switch of the real-time monitoring performance test indicator is mainly used to determine whether the collected performance test indicator needs to be monitored in real time.
  • the real-time monitoring performance test indicator is set to ON, indicating that the real-time display should be performed every time the performance test indicator is collected.
  • the performance test indicator; the real-time monitoring performance test indicator is set to off, indicating that all the performance test indicators collected do not need to be displayed in real time.
  • the acquisition control switch is mainly used to determine whether to collect the operation test index of the function occupying the CPU. If the function occupies the CPU, the acquisition control switch is set to ON, indicating that each time the PHP program is running. When performing the performance test index collection operation, the performance test index of the function occupying the CPU condition should be collected; the acquisition control switch of the function occupying the CPU condition is set to off, indicating that each time the performance test indicator is collected during the running of the PHP program There is no need to collect the performance test indicators of the function occupying the CPU.
  • the above-mentioned function occupies the memory condition of the acquisition control switch is mainly used to determine whether to collect the operation test indicator of the memory usage of the function, such as the function of the memory occupancy of the acquisition control switch is set to open, indicating that each time the PHP program is running When performing the performance test indicator collection operation, the performance test index of the memory occupied by the function should be collected; the acquisition control switch of the function occupying the memory condition is set to off, indicating that each time the performance test indicator is collected during the running of the PHP program There is no need to collect performance test indicators for function memory usage.
  • the acquisition control switch of the above function in the predetermined time interval is mainly used for determining whether to perform the collection operation function on the performance test index of the function call time in a predetermined time interval, such as the acquisition control switch setting of the function call time within a predetermined time interval.
  • a predetermined time interval such as the acquisition control switch setting of the function call time within a predetermined time interval.
  • the performance test index of the function call time in the predetermined time interval should be collected every time the performance test indicator is collected during the running of the PHP program; the function of the function is called in the predetermined time interval.
  • Set to off it means that the performance test indicator of the number of calls of the function in the predetermined time interval is not required for each time the performance test indicator is collected during the running of the PHP program.
  • the above-mentioned function response time acquisition control switch is mainly used to determine whether to collect all the function response time performance test indicators, such as the function response time acquisition control switch is set to on, indicating that each execution is performed during the PHP program running process. All performance response indicators should be collected during the acquisition of performance test indicators; the acquisition control switch that takes up the CPU condition of the function is set to off, indicating that each time the performance test indicator is collected during the running of the PHP program There is no need to collect the performance test indicators of the function occupying the CPU.
  • the path information and file name information of the above text file are mainly used to describe that each time the collected performance test indicators are temporarily stored in the text file, the performance test indicators should be based on the path information and file name information of the text file. Temporarily stored in the corresponding text file; or in the case that the performance test indicators collected each time are finally stored in the text file, the performance test indicators should be stored in the corresponding text according to the path information and the file name information of the text file. In the file.
  • the path information and database name information of the above database are mainly used to describe that each time the collected performance test indicators are directly stored in the database, the performance test indicators should be directly stored in the corresponding data according to the path information and database name information of the database.
  • the path information of the database should be The database name information stores the performance test metrics in the corresponding text file in the corresponding database.
  • the PHP program in this embodiment runs on a server, and the server is accessed by a large number of users (such as millions of users), so that any one of the PHP programs running on the server is included. It is possible for a function to be called multiple times (such as tens of thousands or even millions) in a short interval of time.
  • the operation of obtaining pre-set acquisition control parameters is usually performed at the beginning of the PHP program performance test.
  • the acquisition control parameter can be in the form of a configuration file, and the configuration file can be pre-set in the server where the tested PHP program is located, so that in the PHP program performance test process, it can be conveniently obtained from the configuration file stored locally by the server. Collect control parameters.
  • the specific values of each parameter item in the acquisition control parameters can be changed according to the requirements of the PHP program performance test.
  • a setting interface of the acquisition control parameter may be displayed at the beginning stage of the PHP program performance test, and the name of each parameter item included in the acquisition control parameter and each parameter are displayed in the interface.
  • the current value of the item (such as the default value), the user can set the specific value of each parameter item through the interface.
  • the acquisition frequency of the performance test indicator is set to a predetermined time interval through the interface
  • the total acquisition control switch is Set the value to ON, set the value of the control switch of the real-time monitoring performance test indicator to off, set the acquisition control switch that takes up the function of the CPU to ON, and set the acquisition control switch of the function to occupy the memory to ON.
  • the acquisition control switch of the number of calls is set to ON within a predetermined time interval
  • the acquisition control switch of the function response time is set to ON
  • the path information and file name information of the text file, the path information of the database, and the database name information are then set, and then passed Click the save button in the acquisition control parameter setting interface, etc.
  • locally stored key parameters e.g. stored in the local configuration files.
  • a specific example of a configuration file is as follows:
  • $run_id $xhprof_runs->save_run($xhprof_data, "hx”); turn on page monitoring and generate a link to collect data on the test page;
  • PHP internal functions are some of the commonly used public functions that PHP comes with, not written by PHP programmers, usually Under the PHP program performance test, the code of the PHP internal function will not be checked.
  • S120 Collect performance test indicators of each function in the PHP program during the test according to the acquisition control parameter.
  • the collection operation of the performance test indicator should be performed according to the set value of each parameter item in the acquisition control parameter, a specific example:
  • the setting value of the total acquisition control switch in the acquisition control parameter When the setting value of the total acquisition control switch in the acquisition control parameter is ON, the acquisition operation of the performance test indicator should be performed according to the acquisition frequency of the performance test indicator; the setting value of the total acquisition control switch in the acquisition control parameter is not In the case of ON, no acquisition of any performance test indicators will be performed.
  • the acquisition frequency of the test indicator can be displayed to the user in real time when the performance test indicator is collected. For example, a link is generated according to the collected performance test indicator, and the link is displayed in the monitoring page in real time. The content of the link; if the setting value of the control switch of the real-time monitoring performance test indicator is not on, the above-mentioned real-time display operation will not be performed.
  • the performance test index of the function occupying the CPU condition should be collected each time the performance test indicator is collected according to the acquisition frequency of the performance test index.
  • the setting value of the acquisition control switch of the function occupying the CPU is not on, the acquisition function does not need to occupy the CPU when the performance test indicator is collected every time according to the acquisition frequency of the performance test indicator. Performance test indicators.
  • the performance test index of the function occupied memory should be collected each time the performance test indicator is collected according to the acquisition frequency of the performance test index.
  • the setting value of the acquisition control switch of the function occupying the memory is not on, the acquisition function does not need to occupy the memory when performing the performance test index acquisition operation according to the acquisition frequency of the performance test indicator. Performance test indicators.
  • the Xhprof method call count statistics function should be turned on, so that the collection according to the performance test index is performed.
  • the performance test indicator of the function call time within a predetermined time interval can be collected; the number of times the function is called within a predetermined time interval (such as the number of times the function is called in a unit time)
  • the Xhprof call count statistics function may not be enabled. Therefore, when the performance test indicator collection operation is performed according to the acquisition frequency of the performance test indicator, it will not be collected.
  • the performance test indicator for the number of times the function is called within a predetermined time interval.
  • the function response time statistics function of Xhprof should be turned on, so that each time the performance test indicator is collected according to the acquisition frequency of the performance test indicator, The performance test indicator of the response time of each function is collected; if the setting value of the acquisition control switch of the function response time is not on, the function response time statistics function of Xhprof may not be turned on, so that the performance test indicator is based on the performance test The acquisition frequency of each time the performance test indicator is collected, the response time of each function is not collected.
  • the function identifier, the CPU occupied by the function, the memory occupied by the function, the number of times the function is called in a predetermined time interval, and the response time of the function are collected by calling the corresponding API (Application Programming Interface) provided by Xhprof. Performance parameter indicator.
  • API Application Programming Interface
  • a specific example of obtaining performance parameter indicators is:
  • $cpu $PerformaceInfo['cpu']; (cpu represents the CPU time (in microseconds, ie one millionth of a second) spent by the function acquired by the acquisition)
  • the PHP program performance test usually simulates a large number of users (such as a million users or more) to access the server, so each function in the PHP program is called when the performance test indicators are collected, This will bring a large resource consumption to the server, which will bring greater pressure on the server, which will affect the accuracy of the PHP program performance test.
  • the performance test indicators according to the acquisition frequency of the performance test indicators, it is possible to avoid the phenomenon that the performance test indicators are collected when each function in the PHP program is called, so that the obtained PHP program performance test result can be obtained. more acurrate.
  • all performance test records including the function identifier and the performance test indicator obtained by the multiple collections in this embodiment are finally stored in the same database, so as to perform subsequent performance analysis operations; and, the database is stored in the manner of a database.
  • All the performance test records obtained during the performance test of the PHP program can also conveniently compare the performance test results of the PHP program before and after optimization, which is beneficial to the testers to weigh the advantages and disadvantages of optimizing the PHP program.
  • Implementation method 1 In the configuration file, both the path information and the file name information of the text file are set, and the path information of the database and the database name information are set, in the process of running the PHP program, according to the frequency of collection of performance test indicators And the performance test records including the function identifier and the performance test indicator collected by the other corresponding parameter items in the acquisition control parameter are first stored in the text file according to the path information and the file name information of the text file in the configuration file, After the PHP program finishes running, all the performance test records in the text file are transferred to the database according to the path information of the database in the configuration file and the database name information.
  • Implementation 2 The path information and file name information of the text file are not set in the configuration file, but in the case where the path information of the database and the database name information are set, the acquisition frequency of the performance test indicator is used in the running process of the PHP program and Each performance test record containing the function identifier and the performance test indicator collected by other corresponding parameter items in the acquisition control parameter is directly stored in the database according to the path information and database name information of the database in the configuration file.
  • the above performance test record can be in the form of a log provided by Xhprof.
  • the function identifier included in the performance test record may be identification information such as a function name that can uniquely identify a function in the PHP program; the content of the performance test record other than the function identifier depends on the parameter item in the acquisition control parameter. .
  • performance test records usually include the CPU usage of the function, the memory usage of the function, the number of times the function is called within a predetermined time interval, and the response time of the function.
  • the CPU usage of the above function can be specifically as follows: the CPU usage of the function and/or the occupation time of the CPU by the function; the memory usage of the above function can be specifically: the function to the memory occupancy rate and/or the function to the memory occupation time, etc.;
  • the number of times a function can be called at a predetermined time interval can be specifically: the number of times the function is called by other functions in a unit time and/or the number of times the function calls other functions in a unit time;
  • the response time of the above function can be specifically as follows: The time it takes for the call to start until the function returns the corresponding result.
  • statistics are performed on each performance test record stored in the database, and the statistical result is analyzed to determine the performance of the function in the PHP program.
  • the variousities stored in the database The test record can be statistically calculated as follows: statistical calculations (such as averaging) are performed on the performance test indicators belonging to the same function.
  • the analysis of the statistical results determines that the performance of the function in the PHP program can be specifically as follows: the statistical calculation result of the performance test indicator is compared with the corresponding preset threshold value, and the performance test index exceeding the threshold value is selected, and the selected performance test is selected.
  • the indicator and its associated function can be displayed to the test user.
  • the function of the selected performance test indicator belongs to the function that the tester needs to pay attention to; for example, the CPU can be selected separately by statistical analysis of the performance test record in the database.
  • the function of function ranking can be realized by the function of the top 10 functions with the most memory, the most memory, the most frequently called, and the slowest response time.
  • the tester can analyze and improve the function that is located.
  • the above-mentioned preset threshold may be a threshold set in advance according to test experience. If during the PHP program performance test, the collected performance test records need to be presented to the tester in real time, the performance test record exceeding the preset threshold may be displayed in different colors, such as the font is red or highlighted. .
  • all the performance test indicators corresponding to the function of the selected performance test indicator can be presented to the tester in the form of a line chart, a statistical table or a text file; the line chart can make the tester more intuitive and convenient. Improved function for positioning.
  • the abscissa of the two-dimensional coordinate system can represent time
  • the ordinate of the two-dimensional coordinate system can represent the numerical value of the performance test index, so that a performance test indicator of a function can be based on
  • the corresponding acquisition time is represented in the two-dimensional coordinate axis, so that the plurality of performance test indicators of the function form a broken line.
  • a plurality of polylines formed by a plurality of performance test indicators of a function may be represented in the same two-dimensional coordinate system; for example, four polylines of a function are shown in the same two-dimensional coordinate system, and the four polylines are respectively The first polyline formed by all the functions of the function occupying the CPU condition, the second polyline formed by occupying the memory condition for all functions of the function, and the number of calls for all functions of the function in a predetermined time interval Three polylines, and a fourth polyline formed for all function response times of the function.
  • multiple fold lines formed by the same performance test index of multiple functions may be represented in the same two-dimensional coordinate system; for example, four fold lines of four functions may be shown in the same two-dimensional coordinate system, and the four fold lines
  • the first polyline formed by all the functions belonging to the first function occupying the CPU condition, the second polyline formed by all the functions belonging to the second function occupying the CPU condition, and belonging to the third All functions of a function occupy the third polyline formed by the CPU condition and the fourth polyline formed by the CPU condition of all functions belonging to the fourth function.
  • the existing drawing plug-in can be used to draw the above-mentioned line graph.
  • the performance test record selected from the performance test record of the database is provided to the drawing plug-in according to a preset manner, so that the drawing plug-in can receive according to the same.
  • the data obtained draws the above line chart.
  • the tester can conveniently locate the performance bottleneck of the PHP program, and the performance test record recorded in the database can be conveniently obtained by using other test tools.
  • the test results are combined and analyzed to meet the testing needs of a variety of PHP programs.
  • Embodiment 2 The Xhprof-based PHP program performance testing device, the device of this embodiment may be set in a server running a PHP program that needs to perform performance testing.
  • the Xhprof-based PHP program performance test device shown in FIG. 2 is generally disposed in a server, and the device mainly includes: a storage module 200, an acquisition module 210, an acquisition module 220, a recording module 230, and a performance module 240.
  • the storage module 200 is mainly configured to preset an acquisition control parameter for a performance test indicator of the PHP program, and the collection control parameter herein includes at least: an acquisition frequency of the performance test indicator.
  • the frequency of the performance test indicators preset in the storage module 200 is mainly used to control the frequency of collection of the performance test indicators.
  • the collection control parameters stored in the storage module 200 may also be included according to actual test requirements: a total acquisition control switch, a control switch for real-time monitoring performance test indicators, an acquisition control switch for a function occupying a CPU condition, and an acquisition control switch for a function occupying a memory condition,
  • the function calls one or more (or even all) of the acquisition control switch of the number of times and the acquisition control switch of the function response time within a predetermined time interval.
  • the collection control parameters stored in the storage module 200 may further include: one or two of path information and file name information of the text file, and path information and database name information of the database.
  • the embodiment may also add or delete corresponding parameter items stored in the storage module 200 according to specific testing requirements in actual applications.
  • the storage module 200 can store the acquisition control parameters in the form of a configuration file.
  • the obtaining module 210 is mainly configured to acquire acquisition control parameters in a process of simulating a mass user accessing the server to test the performance of the PHP program in the server.
  • the obtaining module 210 may obtain the acquisition control parameters from the storage module 200, and the specific values of the parameter items in the collection control parameters may be changed according to different requirements of the PHP program performance test.
  • the obtaining module 210 may display a setting interface of the acquisition control parameter at the beginning stage of the PHP program performance test, where the name of all the parameter items included in the acquisition control parameter is displayed.
  • the current value of each parameter item (such as the default value)
  • the user can set the specific value of each parameter item through the interface, for example, the acquisition frequency of the performance test indicator is set to a predetermined time interval through the interface, and the total collection is performed.
  • the value of the control switch is set to ON, the value of the control switch of the real-time monitoring performance test indicator is set to off, the acquisition control switch that takes the function of the CPU is set to ON, and the acquisition control switch of the function occupying the memory is set to ON.
  • Set the acquisition control switch of the function to the number of calls in the predetermined time interval to ON, set the acquisition control switch of the function response time to ON, set the path information and file name information of the text file, and the path information and database name information of the database.
  • the acquisition module 220 is mainly configured to collect performance test indicators of each function in the PHP program during the test according to the acquisition control parameters.
  • the collection module 220 should perform the collection operation of the performance test indicator according to the set value of each parameter item in the acquisition control parameter obtained by the acquisition module 210, a specific example:
  • the acquisition module 220 should perform the acquisition operation of the performance test indicator according to the acquisition frequency of the performance test index; the total acquisition control switch in the acquisition control parameter If the set value is not on, the acquisition module 220 does not perform any acquisition operation of the performance test indicator.
  • the acquisition module 220 should perform the performance test indicator collected in real time each time the performance test indicator is collected according to the acquisition frequency of the performance test indicator. Displayed to the user, such as based on the collected performance test indicators A link is generated, and the content of the link is displayed in real time in the monitoring page; if the setting value of the control switch of the real-time monitoring performance test indicator is not on, the collecting module 220 does not perform the above-mentioned real-time display operation.
  • the acquisition module 220 should collect the CPU usage of the function when the performance of the performance test indicator is performed every time according to the acquisition frequency of the performance test index.
  • Performance test indicator in the case that the setting value of the acquisition control switch of the function occupying the CPU is not on, the acquisition module 220 does not need to collect each time the performance of the performance test indicator is performed according to the acquisition frequency of the performance test indicator.
  • the function takes up the CPU condition as a performance test indicator.
  • the acquisition module 220 should collect the memory occupied by the function each time the performance of the performance test indicator is performed according to the acquisition frequency of the performance test index.
  • Performance test indicator in the case that the setting value of the acquisition control switch of the function occupying the memory is not on, the acquisition module 220 does not need to collect each time the performance test indicator is collected according to the acquisition frequency of the performance test indicator.
  • the function takes up the memory condition as a performance test indicator.
  • the acquisition module 220 should enable the method call counting function of Xhprof, so that the acquisition module 220 is According to the acquisition frequency of the performance test indicator, each time the performance test indicator is collected, the performance test index of the function call time in the predetermined time interval can be collected; the function is called in the predetermined time interval (such as the function in the unit)
  • the acquisition module 220 may not enable the Xhprof call count statistics function, so that the acquisition module 220 performs performance each time according to the acquisition frequency of the performance test indicator.
  • the performance test indicator of the number of times the function is called within a predetermined time interval is not collected.
  • the acquisition module 220 should enable the function response time statistics function of Xhprof, so that the acquisition module 220 executes the performance test index each time according to the acquisition frequency of the performance test indicator.
  • the performance test index of each function's response time can be collected; if the set value of the function control switch of the function response time is not on, the acquisition module 220 can not open the Xhprof function response time statistics. Function, such that the acquisition module 220 performs performance test indicators each time according to the acquisition frequency of the performance test indicators. When the acquisition operation is performed, the performance test index of the response time of each function is not collected.
  • the collection module 220 can collect the function identifier, the CPU usage of the function, the memory occupied by the function, the number of times the function is called within a predetermined time interval, and the response time of the function, etc. by calling the corresponding API (Application Programming Interface) provided by Xhprof. Performance parameter indicator.
  • API Application Programming Interface
  • the acquisition module 220 performs the performance test index collection, which will bring the server a comparison. Large resource consumption, which puts a lot of pressure on the server, which will affect the accuracy of PHP program performance testing.
  • the collection module 220 in this embodiment collects the performance test indicators according to the collection frequency of the performance test indicators, and can avoid the phenomenon that the performance test indicators are collected when each function in the PHP program is called, so that the obtained PHP can be obtained. The results of the program performance test are more accurate.
  • the recording module 230 is mainly configured to store each performance test record including the function identifier and the performance test indicator formed by each acquisition in the PHP program running process in the same database.
  • the recording module 230 stores all the performance test records obtained during the performance test of the PHP program in a database manner, and can also facilitate the tester to compare the performance test results of the PHP program before and after optimization, which is beneficial for the tester to weigh the optimization of the PHP program. Pros and cons.
  • the specific implementation manners of the recording module 230 storing all the performance test records collected by the collection module 220 in the same database are as follows:
  • Implementation mode 1 In the configuration file, both the path information and the file name information of the text file are set, and the path information of the database and the database name information are set.
  • the collection module 220 In the running process of the PHP program, the collection module 220 according to the performance test index The performance test records collected by the acquisition frequency and other corresponding parameter items in the acquisition control parameters, including the function identifier and the performance test indicator, are recorded by the recording module 230 according to the path information and file name information of the text file in the configuration file.
  • the recording module 230 Stored in the text file, after the PHP program finishes running, the recording module 230 further stores all the performance test records in the text file in the database according to the path information of the database in the configuration file and the database name information.
  • Implementation 2 In the configuration file, the path information and the file name information of the text file are not set, but in the case where the path information of the database and the database name information are set, during the running of the PHP program, the collection module 220 according to the performance test index
  • the performance test records including the function identifier and the performance test indicator collected by the acquisition frequency and other corresponding parameter items in the acquisition control parameter are stored by the recording module 230 directly according to the path information and database name information of the database in the configuration file. In the database.
  • the above performance test record can be in the form of a log provided by Xhprof.
  • the function identifier included in the performance test record may be identification information such as a function name that can uniquely identify a function in the PHP program; the content of the performance test record other than the function identifier depends on the parameter item in the acquisition control parameter. .
  • performance test records usually include the CPU usage of the function, the memory usage of the function, the number of times the function is called within a predetermined time interval, and the response time of the function.
  • the performance module 240 is primarily configured to determine the performance of functions in the PHP program based on performance test records stored in the database.
  • the performance module 240 performs statistics on each performance test record stored in the database, and analyzes the statistical result to determine the performance of the function in the PHP program.
  • the performance module 240 performs statistics on the performance test records stored in the database.
  • the performance module 240 performs statistical calculations (such as averaging) on the performance test indicators belonging to the same function.
  • the performance module 240 analyzes the statistical result to determine the performance of the function in the PHP program.
  • the performance module 240 compares the statistical calculation result of the performance test indicator with a corresponding preset threshold value, and selects a performance test indicator that exceeds the threshold.
  • the performance module 240 can display the selected performance test indicators and the functions to which they belong to the tester.
  • the function of the selected performance test indicators belongs to a function that the tester needs to pay attention to; for example, the performance module 240 can pass through the database.
  • the statistical analysis of the performance test records selects the top 10 functions that occupy the most CPU, the most memory, the most frequently called, and the slowest response time, to achieve function positioning, and the tester can target the function. Analyze improvements.
  • the above preset thresholds can be used by testers to preset thresholds based on test experience. If the performance test record collected by the acquisition module 220 needs to be presented to the tester in real time during the performance test of the PHP program, the performance test record exceeding the preset threshold may be displayed in different colors, such as the font being red or high. Bright mode display.
  • test indicator can be presented to the tester by the performance module 240 in the form of a line chart, a statistical table or a text file; the line chart can make the tester more intuitive and convenient to locate the function to be improved.
  • the tester performance module 240 can use the existing drawing plug-in to draw the above-mentioned line graph.
  • the performance module 240 provides the performance test record selected from the performance test record of the database to the drawing plug-in according to a preset manner, thereby drawing
  • the plugin can draw the above line graph based on the data it receives. For details about the line drawing, refer to the description in the above method embodiment, and the description is not repeated here.
  • the performance module 240 can easily locate the performance bottleneck of the PHP program by analyzing the performance test records recorded in the database, and the performance test record recorded in the database can be conveniently obtained by using other test tools. The test results are combined and analyzed to meet the testing needs of a variety of PHP programs.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components in a client or server in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 3 illustrates a server, such as a search engine server, that can implement the above method in accordance with the present invention.
  • the server traditionally includes a processor 310 and a computer program product or computer readable medium in the form of a memory 330.
  • the memory 330 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 330 has a memory space 350 for program code 351 for performing any of the method steps described above.
  • storage space 350 for program code may include various program code 351 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • a program code carrier such as a hard disk, a compact disk (CD), a memory card, or a floppy disk.
  • a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 330 in the server of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 351', i.e., code that can be read by a processor, such as 310, which, when executed by a server, causes the server to perform various steps in the methods described above.

Abstract

A program performance test method and device, which are used for testing the performance of an Xhprof-based PHP program. The method comprises: presetting a collection control parameter of a performance test index for a PHP program, wherein the collection control parameter at least comprises a collection frequency of the performance test index (S100); in the process of simulating a large number of users accessing a server so as to test the performance of the PHP program in the server, acquiring the collection control parameter (S110); according to the collection control parameter, collecting a performance test index of each function in the PHP program in the test process (S120); storing each performance test record formed by each collection during the operation of the PHP program and containing a function identifier and the performance test index in the same database (S130); and according to the performance test record stored in the database, determining the performance of the function in the PHP program (S140).

Description

程序性能测试方法和装置Program performance test method and device 技术领域Technical field
本发明涉及性能测试技术,特别是涉及一种程序性能测试方法以及相应的程序性能测试装置,用于基于Xhprof的PHP程序的性能测试。The invention relates to performance testing technology, in particular to a program performance testing method and a corresponding program performance testing device for performance testing of a Xhprof-based PHP program.
背景技术Background technique
PHP(Hypertext Preprocessor,超文本预处理器)是一种通用的开源脚本语言。目前,PHP主要适用于Web开发领域。PHP (Hypertext Preprocessor) is a general-purpose open source scripting language. Currently, PHP is mainly used in the field of web development.
PHP程序在开发过程中通常需要进行性能测试。目前,通常会使用XHProf工具对PHP程序进行性能测试。PHP programs usually require performance testing during development. Currently, the XHProf tool is usually used to test the performance of PHP programs.
发明人在实现本发明过程中发现,XHProf工具目前提供的PHP程序性能测试方式无论是在PHP程序性能测试的准确性方面,还是在PHP程序性能测试的易用性方面,亦或是在PHP程序性能测试的多样性方面,都存在进一步提升的空间。In the process of implementing the present invention, the inventor found that the performance test method of the PHP program currently provided by the XHProf tool is in terms of the accuracy of the PHP program performance test, the ease of use of the PHP program performance test, or the PHP program. There is room for further improvement in the diversity of performance tests.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的程序性能测试方法和装置。In view of the above problems, the present invention has been made in order to provide a program performance testing method and apparatus that overcomes the above problems or at least partially solves the above problems.
依据本发明的一个方面,提供了一种程序性能测试方法,用于基于Xhprof的PHP程序性能测试,包括:预先设置有针对PHP程序的性能测试指标的采集控制参数,且所述采集控制参数至少包括:性能测试指标的采集频率;在模拟海量用户对服务器进行访问以测试服务器中的PHP程序性能的过程中,获取所述采集控制参数;根据所述采集控制参数采集PHP程序中的各函数在测试过程中的性能测试指标;将PHP程序运行过程中每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记录均存储于同一个数据库中;根据所述数据库中存储的性能测试记录确定PHP程序中的函数的性能。 According to an aspect of the present invention, a program performance testing method is provided for a Xhprof-based PHP program performance test, including: an acquisition control parameter preset with a performance test indicator for a PHP program, and the acquisition control parameter is at least The method includes: collecting frequency of the performance test indicator; acquiring the acquisition control parameter in a process of simulating a mass user accessing the server to test the performance of the PHP program in the server; collecting each function in the PHP program according to the collection control parameter Performance test indicators during the test; each performance test record containing the function identifier and the performance test indicator formed by each acquisition in the PHP program running process is stored in the same database; according to the performance test stored in the database The record determines the performance of the function in the PHP program.
根据本发明的另一方面,提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算机上运行时,将执行前述的程序性能测试方法。According to another aspect of the present invention, there is provided a computer program comprising computer readable code which, when run on a computer, performs the aforementioned program performance testing method.
根据本发明的再一方面,提供了一种计算机可读介质,其中存储了前述的计算机程序。According to still another aspect of the present invention, there is provided a computer readable medium storing the aforementioned computer program.
根据本发明的又一方面,提供了一种程序性能测试装置,用于基于Xhprof的PHP程序性能测试,包括:存储模块,配置为预先设置有针对PHP程序的性能测试指标的采集控制参数,且所述采集控制参数至少包括:性能测试指标的采集频率;获取模块,配置为在模拟海量用户对服务器进行访问以测试服务器中的PHP程序性能的过程中,获取所述采集控制参数;采集模块,配置为根据所述采集控制参数采集PHP程序中的各函数在测试过程中的性能测试指标;记录模块,配置为将PHP程序运行过程中每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记录均存储于同一个数据库中;性能模块,配置为根据所述数据库中存储的性能测试记录确定PHP程序中的函数的性能。According to still another aspect of the present invention, a program performance testing apparatus is provided for a Xhprof-based PHP program performance test, including: a storage module configured to preset an acquisition control parameter for a performance test indicator of a PHP program, and The acquisition control parameter includes at least: an acquisition frequency of the performance test indicator; and an acquisition module configured to acquire the acquisition control parameter in a process of simulating a mass user accessing the server to test the performance of the PHP program in the server; the acquisition module, Configuring to collect performance test indicators of each function in the PHP program during the test according to the collection control parameter; the recording module is configured to include a function identifier and a performance test indicator formed by each acquisition in the PHP program running process. Each performance test record is stored in the same database; the performance module is configured to determine the performance of the function in the PHP program based on the performance test record stored in the database.
本发明的程序性能测试方法以及装置通过预先设置包含有性能测试指标的采集频率的采集控制参数,并根据该采集频率以及采集控制参数中的其他参数采集PHP程序中的各函数在测试过程中的性能测试指标,这样,在模拟海量用户对服务器进行访问,以对服务器中的PHP程序性能测试过程中,可以避免PHP程序中的每个函数在被调用时均进行性能测试指标采集的现象,进而可以减小性能测试自身对服务器资源的消耗;本发明的采集控制参数可以根据实际测试需求来设置相应的参数项,这样,可以使PHP程序性能测试结果满足实际的多种测试需求;本发明通过在PHP程序性能测试过程中将每次获取的各性能测试记录均存储于同一个数据库中,在进行PHP程序性能分析过程中,可以方便的基于该数据库中存储的所有性能测试记录而进行各种形式的数据统计,以从PHP程序的所有函数中方便的定位出有待于进一步改进的函数,有利于PHP程序性能测试;从而本发明提高了PHP程序性能测试的准确性、易用性以及多样性。 The program performance testing method and apparatus of the present invention collects the acquisition control parameters including the acquisition frequency of the performance test indicators in advance, and collects the functions of the PHP program in the test process according to the acquisition frequency and other parameters in the acquisition control parameters. Performance test indicators, in this way, in the simulation of massive users to access the server, in the process of testing the PHP program performance in the server, you can avoid the phenomenon that each function in the PHP program is called when the performance test indicators are collected, and then The performance test itself can reduce the consumption of the server resources; the collection control parameter of the present invention can set the corresponding parameter items according to the actual test requirements, so that the PHP program performance test result can meet the actual multiple test requirements; In the PHP program performance test process, each performance test record obtained in each process is stored in the same database. During the performance analysis of the PHP program, various performance test records stored in the database can be conveniently performed. Form of data statistics to get from PHP All functions in order to facilitate the positioning of the function to be further improved, PHP facilitate performance test procedures; the present invention thus improves the performance test procedures PHP accuracy, ease of use and diversity.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。说明书附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not intended to limit the invention. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了根据本发明实施例一的程序性能测试方法流程图;1 is a flow chart showing a method for testing a program performance according to a first embodiment of the present invention;
图2示出了根据本发明实施例二的程序性能测试装置示意图;2 is a schematic diagram of a program performance testing apparatus according to Embodiment 2 of the present invention;
图3示意性地示出了用于执行根据本发明的方法的服务器的框图;以及Figure 3 schematically shows a block diagram of a server for performing the method according to the invention;
图4示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。Fig. 4 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
实施例一、程序性能测试方法。Embodiment 1 The program performance test method.
下面结合图1对本实施例的方法进行详细说明。The method of this embodiment will be described in detail below with reference to FIG. 1.
图1中,S100、预先设置针对待测试PHP程序的性能测试指标的采集控制参数,且采集控制参数至少包括:性能测试指标的采集频率。In FIG. 1, S100, preset acquisition control parameters for performance test indicators of the PHP program to be tested, and the acquisition control parameters at least include: acquisition frequency of performance test indicators.
具体的,本实施例中的性能测试指标的采集频率主要用于控制性能测试指标的采集频度。Specifically, the frequency of collecting performance test indicators in this embodiment is mainly used to control the frequency of collection of performance test indicators.
本实施例中的采集控制参数还可以根据实际测试需求而包括:总采集控制开关、实时监控性能测试指标的控制开关、函数占用CPU情况的采集控制开关、函数占用内存情况的采集控制开关、函数在预定时间间隔内调用次数的采集控制开关以及函数响应时间的采集控制开关中的一个或者多个(甚至全部)。 另外,本实施例中的采集控制参数还可以包括:文本文件的路径信息和文件名称信息、以及数据库的路径信息和数据库名称信息中的一个或者两个。当然,本实施例也可以根据实际应用中的具体测试需求而添加或者删减相应的参数项。The collection control parameters in this embodiment may also be included according to actual test requirements: a total acquisition control switch, a control switch for real-time monitoring performance test indicators, an acquisition control switch for a function occupying a CPU condition, an acquisition control switch for a function occupying a memory condition, and a function. One or more (or even all) of the acquisition control switches of the number of calls and the acquisition control switches of the function response time within a predetermined time interval. In addition, the collection control parameter in this embodiment may further include: one or two of path information and file name information of the text file, and path information and database name information of the database. Of course, this embodiment may also add or delete corresponding parameter items according to specific test requirements in actual applications.
上述总采集控制开关主要用于决定是否执行PHP程序性能测试指标的采集操作,如总采集控制开关设置为开,表示在PHP程序运行过程中执行性能测试指标的采集操作;总采集控制开关设置为关,表示在PHP程序运行过程中不执行PHP程序性能测试指标的采集操作。The above total acquisition control switch is mainly used to determine whether to execute the acquisition operation of the PHP program performance test indicator, for example, the total acquisition control switch is set to on, indicating that the performance test indicator acquisition operation is performed during the running of the PHP program; the total acquisition control switch is set to Off, indicating that the collection operation of the PHP program performance test indicator is not executed during the running of the PHP program.
上述实时监控性能测试指标的控制开关主要用于决定是否需要对采集到的性能测试指标进行实时监控,如实时监控性能测试指标设置为开,表示在每次采集到性能测试指标时均应实时显示该性能测试指标;实时监控性能测试指标设置为关,表示采集到的所有性能测试指标均不需要实时显示。The control switch of the real-time monitoring performance test indicator is mainly used to determine whether the collected performance test indicator needs to be monitored in real time. For example, the real-time monitoring performance test indicator is set to ON, indicating that the real-time display should be performed every time the performance test indicator is collected. The performance test indicator; the real-time monitoring performance test indicator is set to off, indicating that all the performance test indicators collected do not need to be displayed in real time.
上述函数占用CPU情况的采集控制开关主要用于决定是否对函数占用CPU情况这一性能测试指标进行采集操作,如函数占用CPU情况的采集控制开关设置为开,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均应采集函数占用CPU情况这一性能测试指标;函数占用CPU情况的采集控制开关设置为关,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均不需要采集函数占用CPU情况这一性能测试指标。The above-mentioned function occupies the CPU situation. The acquisition control switch is mainly used to determine whether to collect the operation test index of the function occupying the CPU. If the function occupies the CPU, the acquisition control switch is set to ON, indicating that each time the PHP program is running. When performing the performance test index collection operation, the performance test index of the function occupying the CPU condition should be collected; the acquisition control switch of the function occupying the CPU condition is set to off, indicating that each time the performance test indicator is collected during the running of the PHP program There is no need to collect the performance test indicators of the function occupying the CPU.
上述函数占用内存情况的采集控制开关主要用于决定是否对函数占用内存情况这一性能测试指标进行采集操作,如函数占用内存情况的采集控制开关设置为开,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均应采集函数占用内存情况这一性能测试指标;函数占用内存情况的采集控制开关设置为关,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均不需要采集函数占用内存情况这一性能测试指标。The above-mentioned function occupies the memory condition of the acquisition control switch is mainly used to determine whether to collect the operation test indicator of the memory usage of the function, such as the function of the memory occupancy of the acquisition control switch is set to open, indicating that each time the PHP program is running When performing the performance test indicator collection operation, the performance test index of the memory occupied by the function should be collected; the acquisition control switch of the function occupying the memory condition is set to off, indicating that each time the performance test indicator is collected during the running of the PHP program There is no need to collect performance test indicators for function memory usage.
上述函数在预定时间间隔内调用次数的采集控制开关主要用于决定是否对函数在预定时间间隔内调用次数这一性能测试指标进行采集操作,如函数在预定时间间隔内调用次数的采集控制开关设置为开,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均应采集函数在预定时间间隔内调用次数这一性能测试指标;函数在预定时间间隔内调用次数的采集控制开关设 置为关,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均不需要采集函数在预定时间间隔内调用次数这一性能测试指标。The acquisition control switch of the above function in the predetermined time interval is mainly used for determining whether to perform the collection operation function on the performance test index of the function call time in a predetermined time interval, such as the acquisition control switch setting of the function call time within a predetermined time interval. For the open, it means that the performance test index of the function call time in the predetermined time interval should be collected every time the performance test indicator is collected during the running of the PHP program; the function of the function is called in the predetermined time interval. Set to off, it means that the performance test indicator of the number of calls of the function in the predetermined time interval is not required for each time the performance test indicator is collected during the running of the PHP program.
上述函数响应时间的采集控制开关主要用于决定是否对所有的函数响应时间这一性能测试指标进行采集操作,如函数响应时间的采集控制开关设置为开,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均应采集所有的函数响应时间这一性能测试指标;函数占用CPU情况的采集控制开关设置为关,表示在PHP程序运行过程中每次执行性能测试指标的采集操作时均不需要采集函数占用CPU情况这一性能测试指标。The above-mentioned function response time acquisition control switch is mainly used to determine whether to collect all the function response time performance test indicators, such as the function response time acquisition control switch is set to on, indicating that each execution is performed during the PHP program running process. All performance response indicators should be collected during the acquisition of performance test indicators; the acquisition control switch that takes up the CPU condition of the function is set to off, indicating that each time the performance test indicator is collected during the running of the PHP program There is no need to collect the performance test indicators of the function occupying the CPU.
上述文本文件的路径信息和文件名称信息主要用于描述在每次采集到的性能测试指标均先暂时存储于文本文件的情况下,应依据该文本文件的路径信息和文件名称信息将性能测试指标暂时存储于相应的文本文件中;或者在每次采集到的性能测试指标均最终存储于文本文件的情况下,应依据该文本文件的路径信息和文件名称信息将性能测试指标存储于相应的文本文件中。The path information and file name information of the above text file are mainly used to describe that each time the collected performance test indicators are temporarily stored in the text file, the performance test indicators should be based on the path information and file name information of the text file. Temporarily stored in the corresponding text file; or in the case that the performance test indicators collected each time are finally stored in the text file, the performance test indicators should be stored in the corresponding text according to the path information and the file name information of the text file. In the file.
上述数据库的路径信息和数据库名称信息主要用于描述在每次采集到的性能测试指标直接存储于数据库的情况下,应依据该数据库的路径信息和数据库名称信息将性能测试指标直接存储于相应的数据库中;或者在每次采集到的性能测试指标先存储于文本文件中且在性能测试结束时再将文本文件中的性能测试指标存储于数据库中的情况下,应依据该数据库的路径信息和数据库名称信息将相应的文本文件中的性能测试指标存储于相应的数据库中。The path information and database name information of the above database are mainly used to describe that each time the collected performance test indicators are directly stored in the database, the performance test indicators should be directly stored in the corresponding data according to the path information and database name information of the database. In the database; or in the case where the performance test indicators collected each time are stored in a text file and the performance test indicators in the text file are stored in the database at the end of the performance test, the path information of the database should be The database name information stores the performance test metrics in the corresponding text file in the corresponding database.
S110、在模拟海量用户对服务器进行访问,以测试服务器中的PHP程序性能的过程中,获取预先设置的采集控制参数。S110. Acquire pre-set acquisition control parameters in a process of simulating access to the server by a mass of users to test the performance of the PHP program in the server.
具体的,本实施例中的PHP程序运行于服务器中,且该服务器会面对海量用户(如数以百万计的用户)的访问,这样,运行于服务器中的PHP程序所包含的任意一个函数都有可能在一个很短的时间间隔内被多次(如数以万计,甚至数以百万计)调用执行。Specifically, the PHP program in this embodiment runs on a server, and the server is accessed by a large number of users (such as millions of users), so that any one of the PHP programs running on the server is included. It is possible for a function to be called multiple times (such as tens of thousands or even millions) in a short interval of time.
获取预先设置的采集控制参数的操作通常是在进行PHP程序性能测试的开始阶段执行。采集控制参数可以采用配置文件的形式,且该配置文件可以预先设置于被测试的PHP程序所在的服务器中,这样,在PHP程序性能测试过程中,可以方便的从服务器本地存储的配置文件中获得采集控制参数。 The operation of obtaining pre-set acquisition control parameters is usually performed at the beginning of the PHP program performance test. The acquisition control parameter can be in the form of a configuration file, and the configuration file can be pre-set in the server where the tested PHP program is located, so that in the PHP program performance test process, it can be conveniently obtained from the configuration file stored locally by the server. Collect control parameters.
采集控制参数中的各参数项的具体取值可以根据PHP程序性能测试需求的不同而被更改。为了方便设置采集控制参数中各参数项的取值,可以在PHP程序性能测试的开始阶段显示采集控制参数的设置界面,该界面中显示有采集控制参数所包含的所有参数项的名称以及各参数项的当前取值(如缺省值),用户可以通过该界面来设置各参数项的具体取值,如通过该界面将性能测试指标的采集频率设置为预定时间间隔、将总采集控制开关的取值设置为开、将实时监控性能测试指标的控制开关的取值设置为关、将函数占用CPU情况的采集控制开关设置为开、将函数占用内存情况的采集控制开关设置为开、将函数在预定时间间隔内调用次数的采集控制开关设置为开、将函数响应时间的采集控制开关设置为开、设置文本文件的路径信息和文件名称信息以及数据库的路径信息和数据库名称信息,然后,通过点击采集控制参数设置界面中的保存按钮等方式,使上述设置的参数项的具体取值本地存储(如存储于本地的配置文件中)。The specific values of each parameter item in the acquisition control parameters can be changed according to the requirements of the PHP program performance test. In order to conveniently set the value of each parameter item in the acquisition control parameter, a setting interface of the acquisition control parameter may be displayed at the beginning stage of the PHP program performance test, and the name of each parameter item included in the acquisition control parameter and each parameter are displayed in the interface. The current value of the item (such as the default value), the user can set the specific value of each parameter item through the interface. For example, the acquisition frequency of the performance test indicator is set to a predetermined time interval through the interface, and the total acquisition control switch is Set the value to ON, set the value of the control switch of the real-time monitoring performance test indicator to off, set the acquisition control switch that takes up the function of the CPU to ON, and set the acquisition control switch of the function to occupy the memory to ON. The acquisition control switch of the number of calls is set to ON within a predetermined time interval, the acquisition control switch of the function response time is set to ON, the path information and file name information of the text file, the path information of the database, and the database name information are then set, and then passed Click the save button in the acquisition control parameter setting interface, etc. Above provided specific value locally stored key parameters (e.g. stored in the local configuration files).
一个配置文件的具体例子如下所示:A specific example of a configuration file is as follows:
1、define(′XHPROF_ENABLE′,true);//是否开启PHP程序性能测试指标的采集操作,即设置总采集控制开关的取值;1, define ('XHPROF_ENABLE', true); / / whether to open the PHP program performance test indicators acquisition operation, that is, set the value of the total acquisition control switch;
if(XHPROF_ENABLE==true&&function_exists(′xhprof_enable′)){If(XHPROF_ENABLE==true&&function_exists('xhprof_enable')){
xhprof_enable();Xhprof_enable();
}}
其中,上述语句中的“function_exists(′xhprof_enable′)”主要用于判断xhprof_enable()是否存在,以使程序逻辑更严谨且程序运行更稳定;Among them, "function_exists('xhprof_enable')" in the above statement is mainly used to judge whether xhprof_enable() exists, so that the program logic is more rigorous and the program runs more stably;
2、define(′XHPROF_TYPE,0);//0:是性能,1:是功能(其中的性能是指性能测试应用场景,即针对大批量用户访问的情况;其中的功能是指手工性能测试应用场景,即针对测试人员手工点击实现用户访问的情况,也即针对用户访问量很小的情况);2, define ('XHPROF_TYPE, 0); / / 0: is performance, 1: is a function (the performance refers to the performance test application scenario, that is, for large-volume user access; the function refers to the manual performance test application The scenario, that is, the case where the tester manually clicks to implement user access, that is, the case where the user has a small amount of access);
if(XHPROF_TYPE==1){If(XHPROF_TYPE==1){
$percent=1;调整性能测试指标的采集频率为每次用户访问都进行采集;$percent=1; adjust the acquisition frequency of performance test indicators for each user access;
$run_id=$xhprof_runs->save_run($xhprof_data,″hx″);开启页面监控,并且将采集数据生成一个链接在测试页面展现; $run_id=$xhprof_runs->save_run($xhprof_data, "hx"); turn on page monitoring and generate a link to collect data on the test page;
echo″<a href=′/xhprof_html/index.php?run=″.$run_id.″&source=sourcejoy′>view</a>″;(该语句表示在性能测试完成后,所有采集数据会在测试页面自动生成一个链接,以方便用户的查看性能测试结果);Echo"<a href='/xhprof_html/index.php?run=".$run_id."&source=sourcejoy'>view</a>"; (This statement indicates that after the performance test is completed, all collected data will be tested The page automatically generates a link to facilitate the user to view the performance test results);
}}
If(XHPROF_TYPE==1){If(XHPROF_TYPE==1){
}}
3、define(′XHPROF_LOG_DATA′,′/usr/local/apache2/htdocs/xhprof/′);//日志信息存放路径;3, define ('XHPROF_LOG_DATA', '/usr/local/apache2/htdocs/xhprof/'); / / log information storage path;
4、define(′PERCENT′,1);//记录日志信息的频率,即设置性能测试指标的采集频率的取值;4, define ('PERCENT', 1); / / record the frequency of the log information, that is, set the value of the acquisition frequency of performance test indicators;
通过该函数$percent=mt_rand(1,PERCENT)生成随机数;Generate a random number by the function $percent=mt_rand(1, PERCENT);
If($percent==1){If($percent==1){
xhprof_enable(XHPROF_FLAGS_CPU+XHPROF_FLAGS_MEMORY);Xhprof_enable(XHPROF_FLAGS_CPU+XHPROF_FLAGS_MEMORY);
}(该语句表示每次采集的性能测试指标应包含有函数占用CPU的详细信息和函数占用MEMORY的详细信息)} (This statement indicates that the performance test indicator for each acquisition should contain details of the CPU usage of the function and the details of the function occupying MEMORY)
5、define(′PAGEVIEW′,true);//是否开启页面监控,即每次采集的数据都会生成一个包含详细采集数据的页面,该页面就是上面所提及的可以查看性能测试结果的测试页面;5, define ('PAGEVIEW', true); / / whether to open page monitoring, that is, each time the data is collected will generate a page containing detailed collection data, the page is the test page mentioned above to view performance test results ;
if(开启性能测试&PAGEVIEW==true){If (turn on performance test &PAGEVIEW==true){
$run_id=$xhprof_runs->save_run($xhprof_data,″hx″);$run_id=$xhprof_runs->save_run($xhprof_data,"hx");
}(该语句表示采集的性能测试指标所存储的文件id,该文件id可以用来自动生成展示性能测试结果的测试页面)} (This statement indicates the file id stored in the collected performance test indicator, which can be used to automatically generate a test page showing the performance test results)
ElseElse
不保存监控页面;Do not save the monitoring page;
6、define(‘BUILTINS’,true);//是否监控PHP内部函数性能数(需要特别说明的是,PHP内部函数是PHP自带的一些常用公共函数,不是PHP程序开发人员编写的,通常情况下,在进行PHP程序性能测试时,不会对PHP内部函数的代码进行核查) 6, define ('BUILTINS', true); / / monitor PHP internal function performance (special need to be noted, PHP internal functions are some of the commonly used public functions that PHP comes with, not written by PHP programmers, usually Under the PHP program performance test, the code of the PHP internal function will not be checked.
if(BUILTINS==true){If(BUILTINS==true){
xhprof_enable(XHPROF_FLAGS_NO_BUILTINS);Xhprof_enable(XHPROF_FLAGS_NO_BUILTINS);
}(该语句表示关闭对PHP内部函数性能测试指标的采集操作)} (This statement means to close the collection operation of PHP internal function performance test indicators)
7、define(‘CPU_MONITOR’,true);//是否监控函数占用CPU的详细信息(如在包含PHP内部函数的情况下函数占用CPU的时间以及在不包含PHP内部函数的情况下函数占用CPU的时间),默认只监控在不包含PHP内部函数的情况下函数占用CPU的时间,此选项可用于统计更详细的CPU使用信息,本实施例通过对函数占用CPU的时间进行采集,从而可以通过函数占用CPU的时间计算出函数占用CPU的百分比;7, define ('CPU_MONITOR', true); / / Whether the monitor function occupies the details of the CPU (such as the function of the CPU in the case of the PHP internal function, and the CPU does not contain the PHP internal function) Time), the default only monitors the CPU usage time when the function does not contain PHP internal functions. This option can be used to count more detailed CPU usage information. In this embodiment, the CPU time of the function is collected, so that the function can be passed. The CPU usage time calculates the percentage of CPU occupied by the function;
if(CPU_MONITOR==true){If(CPU_MONITOR==true){
xhprof_enable(XHPROF_FLAGS_CPU);}(该语句表示监控在包含PHP内部函数的情况下函数占用CPU的详细信息)Xhprof_enable(XHPROF_FLAGS_CPU);} (This statement indicates that the function takes up CPU details when including PHP internal functions)
8、define(‘MEM_MONITOR’,true);//是否监控函数占用内存的详细信息(如在包含PHP内部函数的情况下函数占用内存情况以及在不包含PHP内部函数的情况下函数占用内存情况,也可以统计内存占用峰值等数据),默认只监控在不包含PHP内部函数的情况下函数占用内存的字节数,此选项可用于统计更详细的内存占用信息;8, define ('MEM_MONITOR', true); / / Whether the monitor function occupies memory details (such as in the case of PHP internal functions, the function takes up memory and the function occupies memory without including PHP internal functions, You can also count the data such as the peak memory usage. By default, only the number of bytes occupied by the function in the case of not including PHP internal functions is monitored. This option can be used to count more detailed memory usage information.
if(MEM_MONITOR==true){If(MEM_MONITOR==true){
xhprof_enable(XHPROF_FLAGS_MEMORY);(该语句表示监控在包含PHP内部函数的情况下函数占用内存的详细信息)Xhprof_enable(XHPROF_FLAGS_MEMORY); (This statement indicates that the function occupies memory when the PHP internal function is included)
S120、根据采集控制参数采集PHP程序中的各函数在测试过程中的性能测试指标。S120: Collect performance test indicators of each function in the PHP program during the test according to the acquisition control parameter.
具体的,本实施例应根据采集控制参数中的各参数项的设置值来执行性能测试指标的采集操作,一个具体的例子:Specifically, in this embodiment, the collection operation of the performance test indicator should be performed according to the set value of each parameter item in the acquisition control parameter, a specific example:
在采集控制参数中的总采集控制开关的设置值为开的情况下,应根据性能测试指标的采集频率来执行性能测试指标的采集操作;在采集控制参数中的总采集控制开关的设置值不为开的情况下,则不会执行任何性能测试指标的采集操作。When the setting value of the total acquisition control switch in the acquisition control parameter is ON, the acquisition operation of the performance test indicator should be performed according to the acquisition frequency of the performance test indicator; the setting value of the total acquisition control switch in the acquisition control parameter is not In the case of ON, no acquisition of any performance test indicators will be performed.
在实时监控性能测试指标的控制开关的设置值为开的情况下,应在根据性 能测试指标的采集频率每次执行了性能测试指标的采集操作时,将采集到的性能测试指标实时显示给用户,如根据采集到的性能测试指标生成一个链接,并在监控页面中实时显示该链接的内容;在实时监控性能测试指标的控制开关的设置值不为开的情况下,则不会执行上述实时显示的操作。In the case where the setting value of the control switch of the real-time monitoring performance test indicator is ON, it should be based on the nature. The acquisition frequency of the test indicator can be displayed to the user in real time when the performance test indicator is collected. For example, a link is generated according to the collected performance test indicator, and the link is displayed in the monitoring page in real time. The content of the link; if the setting value of the control switch of the real-time monitoring performance test indicator is not on, the above-mentioned real-time display operation will not be performed.
在函数占用CPU情况的采集控制开关的设置值为开的情况下,应在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均应采集函数占用CPU情况这一性能测试指标;在函数占用CPU情况的采集控制开关的设置值不为开的情况下,则在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均不需要采集函数占用CPU情况这一性能测试指标。In the case that the setting value of the acquisition control switch of the function occupying the CPU is ON, the performance test index of the function occupying the CPU condition should be collected each time the performance test indicator is collected according to the acquisition frequency of the performance test index. In the case that the setting value of the acquisition control switch of the function occupying the CPU is not on, the acquisition function does not need to occupy the CPU when the performance test indicator is collected every time according to the acquisition frequency of the performance test indicator. Performance test indicators.
在函数占用内存情况的采集控制开关的设置值为开的情况下,应在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均应采集函数占用内存情况这一性能测试指标;在函数占用内存情况的采集控制开关的设置值不为开的情况下,则在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均不需要采集函数占用内存情况这一性能测试指标。In the case that the setting value of the acquisition control switch of the function occupying the memory is on, the performance test index of the function occupied memory should be collected each time the performance test indicator is collected according to the acquisition frequency of the performance test index. In the case that the setting value of the acquisition control switch of the function occupying the memory is not on, the acquisition function does not need to occupy the memory when performing the performance test index acquisition operation according to the acquisition frequency of the performance test indicator. Performance test indicators.
在函数在预定时间间隔内调用次数(如在单位时间内调用次数)的采集控制开关的设置值为开的情况下,应开启Xhprof的方法调用次数统计功能,这样,在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均可以采集到函数在预定时间间隔内调用次数这一性能测试指标;在函数在预定时间间隔内调用次数(如函数在单位时间内调用次数)的采集控制开关的设置值不为开的情况下,则可以不开启Xhprof的调用次数统计功能,这样,在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,也不会采集到函数在预定时间间隔内调用次数这一性能测试指标。In the case that the set value of the acquisition control switch of the function in the predetermined time interval (such as the number of calls in the unit time) is on, the Xhprof method call count statistics function should be turned on, so that the collection according to the performance test index is performed. Each time the performance of the performance test indicator is collected, the performance test indicator of the function call time within a predetermined time interval can be collected; the number of times the function is called within a predetermined time interval (such as the number of times the function is called in a unit time) If the setting value of the acquisition control switch is not on, the Xhprof call count statistics function may not be enabled. Therefore, when the performance test indicator collection operation is performed according to the acquisition frequency of the performance test indicator, it will not be collected. The performance test indicator for the number of times the function is called within a predetermined time interval.
在函数响应时间的采集控制开关的设置值为开的情况下,应开启Xhprof的函数响应时间统计功能,这样,在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均可以采集到各函数的响应时间这一性能测试指标;在函数响应时间的采集控制开关的设置值不为开的情况下,则可以不开启Xhprof的函数响应时间统计功能,这样,在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,也不会采集到各函数的响应时间这一性能测试指标。 When the setting value of the acquisition control switch of the function response time is ON, the function response time statistics function of Xhprof should be turned on, so that each time the performance test indicator is collected according to the acquisition frequency of the performance test indicator, The performance test indicator of the response time of each function is collected; if the setting value of the acquisition control switch of the function response time is not on, the function response time statistics function of Xhprof may not be turned on, so that the performance test indicator is based on the performance test The acquisition frequency of each time the performance test indicator is collected, the response time of each function is not collected.
本实施例可以通过调用Xhprof提供的相应的API(Application Programming Interface,应用程序编程接口)来采集函数标识、函数占用CPU情况、函数占用内存情况、函数在预定时间间隔内调用次数以及函数响应时间等性能参数指标。In this embodiment, the function identifier, the CPU occupied by the function, the memory occupied by the function, the number of times the function is called in a predetermined time interval, and the response time of the function are collected by calling the corresponding API (Application Programming Interface) provided by Xhprof. Performance parameter indicator.
获取性能参数指标的一个具体的例子为:A specific example of obtaining performance parameter indicators is:
$mu=$PerformaceInfo[′mu′];(mu表示通过采集获取到的函数占用内存的字节数,且单位为字节)$mu=$PerformaceInfo['mu']; (mu indicates the number of bytes of memory occupied by the function acquired by the acquisition, and the unit is byte)
$wt=$PerformaceInfo[′wt′];(wt表示通过采集而获取到的函数响应的时间)$wt=$PerformaceInfo['wt']; (wt represents the time of the function response obtained by the acquisition)
$ct=$PerformaceInfo[′ct′];(ct表示通过采集而获取到的函数在预定时间间隔内调用次数)$ct=$PerformaceInfo['ct']; (ct indicates the number of times the function acquired by the acquisition is called within a predetermined time interval)
$cpu=$PerformaceInfo[′cpu′];(cpu表示通过采集而获取到的函数花费的CPU时间(单位为微秒,即百万分之一秒))$cpu=$PerformaceInfo['cpu']; (cpu represents the CPU time (in microseconds, ie one millionth of a second) spent by the function acquired by the acquisition)
$wt=$wt/1000;(通过该计算式可以获得函数占用内存的字节数,且单位为KB)$wt=$wt/1000; (The number of bytes of memory occupied by the function can be obtained by this calculation, and the unit is KB)
由于在PHP程序性能测试过程中通常会模拟海量用户(如一百万用户甚至更多)对服务器进行访问,因此,在PHP程序中的每个函数在被调用时均进行性能测试指标采集的话,则会给服务器带来较大的资源消耗,从而给服务器带来较大的压力,这会影响到PHP程序性能测试的准确性。本实施例通过根据性能测试指标的采集频率来采集性能测试指标,可以避免PHP程序中的每个函数在被调用时均进行性能测试指标采集的现象,从而可以使获得的PHP程序性能测试的结果更准确。Since the PHP program performance test usually simulates a large number of users (such as a million users or more) to access the server, so each function in the PHP program is called when the performance test indicators are collected, This will bring a large resource consumption to the server, which will bring greater pressure on the server, which will affect the accuracy of the PHP program performance test. In this embodiment, by collecting the performance test indicators according to the acquisition frequency of the performance test indicators, it is possible to avoid the phenomenon that the performance test indicators are collected when each function in the PHP program is called, so that the obtained PHP program performance test result can be obtained. more acurrate.
S130、将PHP程序运行过程中每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记录均存储于同一个数据库中。S130. Store each performance test record including the function identifier and the performance test indicator generated by each acquisition in the PHP program in the same database.
具体的,本实施例多次采集获得的包含有函数标识以及性能测试指标的所有性能测试记录最终会存储于同一个数据库中,以便于执行后续的性能分析操作;而且,以数据库的方式存储本次PHP程序性能测试过程中所获得的所有性能测试记录还可以方便的比较该PHP程序在优化前后的性能测试结果,有利于测试人员权衡优化PHP程序的利弊。 Specifically, all performance test records including the function identifier and the performance test indicator obtained by the multiple collections in this embodiment are finally stored in the same database, so as to perform subsequent performance analysis operations; and, the database is stored in the manner of a database. All the performance test records obtained during the performance test of the PHP program can also conveniently compare the performance test results of the PHP program before and after optimization, which is beneficial to the testers to weigh the advantages and disadvantages of optimizing the PHP program.
采集到的所有的性能测试记录存储于同一个数据库中的具体实现方式主要有如下两种:The specific implementation methods of all the collected performance test records stored in the same database are as follows:
实现方式一、在配置文件中既设置有文本文件的路径信息和文件名称信息,又设置有数据库的路径信息和数据库名称信息的情况下,在PHP程序运行过程中,根据性能测试指标的采集频率以及采集控制参数中的其他相应的参数项采集到的包含有函数标识以及性能测试指标的各性能测试记录会先根据配置文件中的文本文件的路径信息和文件名称信息存储于文本文件中,在PHP程序运行结束后,再根据配置文件中的数据库的路径信息和数据库名称信息将该文本文件中的所有性能测试记录转存储于数据库中。Implementation method 1. In the configuration file, both the path information and the file name information of the text file are set, and the path information of the database and the database name information are set, in the process of running the PHP program, according to the frequency of collection of performance test indicators And the performance test records including the function identifier and the performance test indicator collected by the other corresponding parameter items in the acquisition control parameter are first stored in the text file according to the path information and the file name information of the text file in the configuration file, After the PHP program finishes running, all the performance test records in the text file are transferred to the database according to the path information of the database in the configuration file and the database name information.
实现方式二、在配置文件中没有设置文本文件的路径信息和文件名称信息,但是设置有数据库的路径信息和数据库名称信息的情况下,在PHP程序运行过程中,根据性能测试指标的采集频率以及采集控制参数中的其他相应的参数项采集到的包含有函数标识以及性能测试指标的各性能测试记录会直接根据配置文件中的数据库的路径信息和数据库名称信息存储于数据库中。Implementation 2: The path information and file name information of the text file are not set in the configuration file, but in the case where the path information of the database and the database name information are set, the acquisition frequency of the performance test indicator is used in the running process of the PHP program and Each performance test record containing the function identifier and the performance test indicator collected by other corresponding parameter items in the acquisition control parameter is directly stored in the database according to the path information and database name information of the database in the configuration file.
上述性能测试记录可以为Xhprof所提供的log(日志)的形式。性能测试记录所包含的函数标识可以为函数名称等能够于唯一标识PHP程序中的一个函数的标识信息;性能测试记录所包含的除了函数标识之外的其他内容取决于采集控制参数中的参数项。从PHP性能全面分析的角度考虑,性能测试记录通常会包括函数占用CPU情况、函数占用内存情况、函数在预定时间间隔内调用次数以及函数响应时间。The above performance test record can be in the form of a log provided by Xhprof. The function identifier included in the performance test record may be identification information such as a function name that can uniquely identify a function in the PHP program; the content of the performance test record other than the function identifier depends on the parameter item in the acquisition control parameter. . From the perspective of comprehensive analysis of PHP performance, performance test records usually include the CPU usage of the function, the memory usage of the function, the number of times the function is called within a predetermined time interval, and the response time of the function.
上述函数占用CPU情况可以具体为:函数对CPU占用率和/或者函数对CPU的占用时间等;上述函数占用内存情况可以具体为:函数对内存占有率和/或者函数对内存占用时间等;上述函数在预定时间间隔调用次数可以具体为:函数在单位时间内被其他函数调用的次数和/或函数在单位时间内调用其他函数的次数等;上述函数响应时间可以具体为:从函数被其他函数调用开始到函数返回相应的结果所花费的时间。The CPU usage of the above function can be specifically as follows: the CPU usage of the function and/or the occupation time of the CPU by the function; the memory usage of the above function can be specifically: the function to the memory occupancy rate and/or the function to the memory occupation time, etc.; The number of times a function can be called at a predetermined time interval can be specifically: the number of times the function is called by other functions in a unit time and/or the number of times the function calls other functions in a unit time; the response time of the above function can be specifically as follows: The time it takes for the call to start until the function returns the corresponding result.
S140、根据数据库中存储的性能测试记录确定PHP程序中的函数的性能。S140. Determine performance of a function in the PHP program according to the performance test record stored in the database.
具体的,本实施例是对数据库中存储的各性能测试记录进行统计,并对统计结果进行分析来确定PHP程序中的函数的性能的。对数据库中存储的各性 能测试记录进行统计可以具体为:对属于同一个函数的性能测试指标分别进行统计计算(如求均值)。对统计结果进行分析确定PHP程序中的函数的性能可以具体为:将性能测试指标的统计计算结果与其对应的预先设置的阈值进行比较,选取出超过阈值的性能测试指标,将选取出的性能测试指标以及其所属的函数可以展示给测试用户,这些选取出的性能测试指标所属的函数是测试人员需要关注的函数;例如,可以通过对数据库中的性能测试记录的统计分析而选取出分别占用CPU最多、占用内存最多、被调用次数最多以及响应时间最慢的前10位的函数,实现函数定位,测试人员可以有针对性的对定位出的函数进行分析改进。上述预先设置的阈值可以是根据测试经验预先设置的阀值。如果在PHP程序性能测试过程中,采集到的性能测试记录需要实时的展现给测试人员,则超出预先设置的阈值的性能测试记录可以展现为不同的颜色,如字体为红色或者采用高亮方式显示。Specifically, in this embodiment, statistics are performed on each performance test record stored in the database, and the statistical result is analyzed to determine the performance of the function in the PHP program. The variousities stored in the database The test record can be statistically calculated as follows: statistical calculations (such as averaging) are performed on the performance test indicators belonging to the same function. The analysis of the statistical results determines that the performance of the function in the PHP program can be specifically as follows: the statistical calculation result of the performance test indicator is compared with the corresponding preset threshold value, and the performance test index exceeding the threshold value is selected, and the selected performance test is selected. The indicator and its associated function can be displayed to the test user. The function of the selected performance test indicator belongs to the function that the tester needs to pay attention to; for example, the CPU can be selected separately by statistical analysis of the performance test record in the database. The function of function ranking can be realized by the function of the top 10 functions with the most memory, the most memory, the most frequently called, and the slowest response time. The tester can analyze and improve the function that is located. The above-mentioned preset threshold may be a threshold set in advance according to test experience. If during the PHP program performance test, the collected performance test records need to be presented to the tester in real time, the performance test record exceeding the preset threshold may be displayed in different colors, such as the font is red or highlighted. .
另外,选取出的性能测试指标所属的函数所对应的所有的性能测试指标可以以折线图、统计表或者文本文件等方式呈现给测试人员;其中的折线图可以使测试人员更加直观方便的对需要改进的函数进行定位。In addition, all the performance test indicators corresponding to the function of the selected performance test indicator can be presented to the tester in the form of a line chart, a statistical table or a text file; the line chart can make the tester more intuitive and convenient. Improved function for positioning.
在采用折线图进行函数性能分析的情况下,二维坐标系的横坐标可以表示时间,二维坐标系的纵坐标可以表示性能测试指标的数值大小,这样,一个函数的一个性能测试指标可以根据其对应的采集时间而被表示于二维坐标轴中,从而该函数的多个性能测试指标形成一条折线。In the case of function analysis using a line graph, the abscissa of the two-dimensional coordinate system can represent time, and the ordinate of the two-dimensional coordinate system can represent the numerical value of the performance test index, so that a performance test indicator of a function can be based on The corresponding acquisition time is represented in the two-dimensional coordinate axis, so that the plurality of performance test indicators of the function form a broken line.
一个函数的多个性能测试指标所形成的多条折线可以表示在同一个二维坐标系中;例如,在同一个二维坐标系中示出了一个函数的四条折线,这四条折线分别是针对该函数的所有函数占用CPU情况而形成的第一条折线、针对该函数的所有函数占用内存情况而形成的第二条折线、针对该函数的所有函数在预定时间间隔内调用次数而形成的第三条折线、以及针对该函数的所有函数响应时间而形成的第四条折线。A plurality of polylines formed by a plurality of performance test indicators of a function may be represented in the same two-dimensional coordinate system; for example, four polylines of a function are shown in the same two-dimensional coordinate system, and the four polylines are respectively The first polyline formed by all the functions of the function occupying the CPU condition, the second polyline formed by occupying the memory condition for all functions of the function, and the number of calls for all functions of the function in a predetermined time interval Three polylines, and a fourth polyline formed for all function response times of the function.
另外,多个函数的同一性能测试指标所形成的多条折线可以表示在同一个二维坐标系中;例如,可以在同一个二维坐标系中示出四个函数的四条折线,这四条折线分别是属于第一个函数的所有函数占用CPU情况所形成的第一折线、属于第二个函数的所有函数占用CPU情况所形成的第二折线、属于第三 个函数的所有函数占用CPU情况所形成的第三折线以及属于第四个函数的所有函数占用CPU情况所形成的第四折线。In addition, multiple fold lines formed by the same performance test index of multiple functions may be represented in the same two-dimensional coordinate system; for example, four fold lines of four functions may be shown in the same two-dimensional coordinate system, and the four fold lines The first polyline formed by all the functions belonging to the first function occupying the CPU condition, the second polyline formed by all the functions belonging to the second function occupying the CPU condition, and belonging to the third All functions of a function occupy the third polyline formed by the CPU condition and the fourth polyline formed by the CPU condition of all functions belonging to the fourth function.
本实施例可以利用现有的绘图插件来绘制上述折线图,例如,将从数据库的性能测试记录中选取出的性能测试记录按照预先设定的方式提供给绘图插件,从而绘图插件可以根据其接收到的数据绘制出上述折线图。In this embodiment, the existing drawing plug-in can be used to draw the above-mentioned line graph. For example, the performance test record selected from the performance test record of the database is provided to the drawing plug-in according to a preset manner, so that the drawing plug-in can receive according to the same. The data obtained draws the above line chart.
本实施例通过对数据库中记录的所有性能测试记录的分析,可以使测试人员很方便的定位出PHP程序性能瓶颈,且数据库中记录的性能测试记录还可以很方便的和采用其他测试工具所获得的测试结果进行合并分析,以满足多种PHP程序的测试需求。In this embodiment, by analyzing the performance test records recorded in the database, the tester can conveniently locate the performance bottleneck of the PHP program, and the performance test record recorded in the database can be conveniently obtained by using other test tools. The test results are combined and analyzed to meet the testing needs of a variety of PHP programs.
实施例二、基于Xhprof的PHP程序性能测试装置,本实施例的装置可以设置于运行需要进行性能测试的PHP程序的服务器中。Embodiment 2: The Xhprof-based PHP program performance testing device, the device of this embodiment may be set in a server running a PHP program that needs to perform performance testing.
下面结合图2对本实施例的装置进行详细说明。The apparatus of this embodiment will be described in detail below with reference to FIG.
图2中示出的基于Xhprof的PHP程序性能测试装置通常设置于服务器中,且该装置主要包括:存储模块200、获取模块210、采集模块220、记录模块230以及性能模块240。The Xhprof-based PHP program performance test device shown in FIG. 2 is generally disposed in a server, and the device mainly includes: a storage module 200, an acquisition module 210, an acquisition module 220, a recording module 230, and a performance module 240.
存储模块200主要配置为预先设置有针对PHP程序的性能测试指标的采集控制参数,且这里的采集控制参数至少包括:性能测试指标的采集频率。The storage module 200 is mainly configured to preset an acquisition control parameter for a performance test indicator of the PHP program, and the collection control parameter herein includes at least: an acquisition frequency of the performance test indicator.
具体的,存储模块200中预先设置的性能测试指标的采集频率主要用于控制性能测试指标的采集频度。存储模块200中存储的采集控制参数还可以根据实际测试需求而包括:总采集控制开关、实时监控性能测试指标的控制开关、函数占用CPU情况的采集控制开关、函数占用内存情况的采集控制开关、函数在预定时间间隔内调用次数的采集控制开关以及函数响应时间的采集控制开关中的一个或者多个(甚至全部)。另外,存储模块200中存储的采集控制参数还可以包括:文本文件的路径信息和文件名称信息、以及数据库的路径信息和数据库名称信息中的一个或者两个。当然,本实施例也可以根据实际应用中的具体测试需求而添加或者删减存储模块200中存储的相应的参数项。Specifically, the frequency of the performance test indicators preset in the storage module 200 is mainly used to control the frequency of collection of the performance test indicators. The collection control parameters stored in the storage module 200 may also be included according to actual test requirements: a total acquisition control switch, a control switch for real-time monitoring performance test indicators, an acquisition control switch for a function occupying a CPU condition, and an acquisition control switch for a function occupying a memory condition, The function calls one or more (or even all) of the acquisition control switch of the number of times and the acquisition control switch of the function response time within a predetermined time interval. In addition, the collection control parameters stored in the storage module 200 may further include: one or two of path information and file name information of the text file, and path information and database name information of the database. Certainly, the embodiment may also add or delete corresponding parameter items stored in the storage module 200 according to specific testing requirements in actual applications.
上述总采集控制开关、实时监控性能测试指标的控制开关、函数占用CPU情况的采集控制开关、函数占用内存情况的采集控制开关、函数在预定时间间隔内调用次数的采集控制开关、函数响应时间的采集控制开关、文本文件的路 径信息和文件名称信息、以及数据库的路径信息和数据库名称信息具体如上述方法实施例中的描述,在此不再重复说明。The above-mentioned total acquisition control switch, control switch for real-time monitoring performance test index, acquisition control switch for function occupying CPU condition, acquisition control switch for function occupying memory condition, acquisition control switch for function call number within a predetermined time interval, function response time Collect control switch, text file path The path information and the file name information, as well as the path information and the database name information of the database are specifically described in the foregoing method embodiments, and the description thereof will not be repeated here.
存储模块200可以采用配置文件的形式来存储采集控制参数。The storage module 200 can store the acquisition control parameters in the form of a configuration file.
获取模块210主要配置为在模拟海量用户对服务器进行访问以测试服务器中的PHP程序性能的过程中,获取采集控制参数。The obtaining module 210 is mainly configured to acquire acquisition control parameters in a process of simulating a mass user accessing the server to test the performance of the PHP program in the server.
具体的,获取模块210可以从存储模块200中获取采集控制参数,且采集控制参数中的各参数项的具体取值可以根据PHP程序性能测试需求的不同而被更改。为了方便设置采集控制参数中各参数项的取值,获取模块210可以在PHP程序性能测试的开始阶段显示采集控制参数的设置界面,该界面中显示有采集控制参数所包含的所有参数项的名称以及各参数项的当前取值(如缺省值),用户可以通过该界面来设置各参数项的具体取值,如通过该界面将性能测试指标的采集频率设置为预定时间间隔、将总采集控制开关的取值设置为开、将实时监控性能测试指标的控制开关的取值设置为关、将函数占用CPU情况的采集控制开关设置为开、将函数占用内存情况的采集控制开关设置为开、将函数在预定时间间隔内调用次数的采集控制开关设置为开、将函数响应时间的采集控制开关设置为开、设置文本文件的路径信息和文件名称信息以及数据库的路径信息和数据库名称信息,然后,通过点击采集控制参数设置界面中的保存按钮等方式,使上述设置的参数项的具体取值本地存储于存储模块200中的配置文件中。Specifically, the obtaining module 210 may obtain the acquisition control parameters from the storage module 200, and the specific values of the parameter items in the collection control parameters may be changed according to different requirements of the PHP program performance test. In order to conveniently set the value of each parameter item in the acquisition control parameter, the obtaining module 210 may display a setting interface of the acquisition control parameter at the beginning stage of the PHP program performance test, where the name of all the parameter items included in the acquisition control parameter is displayed. And the current value of each parameter item (such as the default value), the user can set the specific value of each parameter item through the interface, for example, the acquisition frequency of the performance test indicator is set to a predetermined time interval through the interface, and the total collection is performed. The value of the control switch is set to ON, the value of the control switch of the real-time monitoring performance test indicator is set to off, the acquisition control switch that takes the function of the CPU is set to ON, and the acquisition control switch of the function occupying the memory is set to ON. Set the acquisition control switch of the function to the number of calls in the predetermined time interval to ON, set the acquisition control switch of the function response time to ON, set the path information and file name information of the text file, and the path information and database name information of the database. Then, click on the save button in the acquisition control parameter setting interface. Etc., so that the specific parameter item setting values stored in the local configuration file storage module 200.
采集模块220主要配置为根据采集控制参数采集PHP程序中的各函数在测试过程中的性能测试指标。The acquisition module 220 is mainly configured to collect performance test indicators of each function in the PHP program during the test according to the acquisition control parameters.
具体的,采集模块220应根据获取模块210获得到的采集控制参数中的各参数项的设置值来执行性能测试指标的采集操作,一个具体的例子:Specifically, the collection module 220 should perform the collection operation of the performance test indicator according to the set value of each parameter item in the acquisition control parameter obtained by the acquisition module 210, a specific example:
在采集控制参数中的总采集控制开关的设置值为开的情况下,采集模块220应根据性能测试指标的采集频率来执行性能测试指标的采集操作;在采集控制参数中的总采集控制开关的设置值不为开的情况下,则采集模块220不会执行任何性能测试指标的采集操作。In the case that the setting value of the total acquisition control switch in the acquisition control parameter is ON, the acquisition module 220 should perform the acquisition operation of the performance test indicator according to the acquisition frequency of the performance test index; the total acquisition control switch in the acquisition control parameter If the set value is not on, the acquisition module 220 does not perform any acquisition operation of the performance test indicator.
在实时监控性能测试指标的控制开关的设置值为开的情况下,采集模块220应在根据性能测试指标的采集频率每次执行了性能测试指标的采集操作时,将采集到的性能测试指标实时显示给用户,如根据采集到的性能测试指标 生成一个链接,并在监控页面中实时显示该链接的内容;在实时监控性能测试指标的控制开关的设置值不为开的情况下,则采集模块220不会执行上述实时显示的操作。In the case that the setting value of the control switch of the real-time monitoring performance test indicator is ON, the acquisition module 220 should perform the performance test indicator collected in real time each time the performance test indicator is collected according to the acquisition frequency of the performance test indicator. Displayed to the user, such as based on the collected performance test indicators A link is generated, and the content of the link is displayed in real time in the monitoring page; if the setting value of the control switch of the real-time monitoring performance test indicator is not on, the collecting module 220 does not perform the above-mentioned real-time display operation.
在函数占用CPU情况的采集控制开关的设置值为开的情况下,采集模块220应在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均应采集函数占用CPU情况这一性能测试指标;在函数占用CPU情况的采集控制开关的设置值不为开的情况下,则采集模块220在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均不需要采集函数占用CPU情况这一性能测试指标。In the case that the setting value of the acquisition control switch of the function occupying the CPU is ON, the acquisition module 220 should collect the CPU usage of the function when the performance of the performance test indicator is performed every time according to the acquisition frequency of the performance test index. Performance test indicator; in the case that the setting value of the acquisition control switch of the function occupying the CPU is not on, the acquisition module 220 does not need to collect each time the performance of the performance test indicator is performed according to the acquisition frequency of the performance test indicator. The function takes up the CPU condition as a performance test indicator.
在函数占用内存情况的采集控制开关的设置值为开的情况下,采集模块220应在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均应采集函数占用内存情况这一性能测试指标;在函数占用内存情况的采集控制开关的设置值不为开的情况下,则采集模块220在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均不需要采集函数占用内存情况这一性能测试指标。In the case that the setting value of the acquisition control switch of the function occupying the memory is on, the acquisition module 220 should collect the memory occupied by the function each time the performance of the performance test indicator is performed according to the acquisition frequency of the performance test index. Performance test indicator; in the case that the setting value of the acquisition control switch of the function occupying the memory is not on, the acquisition module 220 does not need to collect each time the performance test indicator is collected according to the acquisition frequency of the performance test indicator. The function takes up the memory condition as a performance test indicator.
在函数在预定时间间隔内调用次数(如在单位时间内调用次数)的采集控制开关的设置值为开的情况下,采集模块220应开启Xhprof的方法调用次数统计功能,这样,采集模块220在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均可以采集到函数在预定时间间隔内调用次数这一性能测试指标;在函数在预定时间间隔内调用次数(如函数在单位时间内调用次数)的采集控制开关的设置值不为开的情况下,则采集模块220可以不开启Xhprof的调用次数统计功能,这样,采集模块220在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,也不会采集到函数在预定时间间隔内调用次数这一性能测试指标。In the case that the setting value of the acquisition control switch of the function in the predetermined time interval (such as the number of calls in the unit time) is ON, the acquisition module 220 should enable the method call counting function of Xhprof, so that the acquisition module 220 is According to the acquisition frequency of the performance test indicator, each time the performance test indicator is collected, the performance test index of the function call time in the predetermined time interval can be collected; the function is called in the predetermined time interval (such as the function in the unit) In the case that the setting value of the acquisition control switch is not on, the acquisition module 220 may not enable the Xhprof call count statistics function, so that the acquisition module 220 performs performance each time according to the acquisition frequency of the performance test indicator. When the test indicator is collected, the performance test indicator of the number of times the function is called within a predetermined time interval is not collected.
在函数响应时间的采集控制开关的设置值为开的情况下,采集模块220应开启Xhprof的函数响应时间统计功能,这样,采集模块220在根据性能测试指标的采集频率每次执行性能测试指标的采集操作时,均可以采集到各函数的响应时间这一性能测试指标;在函数响应时间的采集控制开关的设置值不为开的情况下,则采集模块220可以不开启Xhprof的函数响应时间统计功能,这样,采集模块220在根据性能测试指标的采集频率每次执行性能测试指标的 采集操作时,也不会采集到各函数的响应时间这一性能测试指标。In the case that the setting value of the acquisition control switch of the function response time is ON, the acquisition module 220 should enable the function response time statistics function of Xhprof, so that the acquisition module 220 executes the performance test index each time according to the acquisition frequency of the performance test indicator. During the acquisition operation, the performance test index of each function's response time can be collected; if the set value of the function control switch of the function response time is not on, the acquisition module 220 can not open the Xhprof function response time statistics. Function, such that the acquisition module 220 performs performance test indicators each time according to the acquisition frequency of the performance test indicators. When the acquisition operation is performed, the performance test index of the response time of each function is not collected.
采集模块220可以通过调用Xhprof提供的相应的API(Application Programming Interface,应用程序编程接口)来采集函数标识、函数占用CPU情况、函数占用内存情况、函数在预定时间间隔内调用次数以及函数响应时间等性能参数指标。The collection module 220 can collect the function identifier, the CPU usage of the function, the memory occupied by the function, the number of times the function is called within a predetermined time interval, and the response time of the function, etc. by calling the corresponding API (Application Programming Interface) provided by Xhprof. Performance parameter indicator.
由于在PHP程序性能测试过程中通常会模拟海量用户对服务器进行访问,因此,在PHP程序中的每个函数在被调用时采集模块220均进行性能测试指标采集的话,则会给服务器带来较大的资源消耗,从而给服务器带来较大的压力,这会影响到PHP程序性能测试的准确性。本实施例中的采集模块220通过根据性能测试指标的采集频率来采集性能测试指标,可以避免PHP程序中的每个函数在被调用时均进行性能测试指标采集的现象,从而可以使获得的PHP程序性能测试的结果更准确。Since the PHP user usually simulates the access of the server during the performance test of the PHP program, if each function in the PHP program is called, the acquisition module 220 performs the performance test index collection, which will bring the server a comparison. Large resource consumption, which puts a lot of pressure on the server, which will affect the accuracy of PHP program performance testing. The collection module 220 in this embodiment collects the performance test indicators according to the collection frequency of the performance test indicators, and can avoid the phenomenon that the performance test indicators are collected when each function in the PHP program is called, so that the obtained PHP can be obtained. The results of the program performance test are more accurate.
记录模块230主要配置为将PHP程序运行过程中每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记录均存储于同一个数据库中。The recording module 230 is mainly configured to store each performance test record including the function identifier and the performance test indicator formed by each acquisition in the PHP program running process in the same database.
具体的,采集模块220多次采集获得的包含有函数标识以及性能测试指标的所有性能测试记录最终会被记录模块230存储于同一个数据库中,以便于性能模块240执行后续的性能分析操作;而且,记录模块230以数据库的方式存储本次PHP程序性能测试过程中所获得的所有性能测试记录还可以方便测试人员比较该PHP程序在优化前后的性能测试结果,有利于测试人员权衡优化PHP程序的利弊。Specifically, all performance test records that are collected by the collection module 220 and that include the function identifier and the performance test indicator are finally stored in the same database by the recording module 230, so that the performance module 240 performs subsequent performance analysis operations; The recording module 230 stores all the performance test records obtained during the performance test of the PHP program in a database manner, and can also facilitate the tester to compare the performance test results of the PHP program before and after optimization, which is beneficial for the tester to weigh the optimization of the PHP program. Pros and cons.
记录模块230将采集模块220采集到的所有的性能测试记录存储于同一个数据库中的具体实现方式主要有如下两种:The specific implementation manners of the recording module 230 storing all the performance test records collected by the collection module 220 in the same database are as follows:
实现方式一、在配置文件中既设置有文本文件的路径信息和文件名称信息,又设置有数据库的路径信息和数据库名称信息的情况下,在PHP程序运行过程中,采集模块220根据性能测试指标的采集频率以及采集控制参数中的其他相应的参数项采集到的包含有函数标识以及性能测试指标的各性能测试记录会被记录模块230先根据配置文件中的文本文件的路径信息和文件名称信息存储于文本文件中,在PHP程序运行结束后,记录模块230再根据配置文件中的数据库的路径信息和数据库名称信息将该文本文件中的所有性能测试记录转存储于数据库中。 Implementation mode 1: In the configuration file, both the path information and the file name information of the text file are set, and the path information of the database and the database name information are set. In the running process of the PHP program, the collection module 220 according to the performance test index The performance test records collected by the acquisition frequency and other corresponding parameter items in the acquisition control parameters, including the function identifier and the performance test indicator, are recorded by the recording module 230 according to the path information and file name information of the text file in the configuration file. Stored in the text file, after the PHP program finishes running, the recording module 230 further stores all the performance test records in the text file in the database according to the path information of the database in the configuration file and the database name information.
实现方式二、在配置文件中没有设置文本文件的路径信息和文件名称信息,但是设置有数据库的路径信息和数据库名称信息的情况下,在PHP程序运行过程中,采集模块220根据性能测试指标的采集频率以及采集控制参数中的其他相应的参数项采集到的包含有函数标识以及性能测试指标的各性能测试记录会被记录模块230直接根据配置文件中的数据库的路径信息和数据库名称信息存储于数据库中。Implementation 2: In the configuration file, the path information and the file name information of the text file are not set, but in the case where the path information of the database and the database name information are set, during the running of the PHP program, the collection module 220 according to the performance test index The performance test records including the function identifier and the performance test indicator collected by the acquisition frequency and other corresponding parameter items in the acquisition control parameter are stored by the recording module 230 directly according to the path information and database name information of the database in the configuration file. In the database.
上述性能测试记录可以为Xhprof所提供的log(日志)的形式。性能测试记录所包含的函数标识可以为函数名称等能够于唯一标识PHP程序中的一个函数的标识信息;性能测试记录所包含的除了函数标识之外的其他内容取决于采集控制参数中的参数项。从PHP性能全面分析的角度考虑,性能测试记录通常会包括函数占用CPU情况、函数占用内存情况、函数在预定时间间隔内调用次数以及函数响应时间。The above performance test record can be in the form of a log provided by Xhprof. The function identifier included in the performance test record may be identification information such as a function name that can uniquely identify a function in the PHP program; the content of the performance test record other than the function identifier depends on the parameter item in the acquisition control parameter. . From the perspective of comprehensive analysis of PHP performance, performance test records usually include the CPU usage of the function, the memory usage of the function, the number of times the function is called within a predetermined time interval, and the response time of the function.
性能模块240主要配置为根据数据库中存储的性能测试记录确定PHP程序中的函数的性能。The performance module 240 is primarily configured to determine the performance of functions in the PHP program based on performance test records stored in the database.
具体的,性能模块240是对数据库中存储的各性能测试记录进行统计,并对统计结果进行分析来确定PHP程序中的函数的性能的。性能模块240对数据库中存储的各性能测试记录进行统计可以具体为:性能模块240对属于同一个函数的性能测试指标分别进行统计计算(如求均值)。性能模块240对统计结果进行分析确定PHP程序中的函数的性能可以具体为:性能模块240将性能测试指标的统计计算结果与其对应的预先设置的阈值进行比较,选取出超过阈值的性能测试指标,性能模块240将选取出的性能测试指标以及其所属的函数可以展示给测试人员,这些选取出的性能测试指标所属的函数是测试人员需要关注的函数;例如,性能模块240可以通过对数据库中的性能测试记录的统计分析而选取出分别占用CPU最多、占用内存最多、被调用次数最多以及响应时间最慢的前10位的函数,实现函数定位,测试人员可以有针对性的对定位出的函数进行分析改进。上述预先设置的阈值可以测试人员是根据测试经验预先设置的阀值。如果在PHP程序性能测试过程中,采集模块220采集到的性能测试记录需要实时的展现给测试人员,则超出预先设置的阈值的性能测试记录可以展现为不同的颜色,如字体为红色或者采用高亮方式显示。Specifically, the performance module 240 performs statistics on each performance test record stored in the database, and analyzes the statistical result to determine the performance of the function in the PHP program. The performance module 240 performs statistics on the performance test records stored in the database. The performance module 240 performs statistical calculations (such as averaging) on the performance test indicators belonging to the same function. The performance module 240 analyzes the statistical result to determine the performance of the function in the PHP program. The performance module 240 compares the statistical calculation result of the performance test indicator with a corresponding preset threshold value, and selects a performance test indicator that exceeds the threshold. The performance module 240 can display the selected performance test indicators and the functions to which they belong to the tester. The function of the selected performance test indicators belongs to a function that the tester needs to pay attention to; for example, the performance module 240 can pass through the database. The statistical analysis of the performance test records selects the top 10 functions that occupy the most CPU, the most memory, the most frequently called, and the slowest response time, to achieve function positioning, and the tester can target the function. Analyze improvements. The above preset thresholds can be used by testers to preset thresholds based on test experience. If the performance test record collected by the acquisition module 220 needs to be presented to the tester in real time during the performance test of the PHP program, the performance test record exceeding the preset threshold may be displayed in different colors, such as the font being red or high. Bright mode display.
另外,性能模块240选取出的性能测试指标所属的函数所对应的所有的性 能测试指标可以由性能模块240以折线图、统计表或者文本文件等方式呈现给测试人员;其中的折线图可以使测试人员更加直观方便的对需要改进的函数进行定位。In addition, all the properties corresponding to the function to which the performance test indicator selected by the performance module 240 belongs The test indicator can be presented to the tester by the performance module 240 in the form of a line chart, a statistical table or a text file; the line chart can make the tester more intuitive and convenient to locate the function to be improved.
测试人员性能模块240可以利用现有的绘图插件来绘制上述折线图,例如,性能模块240将从数据库的性能测试记录中选取出的性能测试记录按照预先设定的方式提供给绘图插件,从而绘图插件可以根据其接收到的数据绘制出上述折线图。具体的有关折线图的说明请参见上述方法实施例中的描述,在此不再重复说明。The tester performance module 240 can use the existing drawing plug-in to draw the above-mentioned line graph. For example, the performance module 240 provides the performance test record selected from the performance test record of the database to the drawing plug-in according to a preset manner, thereby drawing The plugin can draw the above line graph based on the data it receives. For details about the line drawing, refer to the description in the above method embodiment, and the description is not repeated here.
性能模块240通过对数据库中记录的所有性能测试记录的分析,可以使测试人员很方便的定位出PHP程序性能瓶颈,且数据库中记录的性能测试记录还可以很方便的和采用其他测试工具所获得的测试结果进行合并分析,以满足多种PHP程序的测试需求。The performance module 240 can easily locate the performance bottleneck of the PHP program by analyzing the performance test records recorded in the database, and the performance test record recorded in the database can be conveniently obtained by using other test tools. The test results are combined and analyzed to meet the testing needs of a variety of PHP programs.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的客户端或服务器中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者设备程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in a client or server in accordance with embodiments of the present invention. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图3示出了可以实现根据本发明上述方法的服务器,例如搜索引擎服务器。该服务器传统上包括处理器310和以存储器330形式的计算机程序产品或者计算机可读介质。存储器330可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器330具有用于执行上述方法中的任何方法步骤的程序代码351的存储空间350。例如,用于程序代码的存储空间350可以包括分别用于实现上面的方法中的各种步骤的各个程序代码351。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包 括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图4所述的便携式或者固定存储单元。该存储单元可以具有与图3的服务器中的存储器330类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码351’,即可以由例如诸如310之类的处理器读取的代码,这些代码当由服务器运行时,导致该服务器执行上面所描述的方法中的各个步骤。For example, Figure 3 illustrates a server, such as a search engine server, that can implement the above method in accordance with the present invention. The server traditionally includes a processor 310 and a computer program product or computer readable medium in the form of a memory 330. The memory 330 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Memory 330 has a memory space 350 for program code 351 for performing any of the method steps described above. For example, storage space 350 for program code may include various program code 351 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program packages A program code carrier such as a hard disk, a compact disk (CD), a memory card, or a floppy disk. Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG. The storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 330 in the server of FIG. The program code can be compressed, for example, in an appropriate form. Typically, the storage unit includes computer readable code 351', i.e., code that can be read by a processor, such as 310, which, when executed by a server, causes the server to perform various steps in the methods described above.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。&quot;an embodiment,&quot; or &quot;an embodiment,&quot; or &quot;an embodiment,&quot; In addition, it is noted that the phrase "in one embodiment" is not necessarily referring to the same embodiment.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。 In addition, it should be noted that the language used in the specification has been selected for the purpose of readability and teaching, and is not intended to be construed or limited. Therefore, many modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The disclosure of the present invention is intended to be illustrative, and not restrictive, and the scope of the invention is defined by the appended claims.

Claims (12)

  1. 一种程序性能测试方法,用于基于Xhprof的PHP程序性能测试,该方法包括:A program performance test method for testing performance of a PHP program based on Xhprof, the method comprising:
    预先设置针对待测试PHP程序的性能测试指标的采集控制参数,且所述采集控制参数至少包括:性能测试指标的采集频率;Presetting an acquisition control parameter for a performance test indicator of the PHP program to be tested, and the collection control parameter includes at least: an acquisition frequency of the performance test indicator;
    在模拟海量用户对服务器进行访问以测试服务器中的PHP程序性能的过程中,获取所述采集控制参数;Obtaining the acquisition control parameter during a process of simulating a mass user accessing the server to test the performance of the PHP program in the server;
    根据所述采集控制参数采集PHP程序中的各函数在测试过程中的性能测试指标;Collecting performance test indicators of each function in the PHP program during the test according to the collection control parameter;
    将PHP程序运行过程中每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记录均存储于同一个数据库中;Each performance test record containing the function identifier and the performance test indicator formed by each acquisition during the running of the PHP program is stored in the same database;
    根据所述数据库中存储的性能测试记录确定PHP程序中的函数的性能。The performance of the functions in the PHP program is determined based on the performance test records stored in the database.
  2. 如权利要求1所述的程序性能测试方法,其中,所述采集控制参数还包括:总采集控制开关以及实时监控性能测试指标的控制开关;The program performance testing method according to claim 1, wherein the acquisition control parameter further comprises: a total acquisition control switch and a control switch for real-time monitoring performance test indicators;
    且所述根据所述采集控制参数采集PHP程序中的各函数在测试过程中的性能测试指标包括:And the performance test indicators of the functions in the PHP program collected according to the collection control parameter in the testing process include:
    在所述总采集控制开关为开且所述实时监控性能测试指标的控制开关为开的情况下,基于所述采集控制参数中的其他参数设置值采集PHP程序中的各函数在测试过程中的性能测试指标,并将采集到的性能测试记录实时呈现。When the total acquisition control switch is on and the control switch of the real-time monitoring performance test indicator is on, collecting, according to other parameter setting values in the acquisition control parameter, each function in the PHP program is in the test process. Performance test indicators, and the collected performance test records are presented in real time.
  3. 如权利要求1或2所述的程序性能测试方法,其中,所述性能测试指标包括:函数占用CPU情况、函数占用内存情况、函数在预定时间间隔内的调用次数以及函数响应时间中的至少一个。The program performance testing method according to claim 1 or 2, wherein the performance test indicator comprises: at least one of a function occupying a CPU condition, a function occupying a memory condition, a function calling time within a predetermined time interval, and a function response time. .
  4. 如权利要求3所述的程序性能测试方法,其中,所述采集控制参数还包括:函数占用CPU情况的采集控制开关、函数占用内存情况的采集控制开关、函数在预定时间间隔内调用次数的采集控制开关以及函数响应时间的采集控制开关中的至少一个。The program performance testing method according to claim 3, wherein the acquisition control parameter further comprises: an acquisition control switch for the function occupying the CPU condition, an acquisition control switch for the function occupying the memory condition, and an acquisition of the function number of the function within a predetermined time interval. At least one of a control switch that controls a switch and a function response time.
  5. 如权利要求1所述的程序性能测试方法,其中,所述将PHP程序运行过程中每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记 录均存储于同一个数据库中包括:The program performance testing method according to claim 1, wherein each of the performance test records including the function identifier and the performance test indicator formed by each acquisition during the running of the PHP program is recorded. The records are stored in the same database including:
    在PHP程序运行过程中,将每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记录先存储于同一个文本文件中,且在PHP程序运行结束后,将所述文本文件中的所有性能测试记录存储于同一数据库中;或者在PHP程序运行过程中,将每次采集所形成的包含有函数标识以及性能测试指标的性能测试记录均直接存储于同一个数据库。During the running of the PHP program, each performance test record containing the function identifier and the performance test indicator formed by each acquisition is first stored in the same text file, and after the PHP program runs, the text file is All performance test records are stored in the same database; or during the running of the PHP program, the performance test records containing the function identification and performance test indicators generated by each acquisition are directly stored in the same database.
  6. 如权利要求5所述的程序性能测试方法,其中,所述采集控制参数还包括:文本文件的路径信息以及文件名称信息;和/或,数据库的路径信息以及数据库名称信息。The program performance testing method according to claim 5, wherein the acquisition control parameter further comprises: path information of the text file and file name information; and/or path information of the database and database name information.
  7. 如权利要求1所述的程序性能测试方法,其中,所述根据所述数据库中存储的性能测试记录确定PHP程序中各函数的性能包括:The program performance testing method according to claim 1, wherein said determining performance of each function in the PHP program based on the performance test record stored in said database comprises:
    从数据库存储的性能测试记录中选取性能测试指标超出预定阈值的性能测试记录,并根据选取的性能测试记录中的性能测试指标展现性能测试指标图示。A performance test record in which the performance test indicator exceeds a predetermined threshold is selected from the performance test record stored in the database, and the performance test indicator icon is displayed according to the performance test indicator in the selected performance test record.
  8. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算机上运行时,将执行根据权利要求1至7中的任一项所述的程序性能测试方法。A computer program comprising computer readable code, the program performance testing method according to any one of claims 1 to 7 being executed when the computer readable code is run on a computer.
  9. 一种计算机可读介质,其中存储了如权利要求8所述的计算机程序。A computer readable medium storing the computer program of claim 8.
  10. 一种程序性能测试装置,用于基于Xhprof的PHP程序性能测试,该装置包括:A program performance testing device for testing performance of a PHP program based on Xhprof, the device comprising:
    存储模块,配置为预先设置针对待测试PHP程序的性能测试指标的采集控制参数,且所述采集控制参数至少包括:性能测试指标的采集频率;a storage module, configured to preset an acquisition control parameter for a performance test indicator of the PHP program to be tested, and the collection control parameter includes at least: an acquisition frequency of the performance test indicator;
    获取模块,配置为在模拟海量用户对服务器进行访问以测试服务器中的PHP程序性能的过程中,获取所述采集控制参数;Obtaining a module, configured to acquire the collection control parameter during a process of simulating a mass user accessing the server to test the performance of the PHP program in the server;
    采集模块,配置为根据所述采集控制参数采集PHP程序中的各函数在测试过程中的性能测试指标;An acquisition module, configured to collect performance test indicators of each function in the PHP program during the test according to the collection control parameter;
    记录模块,配置为将PHP程序运行过程中每次采集所形成的包含有函数标识以及性能测试指标的各性能测试记录均存储于同一个数据库中; The recording module is configured to store, in each collection, the performance test records including the function identifier and the performance test indicator generated by the PHP program in the same database;
    性能模块,配置为根据所述数据库中存储的性能测试记录确定PHP程序中的函数的性能。A performance module configured to determine performance of a function in the PHP program based on performance test records stored in the database.
  11. 如权利要求10所述的程序性能测试装置,其中,所述采集控制参数还包括:总采集控制开关以及实时监控性能测试指标的控制开关;The program performance testing device according to claim 10, wherein the acquisition control parameter further comprises: a total acquisition control switch and a control switch for real-time monitoring performance test indicators;
    且所述采集模块还配置为:And the collection module is further configured to:
    在所述总采集控制开关为开且所述实时监控性能测试指标的控制开关为开的情况下,基于所述采集控制参数中的其他参数设置值采集PHP程序中的各函数在测试过程中的性能测试指标,并将采集到的性能测试记录实时呈现。When the total acquisition control switch is on and the control switch of the real-time monitoring performance test indicator is on, collecting, according to other parameter setting values in the acquisition control parameter, each function in the PHP program is in the test process. Performance test indicators, and the collected performance test records are presented in real time.
  12. 如权利要求10或11所述的程序性能测试装置,其中,所述性能测试指标包括:函数占用CPU情况、函数占用内存情况、函数在预定时间间隔内的调用次数以及函数响应时间中的至少一个;The program performance testing device according to claim 10 or 11, wherein the performance test indicator comprises: at least one of a function occupying a CPU condition, a function occupying a memory condition, a function calling time within a predetermined time interval, and a function response time. ;
    且所述采集控制参数还包括:函数占用CPU情况的采集控制开关、函数占用内存情况的采集控制开关、函数在预定时间间隔内调用次数的采集控制开关以及函数响应时间的采集控制开关中的至少一个。 And the collection control parameter further includes: an acquisition control switch that occupies a CPU condition, an acquisition control switch that functions to occupy a memory condition, an acquisition control switch that calls a function in a predetermined time interval, and at least an acquisition control switch of a function response time. One.
PCT/CN2015/083886 2014-07-16 2015-07-13 Program performance test method and device WO2016008398A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410338809.5 2014-07-16
CN201410338809.5A CN105335280A (en) 2014-07-16 2014-07-16 Program performance test method and device

Publications (1)

Publication Number Publication Date
WO2016008398A1 true WO2016008398A1 (en) 2016-01-21

Family

ID=55077912

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/083886 WO2016008398A1 (en) 2014-07-16 2015-07-13 Program performance test method and device

Country Status (2)

Country Link
CN (1) CN105335280A (en)
WO (1) WO2016008398A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021069A (en) * 2016-06-01 2016-10-12 北京金山安全软件有限公司 CPU occupation detection method, device and equipment
CN110177558A (en) * 2016-09-16 2019-08-27 贝勒医学院 The platform of activation and amplification for virus specific t cell
CN110275824A (en) * 2019-05-14 2019-09-24 浙江工业大学 A kind of computer software performance test methods
CN111104311A (en) * 2019-11-21 2020-05-05 贝壳技术有限公司 Detection method and detection device for optimizing effect of performance optimization
CN112148559A (en) * 2020-09-16 2020-12-29 上海中通吉网络技术有限公司 Mobile APP power consumption test method, device and system, acquisition end and test end
CN112965910A (en) * 2021-03-19 2021-06-15 携程旅游信息技术(上海)有限公司 Automatic regression testing method and device, electronic equipment and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933163B (en) * 2016-06-24 2019-08-27 微梦创科网络科技(中国)有限公司 The real-time distributed debugging tracking of one kind and system
CN106502887A (en) * 2016-10-13 2017-03-15 郑州云海信息技术有限公司 A kind of stability test method, test controller and system
CN106815017B (en) * 2016-12-26 2020-01-07 珠海金山网络游戏科技有限公司 Dynamic language performance analysis and display method and system
CN111309623B (en) * 2020-02-29 2024-04-16 平安科技(深圳)有限公司 Coordinate class data classification test method and device
CN111427755B (en) * 2020-03-10 2022-07-26 苏州浪潮智能科技有限公司 IO analysis method, device, equipment and medium for distributed file system
CN112596994A (en) * 2020-12-25 2021-04-02 福州掌中云科技有限公司 XHProf-based PHP program performance detection method and device
CN113778516A (en) * 2021-09-15 2021-12-10 山东派盟网络科技有限公司 Method, device and equipment for optimizing performance

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090192761A1 (en) * 2008-01-30 2009-07-30 Intuit Inc. Performance-testing a system with functional-test software and a transformation-accelerator
CN103049385A (en) * 2012-12-29 2013-04-17 百度在线网络技术(北京)有限公司 PHP (professional hypertext preprocessor) code debugging method and PHP code debugging system in cloud environment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012190345A (en) * 2011-03-11 2012-10-04 Nec Corp Automatic log information collecting device and automatic log information collecting method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090192761A1 (en) * 2008-01-30 2009-07-30 Intuit Inc. Performance-testing a system with functional-test software and a transformation-accelerator
CN103049385A (en) * 2012-12-29 2013-04-17 百度在线网络技术(北京)有限公司 PHP (professional hypertext preprocessor) code debugging method and PHP code debugging system in cloud environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Manual for Xhprof Php Lightweight Performance Analysis Tool ( Chinese Version) XHProf php", 1 June 2011 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021069A (en) * 2016-06-01 2016-10-12 北京金山安全软件有限公司 CPU occupation detection method, device and equipment
CN110177558A (en) * 2016-09-16 2019-08-27 贝勒医学院 The platform of activation and amplification for virus specific t cell
CN110275824A (en) * 2019-05-14 2019-09-24 浙江工业大学 A kind of computer software performance test methods
CN110275824B (en) * 2019-05-14 2023-02-28 浙江工业大学 Computer software performance testing method
CN111104311A (en) * 2019-11-21 2020-05-05 贝壳技术有限公司 Detection method and detection device for optimizing effect of performance optimization
CN112148559A (en) * 2020-09-16 2020-12-29 上海中通吉网络技术有限公司 Mobile APP power consumption test method, device and system, acquisition end and test end
CN112965910A (en) * 2021-03-19 2021-06-15 携程旅游信息技术(上海)有限公司 Automatic regression testing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN105335280A (en) 2016-02-17

Similar Documents

Publication Publication Date Title
WO2016008398A1 (en) Program performance test method and device
CN107193750B (en) Script recording method and device
CN107480039B (en) Small file read-write performance test method and device for distributed storage system
CN110442511B (en) Visual embedded point testing method and device
US9639453B2 (en) Method and system for determining functional tests to execute based on code coverage
US20100005340A1 (en) Test execution of user SQL in database server code
US20200126662A1 (en) Method, device, and apparatus for detecting disease probability, and computer-readable storage medium
US8752023B2 (en) System, method and program product for executing a debugger
WO2017123203A1 (en) Determining visual testing coverages
CN110275878B (en) Service data detection method and device, computer equipment and storage medium
CN110362453A (en) Log statistic alarm method and device, terminal and storage medium
CN109871368B (en) Database detection method, database detection device, computer device and storage medium
US10613969B2 (en) Code coverage module with testing function identifier
CN110519263A (en) Anti- brush amount method, apparatus, equipment and computer readable storage medium
US20180232299A1 (en) Composing future tests
CN104933105B (en) The analysis method and device of database access request
CN105912452A (en) Automated data analysis method and device
CN114385514A (en) Method, equipment and storage medium for detecting webpage elements
CN110879784B (en) Radar test data processing device and method thereof
CN112363915A (en) Method and device for page performance test, terminal equipment and storage medium
CN113742213A (en) Method, system, and medium for data analysis
CN112579440A (en) Method and device for determining virtual test dependent object
CN112153375A (en) Front-end performance testing method, device, equipment and medium based on video information
CN113238901A (en) Multi-device automatic testing method and device, storage medium and computer device
WO2021104027A1 (en) Code performance testing method, apparatus and device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15822529

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15822529

Country of ref document: EP

Kind code of ref document: A1