Method and system for monitoring bottom-layer running performance of IOS application, medium and equipment

A technology for application operation and operation performance, applied in hardware monitoring, error detection/correction, instruments, etc., can solve the problems of inability to measure performance, inability to monitor IOS application operation status, etc., and achieve the effect of occupying less memory

Active Publication Date: 2018-06-22
WUHAN DOUYU NETWORK TECH CO LTD
2 Cites 2 Cited by

AI-Extracted Technical Summary

Problems solved by technology

However, the Instrument tool can only be used by programmers with application source code, so it must be connected to a computer, and it cannot measure the perfor...
View more

Method used

Embodiments of the present invention realize real-time acquisition of CPU usage and current memory usage by the CPU usage monitoring module and the memory usage monitoring module, which can be directly executed o...
View more

Abstract

The invention discloses a method and system for monitoring the bottom-layer running performance of an IOS application, a medium and equipment, and relates to the technical field of IOS applications. According to the method, a class of an Objective-C is defined, a singleton of the Objective-C is loaded, and a notification observer is added in the class of the Objective-C, used for monitoring a clock heartbeat notification and bound with a method for obtaining a current CPU usage rate or a method for obtaining a current memory usage rate; when the clock heartbeat notification is received, the method for obtaining the current CPU usage rate is called to calculate the current CPU usage rate or the method for obtaining the current memory usage rate is called to calculate the current memory usage rate. Few codes are needed for developing the class of the Objective-C at an IOS mobile terminal, the occupied memory is also small during running, and therefore the scheme can effectively monitor the bottom-layer running performance of the IOS application of the mobile terminal after the IOS application is released on the mobile terminal.

Application Domain

Hardware monitoring

Technology Topic

Embedded systemObjective-C

Image

  • Method and system for monitoring bottom-layer running performance of IOS application, medium and equipment
  • Method and system for monitoring bottom-layer running performance of IOS application, medium and equipment

Examples

  • Experimental program(4)

Example Embodiment

[0040] Example 1:
[0041] The embodiment of the present invention discloses a bottom-level running performance monitoring method of an IOS application:
[0042] Monitor the underlying running performance of IOS applications, including the CPU usage or memory usage occupied by the monitored IOS applications, including:
[0043] The CPU usage occupied by the monitored IOS application running includes:
[0044] Define the first Objective-C class, name it DYCpuMonitor, and implement its singleton loading, add the first notification observer to the first Objective-C class, use the notification observer to monitor the clock heartbeat notification, and serve as the first notification The observer is bound to the first calling method; when receiving the clock heartbeat notification, the first calling method is called to query the CPU usage of each thread of the current task when the IOS application is running, and accumulate the CPU usage of all threads of the current task when the IOS application is running. CPU usage Calculates the current CPU usage;
[0045] The memory usage occupied by the monitored IOS application running includes:
[0046] Define the second Objective-C class, name it DYMemoryMonitor, and implement its singleton loading, add a second notification observer to the second Objective-C class, use the second notification observer to monitor the clock heartbeat notification, and provide the first The second notification observer specifies the second calling method; when receiving the clock heartbeat notification, call the second calling method to obtain the physical memory size occupied by the current task when the IOS application is running, and divide the physical memory size occupied by the current task when the IOS application is running. The total memory size gives the current memory usage.
[0047] 1) Call the first calling method to query the CPU usage of each thread of the current task when the IOS application is running, and accumulate the CPU usage of all threads of the current task when the IOS application is running to calculate the current CPU usage includes:
[0048] Use the task_threadsAPI provided by the IOS kernel mach layer kernel to obtain the thread list of the current task;
[0049] Traverse all the threads in the thread list, query the information of each thread by calling the thread_info API provided by the IOS kernel mach layer to obtain the usage rate of each thread, and accumulate the usage rates of all threads to get the current CPU usage.
[0050] Add a usage property to the Objective-C class, and accumulate the CPU usage of all threads of the current task when the IOS application is running by accumulating the usage of each thread in the thread list of the current task into the usage property.
[0051] 2) Call the second calling method to obtain the physical memory size occupied by the current task when the IOS application is running, and divide the physical memory size occupied by the current task when the IOS application is running by the total memory size to obtain the current memory usage including:
[0052] Use the task_info API provided by the IOS kernel mach layer to obtain the information of the current task, obtain the resident_size in the information of the current task, and divide the resident_size by the total memory size to obtain the current memory usage.

Example Embodiment

[0053] Example 2:
[0054] see figure 1 As shown, the embodiment of the present invention discloses a bottom-level running performance monitoring system of an IOS application, including:
[0055] The CPU usage monitoring module is used to define the first Objective-C class and implement its singleton loading, add a first notification observer to the first Objective-C class, and use the notification observer to monitor the clock heartbeat notification, And bind the first calling method for the first notification observer; when receiving the clock heartbeat notification, call the first calling method to query the CPU usage of each thread of the current task when the IOS application is running, and accumulate the current when the IOS application is running. The CPU usage of all threads of the task calculates the current CPU usage;
[0056] The memory usage monitoring module is used to define the second Objective-C class and implement its singleton loading, add a second notification observer to the second Objective-C class, and use the second notification observer to monitor the clock heartbeat Notify, and specify the second calling method for the second notification observer; when receiving the clock heartbeat notification, call the second calling method to obtain the physical memory size occupied by the current task when the IOS application is running, and use the current task when the IOS application is running. The current memory usage is calculated by dividing the physical memory size by the total memory size.
[0057] The CPU usage monitoring module is used to:
[0058] Use the task_threadsAPI provided by the IOS kernel mach layer kernel to obtain the thread list of the current task;
[0059] Traverse all threads in the thread list, query the information of each thread by calling the thread_info API provided by the IOS kernel mach layer to obtain the usage rate of each thread, and accumulate the usage rates of all threads to get the current CPU usage.
[0060] The CPU usage monitoring module is used to add a usage attribute to the Objective-C class. By accumulating the usage of each thread into the usage attribute, the CPU usage of all threads of the current task is accumulated when the IOS application is running.
[0061] The memory usage monitoring module is used to: use the task_info API provided by the IOS kernel mach layer to obtain the information of the current task, obtain the resident_size in the information of the current task, and divide the resident_size by the total memory size to obtain the current memory usage.
[0062] The embodiment of the present invention realizes real-time acquisition of the CPU usage rate and the current memory usage rate through the CPU usage rate monitoring module and the memory usage rate monitoring module, which can be directly executed on the mobile phone without additionally connecting the application source code of the computer. Effective monitoring of your app's CPU usage and current memory usage.

Example Embodiment

[0063] Example 3:
[0064] The embodiment of the present invention discloses a storage medium, where a computer program is stored on the storage medium, and a performance monitoring method for an IOS application is implemented when the computer program is executed by a processor.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Automatic box making device and method

ActiveCN105235278AImprove processing speed and productivitysmall footprint
Owner:中科天工(广东)智能技术有限公司

Rolling piston type compressor with no reservoir

Owner:SHANGHAI HITACHI ELECTRICAL APPLIANCES CO LTD

Multistage integrated hydrodynamic cyclone separator

InactiveCN102512857ASmall footprintEasy to install and control
Owner:BEIJING UNIVERSITY OF CIVIL ENGINEERING AND ARCHITECTURE

Automatic processing production line for metal sheets

ActiveCN105458718ASmall footprintReasonable production beat matching
Owner:江苏扬力数控机床有限公司

Classification and recommendation of technical efficacy words

Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products