CN110362483A - Performance data acquisition method, device, equipment and storage medium - Google Patents
Performance data acquisition method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN110362483A CN110362483A CN201910541820.4A CN201910541820A CN110362483A CN 110362483 A CN110362483 A CN 110362483A CN 201910541820 A CN201910541820 A CN 201910541820A CN 110362483 A CN110362483 A CN 110362483A
- Authority
- CN
- China
- Prior art keywords
- performance data
- application program
- measured
- test case
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention relates to data acquisition, a kind of performance data acquisition method, device, equipment and storage medium are disclosed, this method comprises: when receiving automatic test instruction, according to automatic test instruct in include field information determine application program to be measured;It is read from test case library based on field information and executes corresponding test case script;It obtains the data retrieval commands generated during test case script execution and data retrieval commands is sent to application program to be measured;And presetting database is written after pre-processing to the performance data and saves, the acquisition data automated by then passing through implementation of test cases script, compared to the existing data acquisition modes for integrating third party software development kit in program code, the present invention can realize to low-cost high-efficiency the acquisition to application program capacity data while the safety for ensuring program code.
Description
Technical field
The present invention relates to automatization testing technique field more particularly to a kind of performance data acquisition method, device, equipment and
Storage medium.
Background technique
Currently, in computer software fields, most importantly collapse rate in the exploitation of mobile terminal, when collapse rate settles out
Afterwards, the center of gravity of the work of mobile terminal is transferred in performance optimization.
Nowadays there are the performances prisons such as third party software such as GT (adjusting with oneself), the Wetest (a kind of test platform) of many maturations
Software is controlled, performance monitoring could be carried out in application program (Application, App) code by needing for third party software to be integrated into,
There are code datas dangerous, high charging problem, while accessing third-party Software Development Kit (Software
Development Kit, SDK) the backpack body product that will increase test App is wrapped, but since the function accounting used in SDK is seldom,
The problem of App response speed reduces is instead resulted in.Therefore, how while guaranteeing application code Information Security,
It realizes to low-cost high-efficiency the acquisition to application program capacity data, just becomes a urgent problem to be solved.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill
Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of performance data acquisition method, device, equipment and storage medium, purports
The prior art is being solved into when performance data collection, existing safety is low to application program, with high costs and collection result
The inadequate technical problem of accuracy.
To achieve the above object, it the present invention provides a kind of performance data acquisition method, the described method comprises the following steps:
Receive automatic test instruction when, according to the automatic test instruction in include field information determine to
Survey application program;
Corresponding test case script is read from test case library based on the field information, and is executed the test and used
Case script;
Obtain the data retrieval commands generated during the test case script execution, and by the data retrieval commands
It is sent to the application program to be measured;
Collecting performance data, and presetting database is written after pre-processing to the performance data and saves, it is described
Performance data is the data fed back when the application program to be measured responds the data retrieval commands.
Preferably, the field information includes application version number;
Described the step of application program to be measured is determined according to the field information for including in automatic test instruction, packet
It includes:
The application version number for including in the automatic test instruction is read, is extracted in the application version number
The application identities and examining system version information of carrying;
Corresponding application program is searched according to the application identities, and according to the examining system version information from finding
The application program in filter out application program to be measured.
Preferably, the step for reading corresponding test case script from test case library based on the field information
Suddenly, comprising:
The system version field for including in the examining system version information is read, in the system version field pre-established
The corresponding target of the system version field is searched in mapping relations between tested function point is tested function point;
It is searched from test case library and covers the test case script that all targets are tested function point.
Preferably, the data retrieval commands include that Caton is ordered than obtaining, the collecting performance data, and to the property
The step of write-in presetting database is saved after energy data are pre-processed, comprising:
The application program to be measured is acquired to the Caton than obtaining the data matrix fed back when order responds;
The matrix element of a line every in the data matrix is added and obtains several frame rate values, is obtained in the frame rate value
More than the target frame rate value of preset threshold;
The quantity of the target frame rate value is counted, and the application to be measured is obtained according to the quantity of the target frame rate value of statistics
The Caton ratio of program saves the Caton than write-in presetting database.
Preferably, the data retrieval commands further include that fluency acquisition is ordered, the collecting performance data, and to described
The step of write-in presetting database is saved after performance data is pre-processed, comprising:
It acquires the application program to be measured and obtains the fluency log fed back when order responds to the fluency;
From the totalframes and frame losing number read in the fluency log in preset period of time, calculated according to preset formula
The corresponding fluency of the application program to be measured, and fluency write-in presetting database is saved;
Wherein, the preset formula is fluency=frame per second * (totalframes-frame losing number)/totalframes.
Preferably, the data retrieval commands further include obtaining order the response time, the collecting performance data, and to institute
It states and the step of presetting database is saved is written after performance data is pre-processed, comprising:
It acquires the application program to be measured and obtains the time log generated when order responds to the response time;
The function timing that preset function is extracted from the time log obtains institute according to the function timing
The response time is stated, and response time write-in presetting database is saved.
Preferably, the preset function includes View.onTouchEvent function and View.Draw function;It is described from institute
The function timing for extracting preset function in time log is stated, the response time is obtained according to the function timing
Step, comprising:
When extracting corresponding event click when the View.onTouchEvent function executes from the time log
Between and the View.Draw function corresponding complete the time when executing;
The time difference between the event click time and the time of completing is calculated, using the time difference as sound
Between seasonable.
In addition, to achieve the above object, the present invention also proposes a kind of performance data collection device, described device includes:
Program determining module, for being wrapped according in automatic test instruction when receiving automatic test instruction
The field information contained determines application program to be measured;
Script determining module, for reading corresponding test case foot from test case library based on the field information
This, and execute the test case script;
Script execution module, for obtaining the data retrieval commands generated during the test case script execution, and
The data retrieval commands are sent to the application program to be measured;
Data acquisition module is used for collecting performance data, and present count is written after pre-processing to the performance data
It is saved according to library, the performance data application program to be measured is fed back when responding to the data retrieval commands
Data.
In addition, to achieve the above object, the present invention also proposes that a kind of performance data collection equipment, the equipment include: to deposit
Reservoir, processor and it is stored in the performance data collection program that can be run on the memory and on the processor, it is described
Performance data collection program is arranged for carrying out the step of performance data acquisition method as described above.
In addition, to achieve the above object, the present invention also proposes a kind of storage medium, performance is stored on the storage medium
Data acquisition program, the performance data collection program realize performance data collection side as described above when being executed by processor
The step of method.
The present invention by receive automatic test instruction when, according to automatic test instruct in include field information
Determine application program to be measured;Corresponding test case script is read from test case library based on field information, and executes test
Use case script;The data retrieval commands generated during test case script execution are obtained, and data retrieval commands are sent to
Application program to be measured;And presetting database is written after pre-processing to the performance data and saves, not due to the present invention
It needs to integrate third party software development kit in application code, it is only necessary to according to the test case script write in advance
Data collection can be completed, it is thus possible to while the safety for ensuring application code, realize to low-cost high-efficiency
Acquisition to application program capacity data.
Detailed description of the invention
Fig. 1 is the structural representation of the performance data collection equipment for the hardware running environment that the embodiment of the present invention is related to
Figure;
Fig. 2 is the flow diagram of performance data acquisition method first embodiment of the present invention;
Fig. 3 is the flow diagram of performance data acquisition method second embodiment of the present invention;
Fig. 4 is the flow diagram of performance data acquisition method 3rd embodiment of the present invention;
Fig. 5 is the structural block diagram of inventive energy data acquisition device first embodiment.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the performance data collection device structure for the hardware running environment that the embodiment of the present invention is related to
Schematic diagram.
As shown in Figure 1, the performance data collection equipment may include: processor 1001, such as central processing unit
(Central Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory
1005.Wherein, communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include display
Shield (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include that the wired of standard connects
Mouth, wireless interface.Network interface 1004 optionally may include standard wireline interface and wireless interface (such as Wireless Fidelity
(WIreless-FIdelity, WI-FI) interface).Memory 1005 can be the random access memory (Random of high speed
Access Memory, RAM) memory, be also possible to stable nonvolatile memory (Non-Volatile Memory,
), such as magnetic disk storage NVM.Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
It will be understood by those skilled in the art that structure shown in Fig. 1 does not constitute the limit to performance data collection equipment
It is fixed, it may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in Figure 1, as may include operating system, data storage mould in a kind of memory 1005 of storage medium
Block, network communication module, Subscriber Interface Module SIM and performance data collection program.
In performance data collection equipment shown in Fig. 1, network interface 1004 is mainly used for being counted with network server
According to communication;User interface 1003 is mainly used for carrying out data interaction with user;Processing in inventive energy data acquisition equipment
Device 1001, memory 1005 can be set in performance data collection equipment, and the performance data collection equipment passes through processor
The performance data collection program stored in 1001 calling memories 1005, and execute performance data provided in an embodiment of the present invention and adopt
Set method.
The embodiment of the invention provides a kind of performance data acquisition methods, and referring to Fig. 2, Fig. 2 is that performance data of the present invention is adopted
The flow diagram of set method first embodiment.
In the present embodiment, the performance data acquisition method the following steps are included:
Step S10: when receiving automatic test instruction, believed according to the field for including in automatic test instruction
Breath determines application program to be measured;
It should be noted that the executing subject of this programme method can be developer uses python language (one in advance
Kind of computer programming language) interface (User Interface, UI) automatic test cases script for writing, it can also
To be the test host or equipment (hereinafter referred to as test host) that can run the test case script, such as PC, notes
This computer etc..Developer can integrate when writing the test case script in corresponding scripted code in the present embodiment
Android SDK adb order and monkey order are to guarantee the automation collection of subsequent performance data.
In the present embodiment, the field information may include the corresponding application version number of application program to be measured, this applies version
This number can be by application identities (such as the Apply Names of application program or Custom Number/coding etc.) and application program to be measured institute
In system version information (such as system version number) group of mobile terminal (such as mobile phone, tablet computer, PC) current system
At.
In the concrete realization, test host can carry out parsing to the instruction when receiving automatic test instruction to root
The field information for including in instruction is read according to parsing result;Then it is determined according to the application version number for including in field information
The targeted fixed application program to be measured of this performance data collection out.
It will be appreciated that due to the difference of mobile terminal hardware and software, even with a application program, developer
Be also required to according to mobile terminal it is different to program code carry out adaptability modifications so that application program can difference
Mobile terminal on trouble-free operation.Therefore developer is when writing test case script in the present embodiment, first according to mobile whole
The brand at end/model/system version is different to carry out script edit respectively, the test case script for then writing these according to
Its function point tested is associated with (in examining system version information) system version field, so as to subsequent according to system
Version field realizes the quick lookup to test case script.
Further, in this embodiment the application version number for including in automatic test instruction can be read in test host,
And extract the application identities carried in application version number and examining system version information;Then according to application identities lookup pair
The application program answered filters out application program to be measured further according to examining system version information from the application program found.Example
Such as, test host can read application version number from automatic test instruction
" pinganyizhangtong.Android.7.0.0 " then extracts the application identities carried in application version number
" pinganyizhangtong " and examining system version information " Android.7.0.0 ";Then according to application identities
" pinganyizhangtong " searches the application program of different editions, further according to examining system version information
" Android.7.0.0 " filters out application program to be measured from the application program found.
Step S20: corresponding test case script is read from test case library based on the field information, and executes institute
State test case script;
It should be understood that storage has the test case foot for different test phases in test case library under normal conditions
This, such as pressure test stage corresponding test case script, performance test stage corresponding test case script.And it is different
The test dimension that test case script is directed to also is not quite similar, and with the upgrading of mobile terminal system version, also can band therewith
Come change and difference that application program realizes function, therefore, in order to ensure that test host can be more complete in automatic test course
The various functions point of the test application program in face, developer can be in advance by system version field and test case in the present embodiment
The tested function point that script is directed to is associated and establishes mapping relations between the two.
In the concrete realization, the system version field for including in the examining system version information can be read in test host,
It is corresponding that the system version field is searched in mapping relations between the system version field and tested function point pre-established
Target be tested function point;Then it is searched from test case library and covers the test case foot that all targets are tested function point
This.
Step S30: obtaining the data retrieval commands generated during the test case script execution, and by the data
It obtains order and is sent to the application program to be measured;
It should be noted that in order to realize the automation collection to application program App performance data, the test case foot
The data retrieval commands of all kinds of performance datas are integrated in this, such as memory obtains order " adb shell dumpsys
Meminfo com.paem ", CPU obtain order " adb shell top-n1 | grep com.paem ", Caton than obtaining order
" adb shell dumpsys SurfaceFlinger-latency ", fluency obtain order " adb logcat " etc..
In the concrete realization, test host can be performed after getting test case script the test case script thus
It obtains wherein integrated data retrieval commands and the data retrieval commands that will acquire is sent to application program to be measured, so as to
It surveys application program to respond these data retrieval commands received, and obtains the performance data during command response.
Step S40: collecting performance data, and presetting database is written after pre-processing to the performance data and protects
It deposits, the performance data is the data fed back when the application program to be measured responds the data retrieval commands.
It should be understood that performance test plays an important role in the quality assurance of software application, apply in client
The purpose of performance test is to investigate the performance of client application, and the entrance of test is client, it mainly includes that concurrency performance is surveyed
Examination, fatigue strength test, big data quantity test and velocity test etc..Wherein, concurrency performance test is particularly important, and concurrency performance is surveyed
The process of examination is the process of a load testing and pressure test, and load testing (Load Testing) is determined in various works
The performance of lower system is loaded, target is test when load gradually increases, the corresponding output item of system element, such as logical
Excess, response time, cpu load, memory such as use at the performance for carrying out decision systems.
In the concrete realization, test host can be called by executing above-mentioned test case script integrated in script it is all kinds of
Data retrieval commands, then acquire the memory fed back when application program to be measured responds these data retrieval commands, CPU,
The performance datas such as transmission frame number (Frames Per Second, FPS), fluency and response time per second.
The present embodiment by receive automatic test instruction when, according to automatic test instruct in include field believe
Breath determines application program to be measured;Corresponding test case script is read from test case library based on field information, and executes survey
Case script on probation;The data retrieval commands generated during test case script execution are obtained, and data retrieval commands are sent
To application program to be measured;And presetting database is written after pre-processing to the performance data and saves, due to this implementation
The example above method does not need to integrate third party software development kit in application code, it is thus possible to ensure application program
While the safety of code, the acquisition to application program capacity data is realized to low-cost high-efficiency.
With reference to Fig. 3, Fig. 3 is the flow diagram of performance data acquisition method second embodiment of the present invention.
Based on above-mentioned first embodiment, in the present embodiment, the data retrieval commands include Caton than obtaining order, phase
Ying Di, the step S40 can include:
Step S401: the acquisition application program to be measured is to the Caton than obtaining the data fed back when order responds
Matrix;
It should be understood that FPS (also referred to as Caton ratio) is the definition in image domains, refer to picture transmission frame number per second, leads to
Just refer to the frame numbers of animation or video for custom.FPS is the information content measured for saving, showing dynamic video, per second
The more, shown movement will be more smooth for clock frame number.
In the concrete realization, test host can call Caton integrated in advance in test case script than obtaining order " adb
Shell dumpsys SurfaceFlinger-latency " is so that application program to be measured is receiving the Caton than obtaining order
When, feed back corresponding FPS information.Under normal conditions, the system SurfaceFlinger of Android.4.0 or more will record recently
The information of 128 frames, therefore testing host can be by above-mentioned Caton than ordering above-mentioned FPS information from system (generally with data
Matrix form embodies) it reads out, the calculating of Caton ratio is then carried out again.
Step S402: the matrix element of a line every in the data matrix being added and obtains several frame rate values, obtains institute
State the target frame rate value in frame rate value more than preset threshold;
It should be noted that generally comprising the data of four dimensions in the data matrix: Draw, Prepare,
Process, Execute, and an in fact complete frame (frame rate value)=Draw+Prepare+Process+Execute, when this
A time, which is less than 16ms, just can guarantee 60 frame per second.For example, in data matrix certain a line data be Draw=4.08,
Prepare=3.31, Process=4.24, Execute=1.83, then frame rate value is equal to 13.46ms < 16ms, therefore can
Reach 60 frame per second.
In the concrete realization, test host, which can carry out each row matrix element in the data matrix to be added, obtains square
The corresponding frame rate value of every data line, all frame rate values that then will acquire are compared with preset threshold (16ms) in battle array,
Obtain the target frame rate value for being less than 16ms.
Step S403: the quantity of the target frame rate value is counted, and institute is obtained according to the quantity of the target frame rate value of statistics
The Caton ratio for stating application program to be measured saves the Caton than write-in presetting database.
In the present embodiment, host is tested after getting the target frame rate value, the number of the statistics available target frame rate value
Amount, then calculating accounting of the target frame rate value in the corresponding frame rate value of entire data matrix according to the quantity, (accounting is real
It is exactly the Caton ratio of current system on border), then the Caton that will acquire in write-in presetting database than being saved.
The present embodiment is by acquiring application program to be measured to Caton than obtaining the data matrix fed back when order responds;
The matrix element of a line every in data matrix is added and obtains several frame rate values, obtains the mesh in frame rate value more than preset threshold
Mark frame rate value;Then the quantity of target frame rate value is counted, and applies journey according to the acquisition of the quantity of the target frame rate value of statistics is to be measured
Caton is saved than write-in presetting database, is realized to utility card than this performance data by the Caton ratio of sequence
Accurate acquisition, ensure that the accuracy of performance test.
With reference to Fig. 4, Fig. 4 is the flow diagram of performance data acquisition method 3rd embodiment of the present invention.
Based on the various embodiments described above, in the present embodiment, the data retrieval commands further include that fluency obtains order, phase
Ying Di, the step S40 can include:
Step S401 ': the acquisition application program to be measured obtains the stream fed back when order responds to the fluency
Smooth will of subsisting;
It should be understood that competing more and more fierce today in mobile phone A pp, the properties of Android App are especially
Compared with IOS there is also gap, Android is run fluency based on java virtual machine, and the delay of touch-control response and Caton ratio IOS system are tight
It is much heavier.Such as it is some under pull on the operations such as sliding, two fingers scaling fast typing, the fluency of Android all show it is worse, but
It is whether smooth for App use process, the objective impression and data currently without a reliable index by user are right one by one
It answers.For such situation, the present embodiment performance data acquisition method considers by persistently obtaining application program to be measured at runtime
Fluency log and analysis is carried out to obtain the fluency index of application program to be measured to the fluency log got.
In the concrete realization, test host can call fluency integrated in advance in test case script to obtain order " adb
Logcat " is stored in local fluency log to read, and then carries out fluency analysis according to the fluency log.
Step S402 ': from the totalframes and frame losing number read in the fluency log in preset period of time, according to default
Formula calculates the corresponding fluency of the application program to be measured, and fluency write-in presetting database is saved.
It should be understood that in android system, vertical synchronization (Vertical Synchronization, VSync) machine
System is one kind widely used technology very early on PC, can simply consider it as a kind of Interruption, i.e. Android
System issues VSync signal every 16ms, and triggering renders UI.That is VSync mechanism is fixed just as a revolving speed
Engine (60 turns/s), each turn can all drive system to complete the relevant operation of some UI.Therefore work as and face a certain item more
When the work of complexity, consumption will also bring the change of revolving speed more than 16.6ms when the rising of workload will lead to work.Based on above-mentioned
Principle, the present embodiment consider to judge the fluency of application program by obtaining this revolving speed.
In the concrete realization, test host can be by reading preset period of time (such as 1 from the fluency log got
Second) in totalframes and frame losing number, then according to preset formula " fluency=frame per second * (totalframes-frame losing number)/totalframes "
The corresponding fluency of application program to be measured is calculated, and fluency write-in presetting database is saved.
Further, monkey stability test mistake can also carried out in performance data acquisition method provided in this embodiment
The collection operation of performance data is carried out in journey.
It should be understood that Monkey is a command-line tool, Android debugging bridge (adb) can be used to run it, use
The Streams of Random Events such as screen, sliding Trackball, key are touched with analog subscriber to carry out pressure to the application program in equipment
Test, detection application program time how long can be abnormal, and monkey stability is mainly reflected in collapse rate, under normal conditions
Collapse rate is completed in the pressure test carried out before performance test, and the present embodiment is in order to guarantee system crash rate in performance test
Stabilization, in the collapse rate for carrying out also investigating application program when performance data manipulation.
Specifically, the test case script can be performed in test host, so that the script is sent out to application APP to be tested
Send preset monkey order;Application APP to be tested is collected the monkey order and is executed when receiving monkey order
When corresponding pressure test information, and by the pressure test information preservation to journal file;It reads in the journal file and wraps
The program starting number and collapse number contained, passes through formula " collapse rate=collapse number/starting number " according to the starting number and collapse number
Calculate corresponding collapse rate.
The smoothness that the present embodiment is fed back when obtaining to fluency by acquiring application program to be measured and order and respond is subsisted
Will;From the totalframes and frame losing number read in fluency log in preset period of time, according to preset formula " fluency=frame per second *
(totalframes-frame losing number)/totalframes " calculates the corresponding fluency of application program to be measured, and preset data is written in fluency
Library is saved, and can relatively accurately realize the acquisition freely spent to application flow, compared to existing fluency judge side
Formula, fluency acquisition mode provided in this embodiment can more be truly reflected the fluency of application program.
Based on the various embodiments described above, performance data acquisition method fourth embodiment of the present invention is proposed.
In the present embodiment, the data retrieval commands further include the response time obtaining order, and the step S40 can be specific
The following steps are included:
Step: the acquisition application program to be measured the response time is obtained generated when order responds when every other day
Will;
It should be understood that under normal conditions, whether a application program App can be depended on user by public favor
Direct feel when using App.For a user, since clicking a button, linking or issuing an instruction, system is arrived
Result until the form that user perceives is shown, the time consumed by this process is user to this software performance
Visual impression, that is, so-called response time, when the corresponding time is smaller, user experience is opposite just high.
It will be appreciated that android system is when the click event to user is handled, usually by View control Lai
It completes, the present embodiment will press application program page elements as system in terminal interface and receive touch/click event, will
The corresponding menu page of page elements pops up completely completes menu drafting as application program.Therefore host is tested in the present embodiment
Preset function in xposed frame can be monitored, in View.dispatchTouchEvent or
View.onTouchEvent function prints time log (log) before executing, then using the time log corresponding time as use
Click the time in family.Drafting additionally, due to Android control be each view (view) is successively carried out measure,
Layout, draw etc. operation, then can by monitoring xposed frame View.Draw function execution after print time log log,
Then using the time log corresponding time as the time of completing, finally again by calculating the time difference of the two times,
The response time can be obtained.
In the concrete realization, test host can first acquire application program to be measured when receiving response time acquisition order
The time log generated when order responds is obtained to the response time.
Step: the function timing of preset function is extracted from the time log, according to the function timing
The response time is obtained, and response time write-in presetting database is saved.
It should be understood that preset function described in this step includes View.onTouchEvent function and View.Draw letter
Number.
In the concrete realization, test host can extract the View.onTouchEvent from the time log got
Function is corresponding when corresponding event clicks time and the View.Draw function execution when executing to complete the time;So
The time difference between the event click time and the time of completing is calculated afterwards, when by the time difference in response
Between, the accurate acquisition to the response time can be realized.
The present embodiment by acquire application program to be measured the response time is obtained generated when order responds when every other day
Will;The function timing that preset function is extracted from time log obtains the response time according to function timing, and will ring
Write-in presetting database is saved between seasonable, to realize the accurate acquisition to the application program response time, also can guarantee
The response time got confidence level with higher.
In addition, the embodiment of the present invention also proposes a kind of storage medium, performance data collection is stored on the storage medium
Program, the performance data collection program realize the step of performance data acquisition method as described above when being executed by processor
Suddenly.
It is the structural block diagram of inventive energy data acquisition device first embodiment referring to Fig. 5, Fig. 5.
As shown in figure 5, the performance data collection device that the embodiment of the present invention proposes includes:
Program determining module 501, for receive automatic test instruction when, according to the automatic test instruction in
The field information for including determines application program to be measured;
Script determining module 502, for reading corresponding test case from test case library based on the field information
Script, and execute the test case script;
Script execution module 503, for obtaining the data retrieval commands generated during the test case script execution,
And the data retrieval commands are sent to the application program to be measured;
Data acquisition module 504 is used for collecting performance data, and is written after pre-processing to the performance data default
Database is saved, and the performance data is feedback when the application program to be measured responds the data retrieval commands
Data.
The present embodiment by receive automatic test instruction when, according to automatic test instruct in include field believe
Breath determines application program to be measured;Corresponding test case script is read from test case library based on field information, and executes survey
Case script on probation;The data retrieval commands generated during test case script execution are obtained, and data retrieval commands are sent
To application program to be measured;And presetting database is written after pre-processing to the performance data and saves, due to this implementation
The example above method does not need to integrate third party software development kit in application code, it is thus possible to ensure application program
While the safety of code, the acquisition to application program capacity data is realized to low-cost high-efficiency.
Based on the above-mentioned performance data collection device first embodiment of the present invention, inventive energy data acquisition device is proposed
Second embodiment.
In the present embodiment, the script determining module 502, is also used to read in automatic test instruction and includes
The application version number extracts the application identities carried in the application version number and examining system version information;Root
Corresponding application program is searched according to the application identities, and according to the examining system version information from the application found
Application program to be measured is filtered out in program.
Further, the script determining module 502, be also used to read include in the examining system version information be
It unites version field, searches the system version in the mapping relations between the system version field and tested function point pre-established
The corresponding target of this field is tested function point;It is searched from test case library and covers the test that all targets are tested function point
Use case script.
Further, the data acquisition module 504 is also used to acquire the application program to be measured and obtains to the Caton ratio
The data matrix fed back when order being taken to be responded;The matrix element of a line every in the data matrix is added and obtains several
Frame rate value obtains the target frame rate value in the frame rate value more than preset threshold;Count the quantity of the target frame rate value, and root
The quantity of target frame rate value according to statistics obtains the Caton ratio of the application program to be measured, by the Caton than write-in preset data
Library is saved.
Further, the data acquisition module 504 is also used to acquire the application program to be measured and obtains to the fluency
The fluency log fed back when order being taken to be responded;From in the fluency log read preset period of time in totalframes and
Frame losing number calculates the corresponding fluency of the application program to be measured according to preset formula, and the fluency is written and is preset
Database is saved;Wherein, the preset formula is fluency=frame per second * (totalframes-frame losing number)/totalframes.
Further, the data acquisition module 504 is also used to acquire the application program to be measured to the response time
Obtain the time log generated when order is responded;The function timing of preset function is extracted from the time log,
The response time is obtained according to the function timing, and response time write-in presetting database is saved.
Further, the data acquisition module 504 is also used to extract from the time log
View.onTouchEvent function is corresponding when corresponding event clicks time and the execution of View.Draw function when executing to be drawn
Deadline processed;The time difference between the event click time and the time of completing is calculated, the time difference is made
For the response time.
The other embodiments or specific implementation of inventive energy data acquisition device can refer to above-mentioned each method and implement
Example, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as read-only memory/random access memory, magnetic disk, CD), including some instructions are used so that a terminal device (can
To be mobile phone, computer, server, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of performance data acquisition method, which is characterized in that the described method includes:
When receiving automatic test instruction, to be measured answer is determined according to the field information for including in automatic test instruction
Use program;
Corresponding test case script is read from test case library based on the field information, and executes the test case foot
This;
The data retrieval commands generated during the test case script execution are obtained, and the data retrieval commands are sent
To the application program to be measured;
Collecting performance data, and presetting database is written after pre-processing to the performance data and saves, the performance
Data are the data fed back when the application program to be measured responds the data retrieval commands.
2. the method as described in claim 1, which is characterized in that the field information includes application version number;
Described the step of application program to be measured is determined according to the field information for including in automatic test instruction, comprising:
The application version number for including in the automatic test instruction is read, extracts and is carried in the application version number
Application identities and examining system version information;
Corresponding application program is searched according to the application identities, and according to the examining system version information from the institute found
It states and filters out application program to be measured in application program.
3. method according to claim 2, which is characterized in that described to be read from test case library based on the field information
The step of corresponding test case script, comprising:
Read the system version field for including in the examining system version information, the system version field pre-established and by
The corresponding target of the system version field is searched in mapping relations between brake point is tested function point;
It is searched from test case library and covers the test case script that all targets are tested function point.
4. the method as described in claim 1, which is characterized in that the data retrieval commands include Caton than obtaining order;
The collecting performance data, and the step that presetting database is saved is written after pre-processing to the performance data
Suddenly, comprising:
The application program to be measured is acquired to the Caton than obtaining the data matrix fed back when order responds;
The matrix element of a line every in the data matrix is added and obtains several frame rate values, obtains in the frame rate value and is more than
The target frame rate value of preset threshold;
The quantity of the target frame rate value is counted, and the application program to be measured is obtained according to the quantity of the target frame rate value of statistics
Caton ratio, by the Caton than write-in presetting database save.
5. the method as described in claim 1, which is characterized in that the data retrieval commands further include that fluency obtains order;
The collecting performance data, and the step that presetting database is saved is written after pre-processing to the performance data
Suddenly, comprising:
It acquires the application program to be measured and obtains the fluency log fed back when order responds to the fluency;
From the totalframes and frame losing number read in the fluency log in preset period of time, calculated according to preset formula described
The corresponding fluency of application program to be measured, and fluency write-in presetting database is saved;
Wherein, the preset formula is fluency=frame per second * (totalframes-frame losing number)/totalframes.
6. the method as described in claim 1, which is characterized in that the data retrieval commands further include the response time obtaining life
It enables;
The collecting performance data, and the step that presetting database is saved is written after pre-processing to the performance data
Suddenly, comprising:
It acquires the application program to be measured and obtains the time log generated when order responds to the response time;
The function timing that preset function is extracted from the time log obtains the sound according to the function timing
Between seasonable, and response time write-in presetting database is saved.
7. method as claimed in claim 6, which is characterized in that the preset function includes View.on TouchEvent function
With View.Draw function;
The function timing that preset function is extracted from the time log obtains institute according to the function timing
The step of stating the response time, comprising:
Corresponding event when the View.onTouchEvent function executes is extracted from the time log clicks the time, with
And the View.Draw function is corresponding when executing completes the time;
The time difference between the event click time and the time of completing is calculated, when by the time difference in response
Between.
8. a kind of performance data collection device, which is characterized in that described device includes:
Program determining module, for including according in automatic test instruction when receiving automatic test instruction
Field information determines application program to be measured;
Script determining module, for reading corresponding test case script from test case library based on the field information, and
Execute the test case script;
Script execution module, for obtaining the data retrieval commands generated during the test case script execution, and by institute
It states data retrieval commands and is sent to the application program to be measured;
Data acquisition module is used for collecting performance data, and presetting database is written after pre-processing to the performance data
It is saved, the performance data is the number fed back when the application program to be measured responds the data retrieval commands
According to.
9. a kind of performance data collection equipment, which is characterized in that the equipment includes: memory, processor and is stored in described
On memory and the performance data collection program that can run on the processor, the performance data collection program are configured to reality
Now the step of performance data acquisition method as described in any one of claims 1 to 7.
10. a kind of storage medium, which is characterized in that be stored with performance data collection program, the performance on the storage medium
The step of performance data acquisition method as described in any one of claim 1 to 7 is realized when data acquisition program is executed by processor
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910541820.4A CN110362483B (en) | 2019-06-19 | 2019-06-19 | Performance data acquisition method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910541820.4A CN110362483B (en) | 2019-06-19 | 2019-06-19 | Performance data acquisition method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110362483A true CN110362483A (en) | 2019-10-22 |
CN110362483B CN110362483B (en) | 2022-11-15 |
Family
ID=68216511
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910541820.4A Active CN110362483B (en) | 2019-06-19 | 2019-06-19 | Performance data acquisition method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110362483B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110830796A (en) * | 2019-11-01 | 2020-02-21 | 深圳创维-Rgb电子有限公司 | Television application testing method, television application testing device and readable storage medium |
CN111061647A (en) * | 2019-12-26 | 2020-04-24 | 行吟信息科技(上海)有限公司 | Software performance automatic testing method and device and electronic equipment |
CN111198800A (en) * | 2020-01-03 | 2020-05-26 | 北京小米移动软件有限公司 | CPU occupancy detection method, CPU occupancy detection device, and electronic apparatus |
CN111208989A (en) * | 2019-12-27 | 2020-05-29 | 江苏南高智能装备创新中心有限公司 | Data acquisition terminal capable of executing script |
CN111654691A (en) * | 2020-05-21 | 2020-09-11 | Oppo(重庆)智能科技有限公司 | Performance test method, device, computer storage medium and system |
CN112306870A (en) * | 2020-10-28 | 2021-02-02 | 广州博冠信息科技有限公司 | Data processing method and device based on live APP |
CN112527584A (en) * | 2020-12-18 | 2021-03-19 | 上海万向区块链股份公司 | Software efficiency improving method and system based on script compiling and data acquisition |
CN112560035A (en) * | 2020-12-15 | 2021-03-26 | 深圳市和讯华谷信息技术有限公司 | Application detection method, device, equipment and storage medium |
CN114356771A (en) * | 2021-12-31 | 2022-04-15 | 龙芯中科(武汉)技术有限公司 | Operation method, device and equipment of data processing entity |
CN116303101A (en) * | 2023-05-19 | 2023-06-23 | 建信金融科技有限责任公司 | Test case generation method, device and equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102025555A (en) * | 2009-09-22 | 2011-04-20 | 中兴通讯股份有限公司 | Method and device for testing IP multimedia sub-system performance |
CN107273300A (en) * | 2017-07-31 | 2017-10-20 | 北京云测信息技术有限公司 | A kind of applied program testing method and device |
US20180121279A1 (en) * | 2016-10-27 | 2018-05-03 | Beijing Xiaomi Mobile Software Co., Ltd. | Method and device for evaluating system fluency, and ue |
CN108595312A (en) * | 2017-12-29 | 2018-09-28 | 瑞庭网络技术(上海)有限公司 | A kind of automatic performance method and device of modelling customer behavior |
CN108733568A (en) * | 2018-05-25 | 2018-11-02 | 平安科技(深圳)有限公司 | Application testing method, device, equipment and readable storage medium |
-
2019
- 2019-06-19 CN CN201910541820.4A patent/CN110362483B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102025555A (en) * | 2009-09-22 | 2011-04-20 | 中兴通讯股份有限公司 | Method and device for testing IP multimedia sub-system performance |
US20180121279A1 (en) * | 2016-10-27 | 2018-05-03 | Beijing Xiaomi Mobile Software Co., Ltd. | Method and device for evaluating system fluency, and ue |
CN107273300A (en) * | 2017-07-31 | 2017-10-20 | 北京云测信息技术有限公司 | A kind of applied program testing method and device |
CN108595312A (en) * | 2017-12-29 | 2018-09-28 | 瑞庭网络技术(上海)有限公司 | A kind of automatic performance method and device of modelling customer behavior |
CN108733568A (en) * | 2018-05-25 | 2018-11-02 | 平安科技(深圳)有限公司 | Application testing method, device, equipment and readable storage medium |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110830796B (en) * | 2019-11-01 | 2021-09-03 | 深圳创维-Rgb电子有限公司 | Television application testing method, television application testing device and readable storage medium |
CN110830796A (en) * | 2019-11-01 | 2020-02-21 | 深圳创维-Rgb电子有限公司 | Television application testing method, television application testing device and readable storage medium |
CN111061647A (en) * | 2019-12-26 | 2020-04-24 | 行吟信息科技(上海)有限公司 | Software performance automatic testing method and device and electronic equipment |
CN111208989A (en) * | 2019-12-27 | 2020-05-29 | 江苏南高智能装备创新中心有限公司 | Data acquisition terminal capable of executing script |
CN111198800A (en) * | 2020-01-03 | 2020-05-26 | 北京小米移动软件有限公司 | CPU occupancy detection method, CPU occupancy detection device, and electronic apparatus |
CN111198800B (en) * | 2020-01-03 | 2023-08-04 | 北京小米移动软件有限公司 | CPU occupancy rate detection method, CPU occupancy rate detection device and electronic equipment |
CN111654691B (en) * | 2020-05-21 | 2022-04-15 | Oppo(重庆)智能科技有限公司 | Performance test method, device, computer storage medium and system |
CN111654691A (en) * | 2020-05-21 | 2020-09-11 | Oppo(重庆)智能科技有限公司 | Performance test method, device, computer storage medium and system |
CN112306870A (en) * | 2020-10-28 | 2021-02-02 | 广州博冠信息科技有限公司 | Data processing method and device based on live APP |
CN112560035A (en) * | 2020-12-15 | 2021-03-26 | 深圳市和讯华谷信息技术有限公司 | Application detection method, device, equipment and storage medium |
CN112560035B (en) * | 2020-12-15 | 2024-04-02 | 深圳市和讯华谷信息技术有限公司 | Application detection method, device, equipment and storage medium |
CN112527584A (en) * | 2020-12-18 | 2021-03-19 | 上海万向区块链股份公司 | Software efficiency improving method and system based on script compiling and data acquisition |
CN114356771A (en) * | 2021-12-31 | 2022-04-15 | 龙芯中科(武汉)技术有限公司 | Operation method, device and equipment of data processing entity |
CN116303101A (en) * | 2023-05-19 | 2023-06-23 | 建信金融科技有限责任公司 | Test case generation method, device and equipment |
CN116303101B (en) * | 2023-05-19 | 2023-08-15 | 建信金融科技有限责任公司 | Test case generation method, device and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN110362483B (en) | 2022-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110362483A (en) | Performance data acquisition method, device, equipment and storage medium | |
US8924912B2 (en) | Method of recording and replaying call frames for a test bench | |
US9448908B2 (en) | System and method for model based session management | |
US10657036B2 (en) | Determining visual testing coverages | |
CN104461894B (en) | The operation record device and method of Android software | |
US9904517B2 (en) | System and method for automatic modeling of an application | |
US20130263090A1 (en) | System and method for automated testing | |
CN108874268B (en) | User behavior data acquisition method and device | |
CN110457211B (en) | Script performance test method, device and equipment and computer storage medium | |
US10169853B2 (en) | Score weights for user interface (UI) elements | |
CN105843734A (en) | Automatic test method and device and computing device | |
CN101930399A (en) | Method for recording software test | |
CN111324352A (en) | Code generation method of application page and related equipment | |
CN115982005A (en) | Automatic testing method and device based on artificial intelligence | |
CN109976966A (en) | A kind of application program launching time counting method, apparatus and system | |
US20240189724A1 (en) | Videogame telemetry data and game asset tracker for session recordings | |
US20180336122A1 (en) | Generating application flow entities | |
CN108984380A (en) | A kind of server test method, device and medium based on linux system | |
CN112612697A (en) | Software defect testing and positioning method and system based on byte code technology | |
CN115292418B (en) | Cross-system business process automatic processing method and system | |
CN110825649A (en) | Application testing method, device, equipment and storage medium | |
CN113127312A (en) | Method and device for testing database performance, electronic equipment and storage medium | |
CN105095093A (en) | Intelligent terminal performance test method and system | |
CN106897387B (en) | Service detection method based on action simulation | |
US20170192878A1 (en) | Separating Test Coverage In Software Processes Using Shared Memory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |