CN111124702B - Performance data acquisition method, device and computer readable storage medium - Google Patents

Performance data acquisition method, device and computer readable storage medium Download PDF

Info

Publication number
CN111124702B
CN111124702B CN201911154521.1A CN201911154521A CN111124702B CN 111124702 B CN111124702 B CN 111124702B CN 201911154521 A CN201911154521 A CN 201911154521A CN 111124702 B CN111124702 B CN 111124702B
Authority
CN
China
Prior art keywords
thread
request
performance data
target
data acquisition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911154521.1A
Other languages
Chinese (zh)
Other versions
CN111124702A (en
Inventor
徐小明
朱永俊
王昱杰
蔡怡峰
魏学峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911154521.1A priority Critical patent/CN111124702B/en
Publication of CN111124702A publication Critical patent/CN111124702A/en
Application granted granted Critical
Publication of CN111124702B publication Critical patent/CN111124702B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]

Abstract

The application relates to a performance data acquisition method, a performance data acquisition device and a computer-readable storage medium, wherein the method comprises the following steps: creating at least one service thread group, wherein the service thread group comprises a first thread and a second thread; a first thread monitors a performance data acquisition request and caches the performance data acquisition request to a corresponding first message queue; the first thread reads a target performance data acquisition request from the first message queue, writes the target performance data acquisition request into a pre-established debugging bridge client, and sends a result reading request to the second thread; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request; after receiving the result reading request, the second thread reads the request result from the debugging bridge client; the first thread receives a request result sent by the second thread; the request result is used for determining the target performance data corresponding to the target performance data acquisition request. The scheme provided by the application can save computer system resources.

Description

Performance data acquisition method and device and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a performance data acquisition method, apparatus, and computer-readable storage medium.
Background
In the practical application of the android phone, performance data acquisition is often required to be performed on the android phone process so as to grasp the process performance of the android phone in real time.
In the conventional technology, when performance data is collected, a command request is usually sent to an android system bridge interface through a PC (Personal Computer) end to obtain performance data. Specifically, a plurality of acquisition threads are adopted, each thread starts and stops 1 or 2 debugging bridge client processes per second to synchronously execute 1 command, the result is returned after the command execution is finished, the acquisition threads read and store the result, then the debugging bridge client processes are immediately closed, and finally the system releases and recovers process resources. In this way, the debug bridge client process needs to be created and destroyed frequently in a short time, resulting in waste of computer system resources.
Disclosure of Invention
In view of the above, it is necessary to provide a performance data collecting method, apparatus and computer readable storage medium for solving the technical problems caused by the background art.
A method of performance data acquisition, comprising:
creating at least one service thread group, wherein the service thread group comprises a first thread and a second thread;
the first thread monitors a performance data acquisition request and caches the performance data acquisition request to a corresponding first message queue;
the first thread reads a performance data acquisition request from the first message queue, and the read performance data acquisition request is used as a target performance data acquisition request;
the first thread writes the target performance data acquisition request into a pre-established debugging bridge client and sends a result reading request to the second thread; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request;
after receiving the result reading request, the second thread reads the request result from the debugging bridge client;
the first thread receives the request result sent by the second thread; and the request result is used for determining the target performance data corresponding to the target performance data acquisition request.
A performance data collection apparatus, the apparatus comprising:
the system comprises a creating module, a processing module and a processing module, wherein the creating module is used for creating at least one service thread group, and the service thread group comprises a first thread and a second thread;
the first thread is used for monitoring a performance data acquisition request and caching the performance data acquisition request to a corresponding first message queue;
the first thread is also used for reading a performance data acquisition request from the first message queue, and taking the read performance data acquisition request as a target performance data acquisition request;
the first thread is also used for writing the target performance data acquisition request into a pre-established debugging bridge client and sending a result reading request to the second thread; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request;
the second thread is used for reading the request result from the debugging bridge client after receiving the result reading request;
the first thread is also used for receiving the request result sent by the second thread; and the request result is used for determining the target performance data corresponding to the target performance data acquisition request.
A computer-readable storage medium, storing a computer program which, when executed by a processor, implements a performance data acquisition method as described above.
A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to implement a performance data acquisition method as described above.
According to the performance data acquisition method, the performance data acquisition device, the computer readable storage medium and the computer equipment, at least one service thread group is created, the service thread group comprises a first thread and a second thread, the first thread monitors a performance data acquisition request, the performance data acquisition request is cached to a corresponding first message queue, the first thread reads the performance data acquisition request from the message queue, the read performance data acquisition request is used as a target performance data acquisition request, the first thread writes the target performance data acquisition request into a pre-created debugging bridge client, and sends a result reading request to the second thread; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request, the second thread reads the request result from the debugging bridge client after receiving the result reading request, the first thread receives the request result sent by the second thread, and the request result is used for determining target performance data so as to realize the acquisition of the performance data. After monitoring the performance data acquisition request, the first thread can cache the performance data acquisition request through the first message queue, and can continuously read the performance data acquisition request from the message queue and write the performance data acquisition request into the pre-created debugging bridge client.
Drawings
FIG. 1 is a diagram of an application environment for a performance data collection method in one embodiment;
FIG. 2 is a schematic flow chart diagram of a performance data collection method in one embodiment;
FIG. 3 is a flow chart illustrating a process prior to S204 in one embodiment;
FIG. 4 is a flow diagram that illustrates the resolution of request results by a first thread in one embodiment;
FIG. 5 is a flow diagram illustrating parsing of request results by a first thread in accordance with another embodiment;
FIG. 6 is a flowchart illustrating a process before S204 in another embodiment;
FIG. 7 is a service architecture and communication flow diagram corresponding to a performance data collection method in one embodiment;
FIG. 8 is a service communication timing diagram corresponding to a performance data collection method in one embodiment;
FIG. 9 is a block diagram showing the structure of a performance data acquisition apparatus according to another embodiment;
FIG. 10 is a block diagram showing a configuration of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
FIG. 1 is a diagram of an application environment for a performance data collection method in one embodiment. Referring to fig. 1, the performance data acquisition method is applied to a performance data acquisition system. The system includes a computer device 110 and a terminal 120. The computer device 110 and the terminal 120 are connected through a USB data line or a network. The computer device 110 may be a desktop, a all-in-one machine, a notebook computer, etc., and the terminal 120 is a mobile terminal, which may specifically be at least one of a mobile phone, a tablet computer, a wearable smart device, etc.
At least one server thread group can be created on the computer device 110, the server thread group includes a first thread and a second thread, the first thread monitors the performance data acquisition request, first caches the performance data acquisition request to a corresponding first message queue, the first thread reads the performance data acquisition request from the message queue in sequence according to the sequence of the performance data acquisition requests in the message queue as a target performance data acquisition request, then writes the target performance data acquisition request into a pre-created debugging bridge client, and sends a result reading request corresponding to the target performance data acquisition request to the second thread, the debugging bridge client acquires a corresponding request result from the terminal 120 according to the target performance data acquisition request, therefore, after receiving the result reading request, the second thread can read the request result from the debugging bridge client and send the request result to the first thread, and finally, the first thread receives the request result, and the request result can be used for determining the target performance data corresponding to the target performance data acquisition request, so as to achieve performance data acquisition.
In one embodiment, as shown in FIG. 2, a performance data collection method is provided. The embodiment is mainly illustrated by applying the method to the computer device 110 in fig. 1. Referring to fig. 2, the performance data acquisition method specifically includes the following steps:
s202, at least one service thread group is created, and the service thread group comprises a first thread and a second thread.
In particular, the service thread groups are used to provide performance data acquisition services. The service thread group may include a first thread and a second thread. To meet concurrency requirements, multiple service thread groups may be created to form a fixed number of thread pools. When calling externally, the thread pool size can be distributed according to the need and the actual measurement performance, and the service thread group to which the execution command belongs can also be appointed. In one embodiment, the service thread groups are identified by a subscript thread _ index, and by specifying the thread _ index, the corresponding service thread group can be specified as the target thread group to execute the command. It is to be understood that the command in the present application refers to a command to acquire performance data, that is, a performance data acquisition request.
S204, the first thread monitors the performance data acquisition request and caches the performance data acquisition request to the corresponding first message queue.
The performance data acquisition request refers to a request for acquiring performance data of a terminal process, and is issued by an external calling program. Performance data includes, but is not limited to, CPU footprint, memory data, network data, and the like. And the first thread monitors the performance data acquisition request, and when the performance data acquisition request is monitored, the monitored performance data acquisition request is written into a first message queue corresponding to the thread.
In one embodiment, the external caller may issue the performance data acquisition request through the performance data acquisition threads by starting a plurality of performance data acquisition threads.
S206, the first thread reads the performance data acquisition request from the first message queue, and the read performance data acquisition request is used as a target performance data acquisition request.
Specifically, the first thread executes loop detection to determine whether there is a performance data acquisition request currently being executed, if so, waits for the performance data acquisition request to be executed, and if not, reads a performance data acquisition request from the corresponding first message queue, and takes the read performance data acquisition request as a target performance data acquisition request. Then, the target performance data obtaining request enters an execution state, the first thread performs a first state flag on the target performance data obtaining request to represent that the target performance data obtaining request is being executed, for example, the first state flag may be TRUE, and when performing loop detection, the first thread may determine whether there is an executing performance data obtaining request according to the state flag; when the target performance data obtaining request is executed completely, the first thread changes the first status flag of the target performance data obtaining request into the second status flag to represent that the target performance data obtaining request is executed completely, for example, the second status flag may be FALSE, and when the first thread detects that the status flag of a certain performance data obtaining request is the second status flag, it is determined that the performance data obtaining request is executed completely.
In one embodiment, when the first thread performs loop detection, if the number of times of detection exceeds a preset threshold or the time of detection exceeds a preset threshold, the previous performance data acquisition request is still not completely executed, and waiting may be abandoned to avoid blocking execution of subsequent requests.
In one embodiment, when the first thread successfully obtains the request result corresponding to the performance data obtaining request, it indicates that the performance data obtaining request is completely executed.
S208, the first thread writes the target performance data acquisition request into a pre-established debugging bridge client and sends a result reading request to the second thread; and the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request.
The Android Debug Bridge (ADB) is a tool carried in the Android SDK, and the tool can be used to directly operate and manage an Android simulator (Emulator) or a real Android device. In this embodiment, each service thread group creates a debug bridge client, and the debug bridge client (hereinafter referred to as ADB client) communicates with a debug bridge server (hereinafter referred to as ADB server) on the computer device.
Specifically, after acquiring a target performance data acquisition request, a first thread writes the target performance data acquisition request into a standard input of an ADB client process created by a service thread group in which the first thread is located, and sends a result reading request to a second thread, where the result reading request is a request for instructing the second thread to read a request result from a standard output of the ADB client process. After receiving the target performance data acquisition request, the ADB client sends the target performance data acquisition request to the ADB server, the ADB server sends the target performance data acquisition request to a debugging bridge daemon (hereinafter referred to as ADB daemon) corresponding to a target process on the terminal, the ADB daemon receives the target performance data acquisition request, acquires corresponding performance data from the target process and returns the performance data to the ADB server, and the ADB server sends the performance data to the corresponding ADB client. It is understood that the target process in the present application refers to a process on the terminal that needs to collect performance data, and may be, for example, a mini-game process on the terminal.
And S210, after receiving the result reading request, the second thread reads the request result from the debugging bridge client.
S212, the first thread receives a request result sent by the second thread; and the request result is used for determining the target performance data corresponding to the target performance data acquisition request.
Specifically, the second thread, upon receiving a result read request, may asynchronously read the corresponding request result from the standard output of the ADB client. And sends the read performance data to the first thread. The first thread receives the request result, and the computer equipment can determine the target performance data corresponding to the target performance data acquisition request according to the request result, so that the performance data can be acquired.
In one embodiment, after receiving the request result, the first thread analyzes the request result, and writes the analysis result into a second message queue corresponding to the first thread, from which the external calling program can read the analysis result, where the analysis result includes the target performance data. It will be appreciated that the second message queue herein refers to a different message queue than the first message queue.
In another embodiment, after receiving the request result, the first thread may directly write the request result into a second message queue corresponding to the first thread, and the external calling program may read the request result from the second message queue and analyze the request result, thereby obtaining the target performance data included in the request result.
In this embodiment, the first thread and the second thread will execute the above steps circularly. The main cycle sleep time and the task execution frequency control time of the first thread Cheng Xiancheng and the second thread may be configured as required, for example, the main cycle sleep time may be configured to be 10ms, and the task execution frequency control time may be 1s, so as to ensure that the request can be received and sent in time, reduce the sleep time, and reduce the error to meet the real-time requirement. The first and second threads are clocked in this manner with greater precision than a single sleep 1s, and also with the setnterval timer scheme using python, eliminating the overhead of a large number of threads.
It is understood that the sleep time of the thread main loop and the task execution frequency control time are different, for example: the acquisition task execution time of the acquisition thread is 1s, the sleep interval time is 10ms, namely whether the time interval from the current time to the last acquisition task reaches 1s is checked every 10ms, and the acquisition error is about 10ms at the moment.
According to the performance data acquisition method, after the first thread monitors the performance data acquisition request, the performance data acquisition request can be cached through the first message queue, and the performance data acquisition request can be continuously read from the message queue and written into the pre-established debugging bridge client, so that the debugging client can continuously provide command execution service after being established, and the debugging client is not required to be destroyed after executing a command like the traditional technology, so that frequent establishment and destruction of the debugging bridge client process are avoided, and computer system resources are saved.
Furthermore, because two threads are arranged and work in a division and cooperation mode, the first thread sends a performance data reading acquisition request, and the second thread asynchronously reads a corresponding request result, compared with synchronous calling of an ADB client in the prior art, the method saves waiting time of the request result, and can greatly improve the performance data acquisition efficiency.
In one embodiment, as shown in fig. 3, before the first thread listens for the performance data acquisition request, the method further includes:
and S302, starting a performance data acquisition thread.
The performance data acquisition thread refers to a thread for calling a performance data acquisition service provided by the service thread group. In this embodiment, the computer device may start one or more performance data collection threads to invoke the performance data acquisition service provided by the service thread group.
S304, the performance data acquisition thread sends a service calling request carrying the equipment identification information to the first thread through the service enabling interface.
The device identification information refers to identification information of a terminal, and includes at least one of a terminal device number and a terminal port number. The service enabling interface refers to an interface provided by the service thread group for the performance data acquisition service to be provided for external calling.
Specifically, the performance data acquisition thread first performs parameter initialization, where the initialized parameters are related parameters of the ADB client process, including but not limited to device identification information, data reading frequency, and the like. After parameter initialization is performed, the performance data acquisition thread may generate a service invocation request according to the device identification information, and send the service invocation request to a first thread in the service thread group through the service enabling interface.
In one embodiment, when there are multiple service thread groups, the service enablement interface may send a service call request to the first thread in each service thread group separately.
In another embodiment, the service invocation request may carry a thread group identifier, and the service enablement interface sends the service invocation request to the first thread in the corresponding thread group according to the thread group identifier.
S306, the first thread creates a debugging bridge client according to the equipment identification information and sends the process object identification corresponding to the successfully created debugging bridge client to the second thread.
And S308, after receiving the process object identifier, the second thread returns a service calling success notice.
The process object identifier is used for uniquely identifying an ADB client. And after receiving the service calling request, the first thread creates a corresponding ADB client according to the equipment identification information carried in the service calling request, and sends a process object identification corresponding to the ADB client which is successfully created to the second thread. And after receiving the process object identification, the second thread stores the process object identification and returns a service call success notice. When the service calling success notice is returned, the second thread firstly returns the service calling success notice to the first thread, and the first thread returns the service calling success notice to the performance data acquisition thread through the service starting interface.
In the embodiment, by providing the service enabling interface, the performance data acquisition thread can conveniently and quickly initiate and call the performance data acquisition service provided by the service thread group through the service enabling interface, and the debugging bridge client is quickly created.
In one embodiment, the target performance data acquisition request includes a special string marking request; the special character string marking request is used for acquiring a special character string; reading a request result from a debugging bridge client, comprising: the second thread reads the character string from the debugging bridge client; when the special character string is read, the second thread determines all the character strings ending up to the special character string as a request result corresponding to the result reading request.
The target performance data acquisition request is in the form of a combined command, and sequentially comprises a command request, a timestamp marking request and a special character string marking request, wherein the command request is used for indicating an ADB daemon process of the terminal to execute a command so as to acquire performance data; the time stamp request is used for indicating the terminal ADB daemon to carry out time stamp marking when the command execution is finished; the special string marking request is used for instructing the ADB daemon to mark the special string at the end of command execution so as to acquire the special string.
In this embodiment, since the form of the combined command is adopted, the ADB daemon process returns the combined request result, and the combined request result returns in the form of a character string, and the result sequentially includes performance data, a timestamp, and a special character string, where the special character string is used to distinguish different request results and can perform a splitting function, and the special character string may be "argusadbcmdmagicst", for example. The special character strings have a segmentation effect on different request results, when the second thread reads a command result corresponding to a result reading request from the debugging bridge client, the second thread can start reading from the first character string until the special character strings are read, the reading of the request result is completed, and the second thread determines all character strings before the characteristic character strings as the request results corresponding to the result reading request. At this time, since the special string corresponding to the request result has completed the mission, the special string may be discarded.
In the above embodiment, since the performance data obtaining request is a combined request including a special character string flag, the second thread may read the request result according to the special character string, thereby ensuring the accuracy of the read request result.
In one embodiment, the target performance data acquisition request carries a request identifier; after the first thread receives the request result sent by the second thread, the method further comprises the following steps: the first thread acquires a request identifier corresponding to the request result, and compares the acquired request identifier with a request identifier carried by a target performance data acquisition request; when the comparison is consistent, the first thread analyzes the request result and writes the analysis result into a corresponding second message queue; when the comparison is inconsistent, the first thread discards the request result.
The ADB daemon acquires a corresponding request result according to the performance data acquisition request, and the ADB daemon carries the request identifier in the request result. Therefore, when the request result is finally sent to the first thread, the first thread can verify the request result according to the request identifier carried in the request result, the verification process is to verify the request identifier carried in the request result and the request identifier carried in the current performance data acquisition request, if the request identifier carried in the request result is consistent with the request identifier corresponding to the current performance data acquisition request, the request result is correct, otherwise, the request result is incorrect. It is to be understood that the current performance data acquisition request herein refers to a performance data acquisition request currently waiting for a result. After determining that the request result is a correct request result, the first thread may analyze the request result, and write the analysis result into a second message queue corresponding to the first thread.
In this embodiment, after receiving the request result, the first thread checks the request result according to the request identifier, which can ensure that the received request result is a correct request result, and avoid a situation of a disordered request result.
In an embodiment, as shown in fig. 4, after the step of receiving, by the first thread, the request result sent by the second thread in S210, the method further includes a step of parsing, by the first thread, the request result, where the step specifically includes:
s402, the first thread traverses a pre-established primary index list according to the function type identification, determines a primary target index item from the primary index list, and determines a processing object corresponding to the primary target index item as a target processing object.
The function type identifier is used to identify a function type to which the target performance data acquisition request belongs, where the function type includes, but is not limited to, acquiring CPU data, acquiring memory data, acquiring network data, and acquiring a process identifier, and the identifiers corresponding to the several function types may be, for example, proccpu _ cb _ cmd _ type, procmem _ cb _ cmd _ type, procnet _ cb _ cmd _ type, and procpiddpame _ cb _ cmd _ type. The first request type identifier is used to identify a specific request type corresponding to the target performance data obtaining request, for example, for a request belonging to a function type of obtaining CPU data, the request includes two request types, one is obtaining system CPU data and the other is obtaining performing CPU data, and the respective corresponding identifiers may be cb _ ci _ sysstat and cb _ ci _ procstat, for example.
In this embodiment, a corresponding processing object is created in advance for each function type, and each function type identifier is associated with a corresponding processing object identifier to establish a primary index list; and establishing a corresponding analysis object in advance for each specific request type corresponding to each function type, and associating each request type identifier with the corresponding analysis object identifier to establish a secondary index list. The processing object here refers to a handler object in Android, and the analysis object refers to a callback object in Android. Each processing object pre-binds a corresponding message queue.
The first thread may parse the request result after receiving the request result sent by the second thread. The target performance data acquisition request carries the function type identifier and the first request type identifier, and the corresponding request result naturally carries the function type identifier and the first request type identifier, the first thread can traverse a pre-established primary index list when analyzing the request result, match the function type identifier with each function type identifier in the primary index list, and determine the index item where the matched function type identifier is located as a primary target index item.
S404, the first thread determines a secondary target index item from a secondary index list corresponding to the primary target index item according to the first request type identifier, and determines an analysis object corresponding to the secondary target index item as a first target analysis object.
After the target processing object is determined, the first thread may traverse the secondary index list corresponding to the primary target index item, match the first request type identifier with each request type identifier in the secondary index list, determine the index item where the matched request type identifier is located as the secondary target index item, and determine the first target analysis object according to the analysis object identifier because the request type identifier corresponding to the secondary target index item is associated with the analysis object identifier.
S406, the first thread calls the first target analysis object through the target processing object to analyze the request result, and an analysis result is obtained.
And S408, the first thread determines target performance data according to the analysis result and writes the target performance data into a second message queue corresponding to the target processing object.
Specifically, the first thread may invoke the first target analysis object through the target processing object to analyze the request result to obtain an analysis result, and when performing analysis, the first target analysis object analyzes a corresponding timestamp from the request result, where the timestamp is a timestamp of the request result obtained by the ADB daemon executing the performance data acquisition request.
In an embodiment, after obtaining the analysis result, the first thread may directly determine the analysis result as the target performance data corresponding to the target performance data obtaining request, and write the target performance data into the second message queue bound to the target processing object.
In the above embodiment, through the primary index list and the secondary index list, the first thread may quickly determine the target processing object and the first target analysis object, thereby improving the analysis efficiency of the request result.
In an embodiment, as shown in fig. 5, when the performance data acquisition request has a corresponding associated performance data acquisition request, the step of the first thread parsing the request result specifically includes:
s502, the first thread traverses a pre-established primary index list according to the function type identification, determines a primary target index item from the primary index list, and determines a processing object corresponding to the primary target index item as a target processing object.
S504, the first thread determines a secondary target index item from a secondary index list corresponding to the primary target index item according to the first request type identifier, and determines an analysis object corresponding to the secondary target index item as a first target analysis object.
S506, the first thread calls the first target analysis object through the target processing object to analyze the request result, and an analysis result is obtained.
S508, the first thread receives the correlation request result corresponding to the correlation performance data acquisition request.
S510, the first thread determines a secondary associated target index item from a secondary index list corresponding to the primary target index item according to the second request type identifier, and determines an analysis object corresponding to the secondary associated target index item as a second target analysis object.
The associated performance data acquisition request corresponding to the target performance data acquisition request refers to a request associated with the target performance data acquisition request to jointly acquire performance data corresponding to a certain performance index. Two performance data acquisition requests that are interrelated typically belong to the same functional type. For example, when the CPU proportion needs to be acquired, the system CPU and the process CPU need to be acquired, and the performance data acquisition request of the system CPU and the performance data acquisition request of the process CPU are associated with each other.
In this embodiment, when the target performance data obtaining request has a corresponding associated performance data obtaining request, the first thread invokes the target processing object to detect whether a request result corresponding to the associated performance data obtaining request, that is, an associated request result, is received. When an association request result is received, the first thread needs to analyze the association request result, and since the association performance data acquisition request and the target performance data acquisition request belong to the same function class, and the corresponding primary target index item and the target processing object are also the same, the first thread can determine a secondary association target index item from a secondary index list corresponding to the primary target index item according to a second request type identifier carried in the target performance data acquisition request, wherein the secondary association target index item refers specifically to the secondary target index item corresponding to the association performance data acquisition request and is used for distinguishing the secondary target index item corresponding to the target performance data acquisition request. Further, the first thread may determine a corresponding second parse object according to the secondary associated target index entry.
S512, the first thread calls a second target analysis object through the target processing object to analyze the association request result to obtain the association request result.
And S514, the first thread calls the target processing object to obtain target performance data according to the analysis result and the associated analysis result, and writes the target performance data into a second message queue corresponding to the target processing object.
Specifically, when the first thread obtains the analysis result and the associated analysis result, the first thread may execute a preset operation according to the two analysis results to obtain the target performance data. For example, when the CPU duty needs to be obtained, since the CPU duty is the process CPU data and the system CPU data, if the analysis result is the process CPU data and the association analysis result is the system CPU data, the first thread may divide the analysis result and the association analysis result to obtain the target performance data. Because the target processing object is bound with the corresponding message queue in advance, the first thread can write the target performance data into the message queue corresponding to the target processing object after obtaining the target performance data.
In the above embodiment, when the target performance data acquisition request has a corresponding associated performance data acquisition request, the first thread may determine the processing object and the analysis object corresponding to the two requests according to the primary index and the secondary index, so as to analyze the analysis result quickly, and improve the analysis efficiency.
In one embodiment, as shown in fig. 6, before the first thread listens for the performance data acquisition request, the method further comprises:
s602, starting a process monitoring thread.
S604, the process monitoring thread sends a process identification acquisition request to a target service thread group through a service enabling interface; the process identification acquisition request is used for indicating the target service thread group to acquire the process identification of the target process corresponding to the terminal.
The target service thread group refers to a server thread group for acquiring a process identifier and a user identifier. In one embodiment, the process monitoring thread may carry a thread group identifier in the sent process identifier acquisition request to designate a certain service thread group as a target server thread group.
After a process monitoring thread sends a process identifier acquisition request to a target service thread group through a service enabling interface, a first thread in the service thread group firstly writes the process identifier acquisition request into a first message queue corresponding to the first thread, meanwhile, circular detection is executed, if no executing request exists currently, a request is read from the message queue, when the process identifier acquisition request is read, the process identifier acquisition request is written into a pre-established ADB client, the ADB client acquires a process identifier corresponding to a target process according to the process identifier acquisition request, here, the specific process of the DB client acquiring the process identifier can refer to the similar process of the ADB client acquiring the request result in the above embodiment, and the detailed description of the process is omitted here. And simultaneously, the first thread sends a process identifier reading request to a second thread in the server thread group, and the second thread reads a corresponding process identifier from the ADB client according to the process identifier reading request and writes the process identifier into a corresponding second message queue.
S606, when reading the process identifier in the message queue corresponding to the target service thread group, the process monitoring thread generates a user identifier obtaining request according to the process identifier, and sends the user identifier obtaining request to the target service thread group through the service enabling interface; the user identification obtaining request is used for indicating the target service thread group to obtain the user identification corresponding to the target process.
Specifically, the process monitoring thread may read a process identifier from a second message queue corresponding to the target service thread group, generate a user identifier obtaining request according to the process identifier, and send the user identifier obtaining request to the target service thread group through the service enabling interface, where the target service thread group obtains the user identifier of the target process according to the user identifier obtaining request, where a process of obtaining the user identifier of the target process by the target service thread group is similar to a process of obtaining the process identifier thereof, and reference may be made to the above description, which is not repeated herein. And the user identification of the target process is used for uniquely identifying the user currently using the target process by the terminal.
S608, the process monitoring thread reads the user identification from the message queue corresponding to the target service thread group; the user identifier is used for generating a target performance data acquisition request, and the target performance data acquisition request is used for acquiring network data.
Specifically, the process monitoring thread may read a user identifier from the second message queue corresponding to the target service thread group, and after the user identifier is read. When the network data of the target process needs to be acquired, the computer device can generate a target performance data acquisition request for acquiring the network data by the user according to the user identification.
In the above embodiment, the monitoring thread is started to acquire the process data and the user identifier, and when network data needs to be acquired, a target performance data acquisition request for acquiring the network data may be generated by using the acquired user identifier.
Fig. 7 is a service structure and a communication flow diagram corresponding to the performance data collection method in one embodiment. In this embodiment, the service thread group is a ShellCmd thread group, the first thread is an adbshellthreadthread (hereinafter referred to as a shell thread), the second thread is an adbshellcmdrederthread (hereinafter referred to as a Reader thread), the service enabling interface is provided by an adbshell module, and the module can manage the ShellCmd thread group. Referring to fig. 7, an external calling program may send a command to communicate with a ShellCmd thread group through a process monitoring thread and a performance data acquisition thread, the shell thread may be used to create an ADB client process, write a command to the ADB client process, send a result read request to a Reader thread, and obtain a command result and write the command result to a message queue, and the Reader thread is used to process the result read request and read the command result from the ABD client process. And the command result obtained by the ShellCmd thread group can call a corresponding handler/callback to perform analysis processing, the command result is written into a message queue after the processing is finished, and finally the process monitoring thread and the acquisition thread can read the command result from the message queue. The ProcCPUHandler/Callbacks correspond to CPU data, the procmemandler/Callbacks correspond to memory data, the ProcNetHandler/Callbacks correspond to network data, and the ProcHandler/Callbacks may be one of the three, or of course, other ones, as necessary.
Referring to fig. 8, the service communication timing chart corresponding to the performance data collection method in an embodiment is shown, and in this embodiment, the performance data collection method includes the following steps:
1) Service initiation procedure
1.1, initializing parameters by an external calling program, and sending a service calling request carrying equipment identification information to an AdbShellutil module;
1.2, the AdbShellutil module sends the service calling request to a shell thread;
1.3, the shell thread creates an ADB client corresponding to the equipment identification information, and sends a process object identification of the created ADB client to the Reader thread;
and 1.4, the Reader thread stores the process object identification and returns a service call success notice.
2) Command execution step
2.1, sending a command to an AdbShellutil module by an external calling program;
2.2, the AdbShellutil module sends a command to the shell thread;
2.3, the shell thread writes the command into the standard input of the ADB client process;
2.4, the shell thread sends a result reading request to the Reader thread;
2.5, the Reader thread outputs a reading command result from the standard of the ADB client process;
and 2.6, returning the command result to the shell thread, and returning the command result to the external calling program by the shell thread.
3) Service stop step
3.1, the external calling program sends a service ending request carrying equipment identification information to an AdbShellutil module;
3.2, the AdbShellutil module sends the service ending request to the shell thread;
3.3, the shell thread sends the service ending request to the Reader thread;
3.4, removing the reference of the ADB client process object corresponding to the equipment identification information by the Reader thread;
3.5, the Reader thread returns a service result notice to the shell thread;
3.6, the shell thread inputs a writing service ending request to the standard of the ADB client process, and returns a service ending notice to the calling program through a service stopping interface provided by the AdbShellutil module.
It can be understood that, in this embodiment, the service enabling interface and the service stopping interface provided by the AdbShellutil module are designed to be synchronous, so as to ensure the consistency with the external calling program timing sequence; the principle of the service starting interface synchronization is that the starting is finished, and all threads can be ready to receive command requests; the principle of service stopping interface synchronization is that all threads are stopped from service, all command requests before stopping are guaranteed to be executed completely, and the situation that the command requests are not executed completely after being sent does not exist. The service stopping is determined by business requirements, sometimes only represents suspension, and the service can be restarted at any time without reconfiguration.
In a specific embodiment, a performance data collection method is provided, comprising the steps of:
1. creating at least one service thread group, wherein the service thread group comprises a first thread and a second thread;
2. starting a performance data acquisition thread;
3. the performance data acquisition thread sends a service calling request carrying equipment identification information to a first thread through a service enabling interface;
4. the first thread creates a debugging bridge client according to the equipment identification information and sends a process object identification corresponding to the successfully created debugging bridge client to the second thread;
5. after receiving the process object identification, the second thread returns a service call success notification to the performance data acquisition thread through the service starting interface;
6. the performance data acquisition thread sends a performance data acquisition request to the service thread group through the service enabling interface;
7. after monitoring the performance data acquisition request, the first thread caches the performance data acquisition request to a corresponding first message queue;
8. performing cyclic detection on the first thread, judging whether a performance data acquisition request which is being executed exists at present, if not, reading the performance data acquisition request from the first message queue, and taking the read performance data acquisition request as a target performance data acquisition request; if yes, waiting is carried out;
the target performance data acquisition request carries a request identifier, a function type identifier and a first request type identifier; the target performance data acquisition request comprises a special character string marking request; the special character string marking request is used for indicating the debugging bridge client to obtain a special character string; the target performance data acquisition request has a corresponding associated performance data acquisition request which carries a second request type identifier;
9. the first thread writes a target performance data acquisition request into a pre-established debugging bridge client and sends a result reading request to the second thread; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request;
10. the second thread reads the character strings from the debugging bridge client after receiving the result reading request, determines all the character strings ending to the special character strings as the request results corresponding to the result reading request when reading the character strings corresponding to the special character string marking request, and sends the request results to the first thread;
11. the first thread acquires a request identifier corresponding to the request result, compares the acquired request identifier with a request identifier carried by a target performance data acquisition request, and enters step 12 when the comparison is consistent; when the comparison is inconsistent, discarding the request result;
12. the first thread traverses a pre-established primary index list according to the function type identifier, determines a primary target index item from the primary index list, and determines a processing object corresponding to the primary target index item as a target processing object;
13. the first thread determines a secondary target index item from a secondary index list corresponding to the primary target index item according to the first request type identifier, and determines an analysis object corresponding to the secondary target index item as a first target analysis object;
14. the first thread calls a first target analysis object through the target processing object to analyze the request result to obtain an analysis result;
15. a first thread receives a correlation request result corresponding to a correlation performance data acquisition request;
16. the first thread determines a secondary associated target index item from a secondary index list corresponding to the primary target index item according to the second request type identifier, and determines an analysis object corresponding to the secondary associated target index item as a second target analysis object;
17. the first thread calls a second target analysis object to analyze the association request result through the target processing object to obtain an association request result;
18. and the first thread calls the target processing object to obtain target performance data according to the analysis result and the associated analysis result, and writes the target performance data into a second message queue corresponding to the target processing object.
19. The performance data collection thread reads the target performance data from the second message queue.
Fig. 2-6 are schematic flow diagrams of a performance data collection method in one embodiment. It should be understood that although the various steps in the flowcharts of fig. 2-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-6 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 9, there is provided a performance data acquisition apparatus comprising:
a creating module 902, configured to create at least one service thread group, where the service thread group includes a first thread 904 and a second thread 906;
the first thread 904 is configured to monitor the performance data acquisition request, and cache the performance data acquisition request in a corresponding first message queue;
the first thread 904 is further configured to read a performance data acquisition request from the first message queue, and use the read performance data acquisition request as a target performance data acquisition request;
the first thread 904 is further configured to write a target performance data acquisition request into a pre-created debug bridge client, and send a result read request to the second thread 906; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request;
the second thread 906 is configured to read a request result from the debug bridge client after receiving the result read request;
the first thread 904 is also used for receiving a request result sent by the second thread 906; and the request result is used for determining the target performance data corresponding to the target performance data acquisition request.
According to the performance data acquisition device, after the first thread monitors the performance data acquisition request, the performance data acquisition request can be cached through the first message queue, and the performance data acquisition request can be continuously read from the message queue and written into the pre-established debugging bridge client, so that the debugging client can continuously provide command execution service after being established, and the debugging client is not required to be destroyed after executing a command like the traditional technology, so that frequent establishment and destruction of the debugging bridge client process are avoided, and computer system resources are saved.
Furthermore, because two threads are arranged and work in a division and cooperation mode, the first thread sends a performance data reading acquisition request, and the second thread asynchronously reads a corresponding request result, compared with synchronous calling of an ADB client in the prior art, the method saves waiting time of the request result, and can greatly improve the performance data acquisition efficiency.
In one embodiment, the apparatus further comprises: the first starting module is used for starting a performance data acquisition thread; the performance data acquisition thread is used for sending a service calling request carrying equipment identification information to the first thread through the service enabling interface; the first thread is also used for creating a debugging bridge client according to the equipment identification information and sending the process object identification corresponding to the successfully created debugging bridge client to the second thread; the second thread is also used for returning a service call success notice after receiving the process object identification.
In one embodiment, the second thread is further configured to read a character string from the debug bridge client, and when a special character string is read, determine all character strings ending up to the special character string as a request result corresponding to the result reading request.
In one embodiment, the first thread is further configured to obtain a request identifier corresponding to the request result, compare the obtained request identifier with a request identifier carried in the target performance data obtaining request, analyze the request result when the comparison is consistent, write the analysis result into a corresponding second message queue, and discard the request result when the comparison is inconsistent.
In one embodiment, the target performance data acquisition request carries a function type identifier and a first request type identifier; the first thread is also used for traversing a pre-established primary index list according to the function type identifier, determining a primary target index item from the primary index list, determining a processing object corresponding to the primary target index item as a target processing object, determining a secondary target index item from a secondary index list corresponding to the primary target index item according to the first request type identifier, determining an analysis object corresponding to the secondary target index item as a first target analysis object, calling the first target analysis object through the target processing object to analyze a request result to obtain an analysis result, determining target performance data according to the analysis result, and writing the target performance data into a second message queue corresponding to the target processing object.
In one embodiment, the target performance data acquisition request has a corresponding associated performance data acquisition request, and the associated performance data acquisition request carries a second request type identifier; the first thread is also used for receiving an association request result corresponding to the association performance data acquisition request, determining a secondary association target index item from a secondary index list corresponding to the primary target index item according to a second request type identifier, determining an analysis object corresponding to the secondary association target index item as a second target analysis object, calling the second target analysis object through the target processing object to analyze the association request result to obtain an association request result, calling the target processing object to obtain target performance data according to the analysis result and the association analysis result, and writing the target performance data into a second message queue corresponding to the target processing object.
In one embodiment, the apparatus further comprises: the second starting module is used for starting the process monitoring thread; the process monitoring thread is used for sending a process identification acquisition request to the target service thread group through the service enabling interface; the process identification acquisition request is used for indicating a target service thread group to acquire a process identification of a target process corresponding to the terminal; when a process identifier is read from a message queue corresponding to a target service thread group, generating a user identifier acquisition request according to the process identifier, and sending the user identifier acquisition request to the target service thread group through a service enabling interface; the user identification obtaining request is used for indicating a target service thread group to obtain a user identification corresponding to a target process; reading a user identifier from a message queue corresponding to a target service thread group; the user identifier is used for generating a target performance data acquisition request, and the target performance data acquisition request is used for acquiring network data.
FIG. 10 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be the computer device 110 in fig. 1. As shown in fig. 10, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the performance data collection method. The internal memory may also have a computer program stored therein that, when executed by the processor, causes the processor to perform the performance data collection method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 10 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the performance data collection apparatus provided herein may be implemented in the form of a computer program that is executable on a computer device such as that shown in fig. 10. The memory of the computer device may store various program modules constituting the performance data acquisition apparatus, such as the creation module, the first thread, and the second thread shown in fig. 9. The program modules constitute computer programs that cause the processor to execute the steps of the performance data collection method of the embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 10 may execute step S202 by the creation module in the performance data acquisition apparatus shown in fig. 9.
In an embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the performance data acquisition method described above. The steps of the performance data collection method herein may be steps in the XX methods of the various embodiments described above.
In one embodiment, a computer-readable storage medium is provided, in which a computer program is stored, which, when executed by a processor, causes the processor to carry out the steps of the above-mentioned performance data acquisition method. The steps of the performance data collection method herein may be steps in the performance data collection methods of the various embodiments described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by instructing relevant hardware through a computer program, and the program may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of performance data acquisition, comprising:
creating at least one service thread group, wherein the service thread group comprises a first thread and a second thread;
the first thread monitors a performance data acquisition request and caches the performance data acquisition request to a corresponding first message queue;
the first thread reads a performance data acquisition request from the first message queue, and the read performance data acquisition request is used as a target performance data acquisition request;
the first thread writes the target performance data acquisition request into a pre-established debugging bridge client and sends a result reading request to the second thread; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request;
after receiving the result reading request, the second thread reads the request result from the debugging bridge client;
the first thread receives the request result sent by the second thread; and the request result is used for determining the target performance data corresponding to the target performance data acquisition request.
2. The method of claim 1, wherein prior to the first thread listening for a performance data acquisition request, further comprising:
starting a performance data acquisition thread;
the performance data acquisition thread sends a service calling request carrying equipment identification information to the first thread through a service enabling interface;
the first thread creates a debugging bridge client according to the equipment identification information and sends a process object identification corresponding to the successfully created debugging bridge client to the second thread;
and after receiving the process object identification, the second thread returns a service calling success notice.
3. The method of claim 1, wherein the target performance data acquisition request comprises a special string marking request; the special character string marking request is used for acquiring a special character string; the reading of the request result from the debug bridge client comprises:
the second thread reads a character string from the debugging bridge client;
when the special character string is read, the second thread determines all character strings ending to the special character string as a request result corresponding to the result reading request.
4. The method of claim 1, wherein the target performance data acquisition request carries a request identifier; after the first thread receives the request result sent by the second thread, the method further comprises:
the first thread acquires a request identifier corresponding to the request result, and compares the acquired request identifier with a request identifier carried by the target performance data acquisition request;
when the comparison is consistent, the first thread analyzes the request result and writes the analysis result into a corresponding second message queue;
when the comparison is inconsistent, the first line Cheng Diuqi requests the result.
5. The method according to claim 1, wherein the target performance data acquisition request carries a function type identifier and a first request type identifier; after the first thread receives the request result sent by the second thread, the method further comprises:
the first thread traverses a pre-established primary index list according to the function type identifier, determines a primary target index item from the primary index list, and determines a processing object corresponding to the primary target index item as a target processing object;
the first thread determines a secondary target index item from a secondary index list corresponding to the primary target index item according to the first request type identifier, and determines an analysis object corresponding to the secondary target index item as a first target analysis object;
the first thread calls the first target analysis object to analyze the request result through the target processing object to obtain an analysis result;
and the first thread determines the target performance data according to the analysis result and writes the target performance data into a second message queue corresponding to the target processing object.
6. The method according to claim 5, wherein the target performance data acquisition request has a corresponding associated performance data acquisition request, and the associated performance data acquisition request carries a second request type identifier; the first thread determines the target performance data according to the analysis result, and before writing the target performance data into a second message queue corresponding to the target processing object, the method further includes:
the first thread receives an association request result corresponding to the association performance data acquisition request;
the first thread determines a secondary associated target index item from a secondary index list corresponding to the primary target index item according to the second request type identifier, and determines an analysis object corresponding to the secondary associated target index item as a second target analysis object;
the first thread calls the second target analysis object to analyze the association request result through the target processing object to obtain an association analysis result;
the first thread determines the target performance data according to the analysis result, writes the target performance data into a second message queue corresponding to the target processing object, and includes:
and the first thread calls the target processing object to obtain target performance data according to the analysis result and the associated analysis result, and writes the target performance data into a second message queue corresponding to the target processing object.
7. The method of any of claims 1 to 6, further comprising, prior to the first thread listening for a performance data acquisition request:
starting a process monitoring thread;
the process monitoring thread sends a process identification acquisition request to a target service thread group through a service enabling interface; the process identification obtaining request is used for indicating a target service thread group to obtain a process identification of a target process corresponding to the terminal;
when the process identification is read from the message queue corresponding to the target service thread group, the process monitoring thread generates a user identification acquisition request according to the process identification, and sends the user identification acquisition request to the target service thread group through a service enabling interface; the user identifier obtaining request is used for indicating the target service thread group to obtain the user identifier corresponding to the target process;
the process monitoring thread reads the user identification from the message queue corresponding to the target service thread group; the user identification is used for generating a target performance data acquisition request, and the target performance data acquisition request is used for acquiring network data.
8. A performance data collection device, the device comprising:
the system comprises a creating module, a processing module and a processing module, wherein the creating module is used for creating at least one service thread group, and the service thread group comprises a first thread and a second thread;
the first thread is used for monitoring a performance data acquisition request and caching the performance data acquisition request to a corresponding first message queue;
the first thread is also used for reading a performance data acquisition request from the first message queue, and taking the read performance data acquisition request as a target performance data acquisition request;
the first thread is also used for writing the target performance data acquisition request into a pre-established debugging bridge client and sending a result reading request to the second thread; the debugging bridge client is used for acquiring a corresponding request result according to the performance data acquisition request;
the second thread is used for reading the request result from the debugging bridge client after receiving the result reading request;
the first thread is also used for receiving the request result sent by the second thread; and the request result is used for determining the target performance data corresponding to the target performance data acquisition request.
9. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.
CN201911154521.1A 2019-11-22 2019-11-22 Performance data acquisition method, device and computer readable storage medium Active CN111124702B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911154521.1A CN111124702B (en) 2019-11-22 2019-11-22 Performance data acquisition method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911154521.1A CN111124702B (en) 2019-11-22 2019-11-22 Performance data acquisition method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111124702A CN111124702A (en) 2020-05-08
CN111124702B true CN111124702B (en) 2023-03-21

Family

ID=70496507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911154521.1A Active CN111124702B (en) 2019-11-22 2019-11-22 Performance data acquisition method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111124702B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111859082A (en) * 2020-05-27 2020-10-30 伏羲科技(菏泽)有限公司 Identification analysis method and device
CN112019452B (en) * 2020-08-21 2022-06-17 苏州浪潮智能科技有限公司 Method, system and related device for processing service requirement
CN111813533B (en) * 2020-09-11 2020-12-11 腾讯科技(深圳)有限公司 Dynamic management method and device for model instantiation and storage medium
CN112631891A (en) * 2021-01-05 2021-04-09 网易(杭州)网络有限公司 Performance analysis method and device, electronic equipment and storage medium
CN113157467B (en) * 2021-05-07 2023-07-04 瑞斯康达科技发展股份有限公司 Multi-process data output method
CN113923005B (en) * 2021-09-30 2024-04-09 惠州Tcl移动通信有限公司 Method and system for writing data
CN115174296B (en) * 2022-05-30 2024-03-22 青岛海尔科技有限公司 Equipment function access method and device, storage medium and electronic device
CN115002219B (en) * 2022-05-30 2023-07-25 广州市百果园网络科技有限公司 Service calling method, device, equipment, system, storage medium and product

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808404A (en) * 2014-12-31 2016-07-27 成都鼎桥通信技术有限公司 Shared pipeline based Android device debug method
CN106598706A (en) * 2015-10-15 2017-04-26 五八同城信息技术有限公司 Method and device for improving stability of server, and server
CN107872398A (en) * 2017-06-25 2018-04-03 平安科技(深圳)有限公司 High concurrent data processing method, device and computer-readable recording medium
WO2018108041A1 (en) * 2016-12-13 2018-06-21 腾讯科技(深圳)有限公司 Remote debugging method and device, and computer storage medium
CN108595312A (en) * 2017-12-29 2018-09-28 瑞庭网络技术(上海)有限公司 A kind of automatic performance method and device of modelling customer behavior
CN109753414A (en) * 2017-11-01 2019-05-14 阿里巴巴集团控股有限公司 Acquisition method, methods of exhibiting, electronic equipment and the client of performance data
CN109766253A (en) * 2018-12-15 2019-05-17 平安证券股份有限公司 A kind of performance data sending method, device, computer equipment and storage medium
CN109840209A (en) * 2019-01-18 2019-06-04 深圳壹账通智能科技有限公司 Application performance collecting method, terminal, computer equipment and storage medium
CN110389872A (en) * 2018-04-16 2019-10-29 腾讯科技(深圳)有限公司 A kind of collecting method, device and relevant device
CN110457211A (en) * 2019-07-23 2019-11-15 腾讯科技(深圳)有限公司 Script performance test methods, device and equipment and computer storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808404A (en) * 2014-12-31 2016-07-27 成都鼎桥通信技术有限公司 Shared pipeline based Android device debug method
CN106598706A (en) * 2015-10-15 2017-04-26 五八同城信息技术有限公司 Method and device for improving stability of server, and server
WO2018108041A1 (en) * 2016-12-13 2018-06-21 腾讯科技(深圳)有限公司 Remote debugging method and device, and computer storage medium
CN107872398A (en) * 2017-06-25 2018-04-03 平安科技(深圳)有限公司 High concurrent data processing method, device and computer-readable recording medium
CN109753414A (en) * 2017-11-01 2019-05-14 阿里巴巴集团控股有限公司 Acquisition method, methods of exhibiting, electronic equipment and the client of performance data
CN108595312A (en) * 2017-12-29 2018-09-28 瑞庭网络技术(上海)有限公司 A kind of automatic performance method and device of modelling customer behavior
CN110389872A (en) * 2018-04-16 2019-10-29 腾讯科技(深圳)有限公司 A kind of collecting method, device and relevant device
CN109766253A (en) * 2018-12-15 2019-05-17 平安证券股份有限公司 A kind of performance data sending method, device, computer equipment and storage medium
CN109840209A (en) * 2019-01-18 2019-06-04 深圳壹账通智能科技有限公司 Application performance collecting method, terminal, computer equipment and storage medium
CN110457211A (en) * 2019-07-23 2019-11-15 腾讯科技(深圳)有限公司 Script performance test methods, device and equipment and computer storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Android性能测试(内存、cpu、fps、流量、GPU、电量)——adb篇;某杰;《https://www.jianshu.com/p/6c0cfc25b038》;第1-6页 *
基于Android GUI控件的自动化测试系统设计与实现;周一川;《中国优秀硕士学位论文全文数据库 信息科技辑》;I138-525 *
安卓Robotium自动化测试框架的改进与实现;刘遂辉;《中国优秀硕士学位论文全文数据库 信息科技辑》;I138-293 *

Also Published As

Publication number Publication date
CN111124702A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111124702B (en) Performance data acquisition method, device and computer readable storage medium
WO2019085073A1 (en) Interface test method and apparatus, computer device, and storage medium
CN109034993B (en) Account checking method, account checking equipment, account checking system and computer readable storage medium
WO2019085079A1 (en) Interface test method and apparatus, computer device and storage medium
WO2020186809A1 (en) Big data platform-based hive task scheduling method and apparatus, device, and storage medium
CN107105009B (en) Job scheduling method and device for butting workflow engine based on Kubernetes system
CN112527816B (en) Data blood relationship analysis method, system, computer equipment and storage medium
CN105607986A (en) Acquisition method and device of user behavior log data
CN110378681B (en) Method, device, equipment and storage medium for determining account resource transfer path
CN110765288B (en) Image information synchronization method, device and system and storage medium
CN111831542B (en) API application debugging method and device and storage medium
CN109831677B (en) Video desensitization method, device, computer equipment and storage medium
WO2020232883A1 (en) Script defect scanning method and apparatus, computer device and storage medium
CN111475324A (en) Log information analysis method and device, computer equipment and storage medium
CN108733545B (en) Pressure testing method and device
CN111694734A (en) Software interface checking method and device and computer equipment
CN110336791B (en) Method, device and equipment for transmitting breakpoint data and computer storage medium
CN111125748A (en) Judgment method and device for unauthorized query, computer equipment and storage medium
CN109474386B (en) Signaling tracking method, system, network element equipment and storage medium
CN111459796A (en) Automatic testing method and device, computer equipment and storage medium
CN114238140A (en) Access test method and device
CN112948124A (en) Method, device and equipment for processing accelerated task and readable storage medium
US10671505B2 (en) System and method for monitoring service
US9838488B2 (en) Agent asynchronous transaction monitor
CN110798678B (en) Video integrity detection method and device, computer equipment and readable storage medium

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