Cocos2d-x is a well-known open source mobile game framework that can be built and run on iOS, Android, Blackberry and other operating systems. Cocos2d-x was used to develop mobile games such as Fishing Master, Three Kingdoms Tower Defense – Legend of Shu and MY Name is MT in China, as well as Angry Birds Battle and BADLAND.

Due to the running environment, code compatibility problems, Cocos2d – x mobile game will collapse, caton, slow loading, excessive resource consumption and other issues, so the game operators need to accurately understand the game in the user environment performance, and through the log data and buried point cannot fully reflect the network and server problems caused by the fault, So game developers need application performance management tools that cover the entire technology stack and all the end-to-end aspects of the game to accurately identify, locate, and resolve problems. Today we will look at the cloud intelligence application performance products – How to achieve the performance monitoring of CoCOS2D-X mobile games fluorotreasure.

Cross-platform principle of CoCOS2D-X

In order to make full use of the hardware performance, mobile games usually use Native App development mode, which causes developers to develop different apps for iOS and Android platform users, no matter product iteration or operation and maintenance is very troublesome. Cocos2d-x encapsulates a layer of C++ interface on iOS, Android and other mobile platforms, so as to shield the differences of platforms. Platform macros are used to control which platform code is used, and C++ interface calls are provided to developers.

These interfaces mainly include UI, event and network. Encapsulating UI mainly uses OpenGL ES interface to write UI, encapsulating event and network. Both use C++ interface to encapsulate the native interface. So the cross-platform principle of cocos2d-x is: APP-> call the common C++ interface -> call the platform implementation

Perspective treasure on CoCOS2D-X game monitoring features

In summary, cocos2d-x is a C++ interface on top of the native interface. The SDK supports monitoring of cocos2d-x’s native network requests, as well as monitoring of cocos2d-x’s libcurl network library. In addition, it supports H5 monitoring. Socket monitoring, basic operation information acquisition, geographic analysis, combination analysis, hijacking analysis, mobile topology analysis and crash information collection.

 
Network monitoring

Network is the most important reason for the deadlock of mobile online games. The network connectivity between the three major mobile operators in China has not been really solved. At the same time, the uneven network quality of various broadband access providers will affect the operation of games, especially the experience of real-time game players. NSURLSession, NSURLConnection, libcurl, HTTP, HTTPS Monitoring indicators including the response time, throughput, HTTP error rate trend, the network failure, request error rates contrast, error tracking, etc., at the same time able to domain name for the dimension statistics all the HTTP requests information, including name of the request, the average response time, throughput, HTTP error rate and network failure rate, number of requests, etc.

Because libcurl is written in C, you can’t hook it, and you don’t have the bytecode to rewrite it. So you can do this by burying the source code of the libcurl library and repackaging it as the libcurl. You don’t have to write extra code, and the iOS and Android platforms are interoperable. If developers are concerned about replacing the native libcurl. A library, we also provide an automatic buried way to collect network request performance data from the libcurl network library.

The Socket monitoring

Socket ports are usually used for communication between mobile clients and servers, so Socket monitoring is also necessary. Xanbao can monitor the N hosts (Server) with the slowest response in connection establishment, the N hosts with the slowest response in writing or reading to the Server, and the N hosts with the largest number of exceptions during communication between App and Server within a period of time. Monitor the host IP address, port number, start time, and connection time to mark abnormal sockets. Provides detailed analysis of a single connection, including detailed device parameters, connection time, DNS resolution time, write or read time to the Server, byte change trend, and exception stack. Analyze the exceptions occurred during the communication between App and server in a period of time, including the number of abnormal users, number of abnormal users, App version of abnormal users, number of abnormal users, and trend of abnormal changes.

H5 Page performance monitoring



HTML5 pages, which are update-free and easy to maintain, are widely used in mobile game announcements, event pages, payment pages and other scenarios. However, Through the analysis of H5 performance data, Qianbao can find out the problems existing in the loading of web pages. The HTML5 monitoring of Qianbao mainly includes page loading performance analysis and Ajax performance analysis, which respectively analyzes the page loading performance from the dimensions of response time and JS/Ajax errors.

Operation analysis

In the fierce competition in the mobile game market, excellent online game operations is a game from began to emerge from competing goods condition, then the traditional operating tools cannot provide accurate monitoring and analysis on the performance of user experience, when received the game from the user feedback caton problems can only according to preset routines to answer, and can’t solve the problem of users in a timely manner. Perspective treasure from the perspective of the user experience provide competitors swim application operation analysis, including the access ways, carriers and system version analysis, application version, device analysis, spatial analysis, such as collapse, hijacked analysis, at the same time be able to regional, operators, combination in the form of access to the multidimensional analysis cocos application performance.

In addition, Xanbao.com provides mobile application topologies, which can help o&M operators to understand the overall running status of CoCOS2D-X games in real time, including its own services and external services that the application is using. Through the topologies, you can view the HTTP error rate and network failure rate of the entire application. As well as HTTP error rate, network failure rate and response time for each service, accurately detect, locate and handle network and service failures before players complain, and ensure that user feedback is effectively resolved.

Review images