Performance data statistics method and device, server, storage medium and program product
Patent Information
- Application Number
- CN202210495390.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-07
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-05-07
AI Technical Summary
[0004]但是,在函数级别对服务器进行性能数据统计,仅可以明确服务器中各个函数的耗时情况,无法明确函数的执行对象,进而无法直观地分析服务器的性能状况
[0018]This paper provides a method for performance data statistics of application servers. By adding a performance statistics component to the application server and determining the target heartbeat object and target performance data dimension for performance statistics based on the target configuration file corresponding to the performance statistics component, users can specify the heartbeat object in the virtual scene to be statistically analyzed and the target performance data to be analyzed through the target configuration file. This avoids the analysis of other irrelevant heartbeat objects or performance data, thereby saving workload and data storage overhead in the performance data statistics process. In addition, the corresponding target performance data can be obtained directly at the heartbeat object level, and the heartbeat object to which the target performance data is targeted can be clearly identified. Therefore, when the target performance data indicates a performance problem, the relationship between the performance data and the heartbeat object can be used to more accurately pinpoint the performance problem in the application server.
Smart Images

Figure CN117056181B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of performance statistics technology, and in particular to a performance data statistics method, apparatus, server, storage medium, and program product. Background Technology
[0002] During gameplay, the game server provides backend services for the game application and facilitates information exchange between various terminals. Therefore, identifying performance issues on the game server is crucial for its proper functioning.
[0003] In related technologies, by analyzing the time spent on functions in a server, one can understand how the server consumes computing resources; by statistically analyzing the server's performance data at the function level, one can obtain the proportion of time spent on all functions in the server, as well as the calling relationships between functions, thereby determining which functions primarily consume the server's computing resources.
[0004] However, performing performance data statistics on the server at the function level can only clarify the time consumption of each function in the server, but cannot clarify the execution object of the function, and therefore cannot intuitively analyze the server's performance status. Summary of the Invention
[0005] This application provides a performance data statistics method, apparatus, server, storage medium, and program product. The technical solution includes the following aspects.
[0006] On the one hand, embodiments of this application provide a performance data statistics method, the method comprising:
[0007] Obtain the target configuration file corresponding to the performance statistics component;
[0008] Based on the target configuration file, the target heartbeat object and target performance data dimension that the performance statistics component needs to count are determined. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be counted. The performance data is related to the running performance of the application server.
[0009] The performance statistics component uses the execution information generated by the target heartbeat object performing the heartbeat operation during the operation of the application server to calculate the target performance data of the target heartbeat object in the target performance data dimension.
[0010] On the other hand, embodiments of this application provide a performance data statistics device, the device comprising:
[0011] The acquisition module is used to acquire the target configuration file corresponding to the performance statistics component;
[0012] The determination module is used to determine, based on the target configuration file, the target heartbeat object and the target performance data dimension that the performance statistics component needs to collect statistics on. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be collected. The performance data is related to the running performance of the application server.
[0013] The statistics module is used to, through the performance statistics component, statistically analyze the target performance data of the target heartbeat object in the target performance data dimension based on the execution information generated by the target heartbeat object performing the heartbeat operation during the operation of the application server.
[0014] On the other hand, embodiments of this application provide a server, the server including a processor and a memory, the memory storing at least one program, the at least one program being loaded and executed by the processor to implement the performance data statistics method as described above.
[0015] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the performance data statistics method described above.
[0016] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the performance data statistics method provided in the above-described optional implementation.
[0017] The beneficial effects of the technical solutions provided in this application include at least the following:
[0018] This paper provides a method for performance data statistics of application servers. By adding a performance statistics component to the application server and determining the target heartbeat object and target performance data dimension for performance statistics based on the target configuration file corresponding to the performance statistics component, users can specify the heartbeat object in the virtual scene to be statistically analyzed and the target performance data to be analyzed through the target configuration file. This avoids the analysis of other irrelevant heartbeat objects or performance data, thereby saving workload and data storage overhead in the performance data statistics process. In addition, the corresponding target performance data can be obtained directly at the heartbeat object level, and the heartbeat object to which the target performance data is targeted can be clearly identified. Therefore, when the target performance data indicates a performance problem, the relationship between the performance data and the heartbeat object can be used to more accurately pinpoint the performance problem in the application server. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This application shows a schematic diagram of a heartbeat tree structure in a game server, illustrating an exemplary embodiment.
[0021] Figure 2 A schematic diagram of an implementation environment provided by an exemplary embodiment of this application is shown;
[0022] Figure 3 A flowchart illustrating a performance data statistics method provided in an exemplary embodiment of this application is shown;
[0023] Figure 4 A flowchart of a performance data statistics method provided in another exemplary embodiment of this application is shown;
[0024] Figure 5 This application illustrates a schematic diagram of statistical results for the number of heartbeat objects, as shown in an exemplary embodiment.
[0025] Figure 6 This invention provides a schematic diagram illustrating statistical results of heartbeat object time consumption information in an exemplary embodiment of this application.
[0026] Figure 7 This illustration shows a schematic diagram of statistical results for heartbeat object time consumption information, as illustrated in another exemplary embodiment of this application.
[0027] Figure 8This invention provides a schematic diagram illustrating statistical results of detailed time consumption information for a heartbeat object, as shown in an exemplary embodiment of this application.
[0028] Figure 9 This illustration shows a schematic diagram of the statistical results of the time consumption information of the object component corresponding to the heartbeat object, as illustrated in an exemplary embodiment of this application.
[0029] Figure 10 A schematic diagram illustrating performance data statistics is shown in an exemplary embodiment of this application;
[0030] Figure 11 This application illustrates a schematic diagram of a process for taking a snapshot of the performance of an integrated object, as shown in an exemplary embodiment.
[0031] Figure 12 A flowchart of a performance data statistics method provided in another exemplary embodiment of this application is shown;
[0032] Figure 13 This is a structural block diagram of a performance data statistics device provided in an exemplary embodiment of this application;
[0033] Figure 14 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0035] First, a brief explanation of the terms used in this application will be provided:
[0036] (1) Heartbeat operation: The application server executes some specific code at fixed intervals (usually every frame) to complete a heartbeat-like operation; for example, updating the status, performing timed operations, and performing periodic logic.
[0037] (2) Heartbeat object: The object that performs the heartbeat operation in the application server. Taking the application server as a game server as an example, the heartbeat object can be a player character, a non-player character (NPC), a treasure chest, a dropped item, a map tile, a scene, a scene manager, etc. in the game server.
[0038] (3) Object component: The object component is mainly responsible for handling the object behavior of the heartbeat object in order to realize the object function of the heartbeat object.
[0039] (4) Heartbeat Tree: Heartbeat objects and object components are organized using a tree structure. For example... Figure 1The diagram illustrates a heartbeat tree structure in a game server according to an exemplary embodiment of this application. The heartbeat object (Obj) includes: SceneMgr (scene manager, used to manage all Scenes in the application server), Scene (scene, describing a scene instance, equivalent to a large map, managing all Cells), Cell (scene chunk, describing a segmented area within a scene, managing all Actors within that area), and Actor (character, describing runtime lifeform objects in the scene, including player characters, monsters, pets, treasure chests, dropped items, etc.). Components (Comp) include: SceneMgrComp (components of the SceneMgr object, including a server-wide unique ID generation component, a scene controller component, etc.), SceneComp (components of the Scene object, including a map teleportation component, a Cell manager component, etc.), CellComp (components of the Cell object, including an NPC generation component, a resource management component, etc.), and ActorComp (components of the Actor object, including interaction components, view management components, navigation components, AI components, etc.). Components are mainly used to implement the functions of their respective objects; therefore, each type of object has a large number of components. Figure 1 The listed components are only a small part.
[0040] Figure 2 A schematic diagram of an implementation environment provided by an exemplary embodiment of this application is shown. This implementation environment includes a terminal 210, an application server 220, a performance data management server 230, and a performance data query device 240.
[0041] Terminal 210 is a device running an application. Terminal 210 can be a smartphone, tablet, or personal computer, etc., and this embodiment is not limited thereto. Taking terminal 210 as a device running a game application as an example, the game application can be any one of the following: first-person shooter (FPS) game, multiplayer online battle arena (MOBA) game, or simulation game (SLG).
[0042] Application server 220 is the backend server or business server for the application running in terminal 210. It can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms.
[0043] In this embodiment, a performance statistics component 221 is added to the application server 220. The performance statistics component can collect performance data in the server 220 and upload the performance data to the performance data management server 230.
[0044] The performance data management server 230 is used to store the performance data obtained by the performance statistics component 221. It can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0045] In this embodiment, the performance data management server 230 can transmit performance data to the performance data query device 240, so that users can view the performance data in real time through the performance data query device 240. Optionally, the performance data management server 230 can also issue an alarm when performance data is abnormal.
[0046] The performance data query device 240 is a device with data query functionality. It can be a smartphone, tablet, personal computer, etc., and this embodiment does not limit its use. In this embodiment, the performance data query device 240 provides a performance statistics page, where users can view the statistically obtained performance data. Optionally, the performance data can be displayed in file format or in chart format.
[0047] Please refer to Figure 3 This document illustrates a flowchart of a performance data statistics method provided in an exemplary embodiment of this application. This embodiment uses an application server 220 as an example to illustrate the method, which includes:
[0048] Step 301: Obtain the target configuration file corresponding to the performance statistics component.
[0049] The performance statistics component includes a performance data acquisition function. In this embodiment, by adding a performance statistics component to the application server, the performance data corresponding to each heartbeat object in the application server can be collected and statistically analyzed in real time during the application server's operation.
[0050] Optionally, the application server is configured with a target configuration file corresponding to the performance statistics component. The target configuration file is configured with the statistical parameters corresponding to the performance statistics component, such as the statistical mode of the performance statistics component, the statistical object of the performance statistics component, and the performance data dimensions (performance data types) that the performance statistics component needs to collect.
[0051] Optionally, the statistical parameters in the target configuration file can be manually configured by business personnel. In an exemplary example, the business personnel's terminal runs a performance statistics application (or performance statistics configuration webpage) corresponding to the performance statistics component. The business personnel can configure the statistical parameters in the performance statistics configuration interface of the performance statistics application or in the performance statistics configuration webpage. After the business personnel complete the configuration, the corresponding target configuration file is generated and sent to the application server, which then obtains the target configuration file.
[0052] In one possible implementation, before the application server performs performance data statistics through the performance statistics component, it first needs to obtain the target configuration file corresponding to the performance statistics component. By reading the target configuration file, the statistical parameters of the performance statistics component are obtained, and then the performance statistics component is controlled to perform performance data statistics based on the statistical parameters.
[0053] Step 302: Based on the target configuration file, determine the target heartbeat object and target performance data dimension that the performance statistics component needs to collect. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be collected. The performance data is related to the running performance of the application server.
[0054] It should be noted that the application server in this application embodiment is a server that supports virtual scenes. For example, the application server can be an application server corresponding to a game application, which is an application that supports virtual scenes. The virtual scene corresponding to the game application is also called a virtual environment. The virtual environment can be a simulation environment of the real world, a semi-simulated and semi-fictional environment, or a purely fictional environment, etc. Alternatively, the application server can also be an application server corresponding to any other application that supports virtual scenes, such as a virtual live streaming application, a virtual augmented reality (AR) application, etc.
[0055] During the operation of an application server supporting virtual scenes, the application server needs to manage the scene objects contained in the virtual scene. For example, taking the application server corresponding to a game application as an example, during the operation of the application server, there are various scene objects in the virtual scene, such as game characters, NPCs, game maps, treasure chests, etc., and scene objects need to perform certain object operations or behaviors in the virtual scene. When the scene object performs object behaviors or behaviors, the application server needs to allocate running resources for it. Therefore, the running performance of the application server can be analyzed from the dimension of the object operation execution information of each scene object contained in the virtual scene. For example, the time required for the scene object to perform object operations at a certain moment can be obtained. Based on the time consumption information, the current load of the application server can be analyzed (high time consumption may be due to high load), thereby analyzing the performance bottleneck of the application server. In this embodiment of the application, the focus is mainly on the heartbeat object that performs heartbeat operations in the virtual scene, so as to analyze the running performance of the application server from the dimension of the performance data of the heartbeat object.
[0056] Unlike related technologies that perform performance statistics at the function level, this application embodiment performs performance data statistics at the heartbeat object level. Since there are numerous heartbeat objects in the virtual scenarios supported by the application server, performing performance data statistics on each heartbeat object would obviously incur significant performance data statistics overhead. Furthermore, business users have different focuses regarding the performance data of different heartbeat objects. Therefore, to reduce the collection of unnecessary performance data, in one possible implementation, business users can specify the target heartbeat objects to be statistically analyzed through a target configuration file. This allows the application server to determine the target heartbeat objects that the performance statistics component needs to analyze by reading the target configuration file.
[0057] Similar to heartbeat objects, during application server operation, heartbeat objects may contain performance data of various data types. For example, heartbeat time data when the heartbeat object performs a heartbeat operation, heartbeat time data of the corresponding object component, heartbeat time data corresponding to different stages of the heartbeat object's operation, memory data corresponding to the heartbeat object, etc. Business users may be more concerned with the data of different heartbeat objects in specific performance data dimensions. Therefore, in order to further avoid collecting unnecessary performance data, in one possible implementation, business users can specify the target performance data dimensions that need to be collected for the target heartbeat object through a target configuration file. This allows the application server to determine the target performance data dimensions that the performance statistics component needs to collect by reading the target configuration file, that is, to determine the data type of the performance data to be collected.
[0058] During the operation of the application server, each heartbeat object in the virtual scene often requires the application server to allocate running resources when performing heartbeat operations. Therefore, in order to facilitate the analysis of the application server's running performance from the perspective of heartbeat objects, the performance data collected by the statistical component is data related to the running performance of the application server.
[0059] Optionally, performance data can be collected across different performance data dimensions for different heartbeat objects. In an exemplary example, if the performance data dimensions include: performance data dimension A, performance data dimension B, performance data dimension C, and performance data dimension D, heartbeat object A can be configured to collect performance data in performance data dimension C, heartbeat object B can be configured to collect performance data in performance data dimension A, and heartbeat object C can be configured to collect performance data in performance data dimension D.
[0060] Optionally, for the same heartbeat object, performance data can be collected across different performance data dimensions. For example, heartbeat object A can be configured to collect performance data across both performance data dimension A and performance data dimension D.
[0061] Optionally, during a single performance statistics process, performance data for multiple heartbeat objects can be collected simultaneously across at least one performance data dimension.
[0062] Optionally, business personnel can configure the statistical objects and statistical data dimensions on the performance statistics configuration page corresponding to the performance statistics component. They can select the target heartbeat objects for which performance statistics need to be performed, as well as the target statistical data dimensions for each target heartbeat object.
[0063] Since the heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server, by statistically analyzing the performance data of the heartbeat object when it performs heartbeat operations during the operation of the application server, it is possible to identify which heartbeat object performed the corresponding heartbeat operation, which is more conducive to analyzing the performance problems of the application server.
[0064] Step 303: Using the performance statistics component, based on the execution information generated by the target heartbeat object performing heartbeat operations during the application server's operation, statistically analyze the target performance data of the target heartbeat object in the target performance data dimension.
[0065] In one possible implementation, once the application server determines the target heartbeat object to be statistically analyzed by the performance statistics component through the performance target configuration file, and the target performance data dimension to be analyzed, the performance statistics component can collect the execution information generated when the heartbeat object performs a heartbeat operation during the application server's operation, and then, based on this execution information, statistically analyze the target performance data of the target heartbeat object in the target performance data dimension.
[0066] Taking the target performance data as the time taken when the target heartbeat object performs a heartbeat operation as an example, the performance statistics component can obtain the start time and end time of the heartbeat operation when the target heartbeat object performs a heartbeat operation. That is, the execution information includes the start time and end time of the execution, and then determine the time taken when the target heartbeat object performs a heartbeat operation based on the execution information.
[0067] Optionally, after the application server obtains the required target performance data through the performance statistics component, it can push it to the front-end interface for display. The front-end interface can be the application interface of the performance application corresponding to the performance statistics component, or it can be the performance statistics webpage corresponding to the performance statistics component.
[0068] In summary, this application provides a method for performance data statistics of an application server. By adding a performance statistics component to the application server and determining the target heartbeat object and target performance data dimension to be statistically analyzed based on the target configuration file corresponding to the performance statistics component, users can specify the heartbeat object to be statistically analyzed and the target performance data to be analyzed through the target configuration file. This avoids analyzing other irrelevant heartbeat objects or performance data, thereby saving workload and data storage overhead in the performance data statistics process. In addition, the corresponding target performance data can be obtained directly at the heartbeat object level, and the heartbeat object to which the target performance data is targeted can be clearly identified. Therefore, when the target performance data indicates a performance problem, the relationship between the performance data and the heartbeat object can be used to more accurately find the performance problem in the server.
[0069] Please refer to Figure 4 This illustration shows a flowchart of a performance data statistics method provided in another exemplary embodiment of this application. This embodiment uses an application server 220 as an example to illustrate the method, which includes:
[0070] Step 401: Obtain the target configuration file corresponding to the performance statistics component.
[0071] In one possible implementation, business personnel can perform configuration operations on the performance statistics configuration page of the target terminal to configure the statistical parameters of the performance statistics component: statistical object (heartbeat object), statistical performance data dimension, and statistical time. After that, the target terminal can generate a target configuration file based on the configuration operations on the performance statistics configuration page and send the target configuration file to the application server. The corresponding application server can receive the target configuration file sent by the target terminal to obtain the target configuration file corresponding to the performance statistics component.
[0072] Optionally, the target terminal may be the performance data query device 240 in the above embodiment; the target terminal may integrate the performance statistics application corresponding to the performance statistics component, so that business personnel can specify the performance data that the performance statistics component needs to collect through the performance statistics application.
[0073] Optionally, after the application server obtains the target performance data, it can also feed the target performance data back to the target terminal so that the target terminal can display the target performance data in the performance statistics configuration page.
[0074] Step 402: Based on the target configuration file, determine the target heartbeat object and target performance data dimension that the performance statistics component needs to collect. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be collected. The performance data is related to the running performance of the application server.
[0075] The implementation method of step 402 can be referred to the above embodiment, and will not be repeated here.
[0076] Step 403: Based on the target configuration file, determine the target statistical mode in which the performance statistics component is located.
[0077] It should be noted that steps 402 and 403 can be executed simultaneously, or steps 402 can be executed first and then steps 403, or steps 403 can be executed first and then steps 402. All of these are processes of determining the statistical parameters of the performance statistics component by reading the target configuration file before the performance statistics component performs performance data statistics. Therefore, this embodiment does not limit the order of steps 402 and 403.
[0078] by Figure 1Taking the heartbeat tree shown as an example, when the target heartbeat object is located at the root node, the target heartbeat object is also associated with heartbeat objects or heartbeat child objects located at the leaf nodes. Correspondingly, when calculating the target performance data corresponding to the target heartbeat object, there may be two possible scenarios: one is to only calculate the performance data of the target heartbeat object, and the other is to calculate the performance data of all heartbeat objects in the heartbeat subtree with the target heartbeat object as the heartbeat object. In order to distinguish between the two statistical scenarios, in one possible implementation, the performance statistics component is set with a first statistical mode and a second statistical mode. The first statistical mode is ObjRoot, which only calculates the performance data of the target heartbeat object, and the second statistical mode is ObjTree, which calculates the performance data of all heartbeat objects in the entire attached heartbeat subtree.
[0079] by Figure 1 For example, if the target heartbeat object corresponding to the performance statistics component is SceneMgr, that is, the performance statistics component is mounted on SceneMgr, when the statistics mode of the performance statistics component is ObjRoot, the performance statistics component only counts the performance data of SceneMgr. When the statistics mode of the performance statistics component is ObjTree, the performance statistics component can count the performance data of all heartbeat objects in the heartbeat subtree (heartbeat tree) with SceneMgr as the root node. That is, the performance statistics component will count the performance data of heartbeat objects such as SceneMgr, Scene, Cell, and Actor.
[0080] Optionally, given the difference in performance data between the first and second statistical modes, the performance data calculated under the second statistical mode includes the performance data calculated under the first statistical mode. Therefore, for performance data of other leaf nodes on the heartbeat subtree that some business personnel do not care about, the performance statistics component can be set to the first statistical mode to avoid calculating unnecessary performance data.
[0081] Optionally, the performance statistics component also includes a third statistics mode, which is NoStat. When the performance statistics component is in the third statistics mode, it does not perform performance data statistics.
[0082] In one possible implementation, business personnel can configure the statistical mode corresponding to the performance statistics component in the target configuration file. The corresponding application server can determine the target statistical mode corresponding to the performance statistics component by reading the target configuration file, and then perform performance data statistics according to the target statistical mode.
[0083] Step 404: Using the performance statistics component, based on the execution information generated by the target heartbeat object performing heartbeat operations during the application server's operation, statistically analyze the target performance data of the target heartbeat object in the target performance data dimension according to the target statistical mode.
[0084] In one possible implementation, after the application server reads the target statistical mode corresponding to the statistical component from the target configuration file, it can determine whether the statistical object that the performance statistics component needs to count is the target heartbeat object or all heartbeat objects in the heartbeat subtree with the target heartbeat object as the root node. Then, during the operation of the application server, the performance statistics component collects the execution information generated by the target heartbeat object performing heartbeat operations in the application server, so as to count the target performance data of the target heartbeat object in the target performance data dimension.
[0085] Taking the target statistical pattern as an example, which includes a first statistical pattern and a second statistical pattern, in an exemplary example, step 404 may include steps 404A and 404B.
[0086] Step 404A: When the target statistical mode is the first statistical mode, calculate the first performance data of the target heartbeat object in the target performance data dimension.
[0087] In one possible implementation, when the target statistical mode is the first statistical mode, the statistical requirements based on the first statistical mode are: only the performance data of the heartbeat object attached to the performance statistics component are counted. Correspondingly, the application server can obtain only the execution information generated by the target heartbeat object performing the heartbeat operation during the operation of the application server through the performance statistics component, so as to count only the first performance data of the target heartbeat object in the target performance data dimension based on the execution information.
[0088] by Figure 1 For example, if the target heartbeat object is Cell, when the performance statistics component is mounted on Cell and the performance statistics component is in the first statistics mode (ObjRoot), it only collects the execution information generated by Cell when performing the heartbeat operation, and then obtains the first performance data of Cell in the target performance data dimension. That is, the first performance data includes the performance data of Cell in the target performance data dimension.
[0089] Step 404B: When the target statistical mode is the second statistical mode, determine the set of heartbeat objects that the performance statistics component needs to count. The set of heartbeat objects includes the target heartbeat object and the child heartbeat objects with the target heartbeat object as the root node. Count the second performance data of each heartbeat object in the set of heartbeat objects in the target performance data dimension. The first performance data is included in the second performance data.
[0090] Since the second statistical mode requires the statistics of performance data of all heartbeat objects contained in the heartbeat tree (heartbeat subtree) with the target heartbeat object as the root node, in one possible implementation, when the application server determines that the target statistical mode is the second statistical mode, it first needs to determine the heartbeat tree or heartbeat subtree with the target heartbeat object as the root node, and then determine all heartbeat objects contained in the heartbeat tree or heartbeat subtree. All heartbeat objects constitute the set of heartbeat objects that the performance statistics component needs to count. That is to say, the set of heartbeat objects includes the target heartbeat object + the child heartbeat objects with the target heartbeat object as the root node.
[0091] In one possible implementation, once the set of heartbeat objects that the performance statistics component needs to collect is determined, the performance statistics component can be used to obtain the execution information generated when each heartbeat object in the heartbeat object set performs a heartbeat operation during the application server's operation. Then, based on this execution information, the second performance data of each heartbeat object in the heartbeat object set in the target performance data dimension can be obtained.
[0092] by Figure 1 As shown, if the target heartbeat object is Scene, when the performance statistics component is in the second statistics mode, the set of heartbeat objects that the performance statistics component needs to count includes: Scene, Cell, and Actor. Then, the performance statistics component needs to obtain the execution information generated when the three heartbeat objects, Scene, Cell, and Actor, perform heartbeat operations during the application server's operation, and then determine the second performance data of the heartbeat objects, such as Scene, Cell, and Actor, on the target performance data dimension based on the execution information. The corresponding second performance data includes: the performance data of Scene on the target performance data dimension, the performance data of Cell on the target performance data dimension, and the performance data of Actor on the target performance data dimension.
[0093] Optionally, in this embodiment, the target performance data dimensions may include: object quantity statistics dimension, object time consumption statistics dimension, component time consumption statistics dimension, detailed time consumption statistics dimension, object content statistics dimension, component memory statistics dimension, etc. This embodiment does not limit the specific data dimensions of the target performance data dimensions.
[0094] In an exemplary example, with the performance statistics component in the second mode, the specific performance data statistics process under different performance data statistics dimensions is described. The statistics process corresponding to the second performance data may include at least one of the following steps 404b1 to 404b5.
[0095] 404b1, when the target performance data dimension is the object count dimension, count the number of objects in the heartbeat object set that contain heartbeat objects during the execution of a single frame. The object count data includes the number of objects created, the number of objects destroyed, and the actual number of objects.
[0096] In the object count dimension, it is necessary to count the number of heartbeat objects, including the number of objects created, destroyed, and actually existing objects. In one possible implementation, when a business user enables the heartbeat object count count switch, the target performance data dimension corresponding to the target heartbeat object in the target configuration file becomes the object count count dimension. After reading the object count count dimension from the target configuration file, the application server can use a performance statistics component to count the number of objects created, destroyed, and actually existing objects in the heartbeat object set during a single frame of application server operation, thus obtaining the object count data.
[0097] Optionally, the performance statistics component uses a single frame as the statistical unit to collect performance data of the target heartbeat object in each frame.
[0098] In an exemplary example, if the heartbeat object is a game player (Actor_Avator) and the target performance data dimension is the object count dimension, the performance statistics component needs to count the number of game player objects created, the number of game player objects destroyed, and the actual number of game player objects during each frame of application server operation.
[0099] Although the performance statistics component performs performance data statistics on a frame-by-frame basis, and obtains the performance data corresponding to each frame, in order to facilitate the subsequent display of performance data in the form of charts, in one possible implementation, the obtained multi-frame performance data is merged to obtain the total performance data that integrates the performance data of multiple frames.
[0100] Taking the target performance data as the object quantity data as an example, when processing the object quantity data corresponding to each frame, it can be classified and statistically analyzed according to the object type. In one possible implementation, for the object quantity data of each frame, the object quantity data corresponding to different target object types is obtained, that is, the number of objects created, the number of objects destroyed, and the actual number of objects for each target object type in each frame are obtained.
[0101] Optionally, to facilitate the display of object quantity data for each object type in the form of a chart, the object quantity data is integrated by the target time period. After obtaining the object quantity data corresponding to each target object type in each frame, based on the number of frames included in the target time period, M frames of object quantity data corresponding to each target object type in the target time period are continuously obtained, and then the M frames of object quantity data are merged to obtain the average object quantity data of the target object type in the target time period.
[0102] The average object count data includes: average object count, total number of objects created, and total number of objects destroyed. The average object count is obtained by averaging the actual number of objects in the M-frame object count data. The total number of objects created is obtained by summing the number of objects created in the M-frame object count data. The total number of objects destroyed is obtained by summing the number of objects destroyed in the M-frame object count data.
[0103] Where M is the number of frames contained in the target time period. For example, if the target time period contains 10 frames, the object quantity data corresponding to each target object type is obtained for 10 consecutive frames to obtain 10 frames of object quantity data, and then the 10 frames of object quantity data are merged.
[0104] For example, if the target time period is 1 second, the performance statistics component can calculate the average number of heartbeat objects, the total number of objects created, and the total number of objects destroyed for each target object type within 1 second.
[0105] like Figure 5 The diagram illustrates statistical results of the number of heartbeat objects according to an exemplary embodiment of this application. The left side of the graph displays multiple options, each indicating the target object type and quantity type (created, destroyed, or actual) of the heartbeat objects. For example, if AvgObjCnt (average number of objects), CreateCnt (number of creations), and DestroyCnt (number of destructions) for Actor_Avator (player) are selected, the corresponding line graph on the right will show how these three quantities change over time. Line 501 in the line graph shows that between 18:14:49 and 18:54, 20 players logged into the server, creating 3, 7, 7, and 3 player objects at 49, 50, 51, and 54 seconds respectively, corresponding to an increase in the average number of player objects from 0 to 20 (corresponding to line 502).
[0106] Optional, Figure 5The statistical results diagram shown can be viewed in the performance data query device. After the performance statistics component obtains the average number of objects for the target time period, it can copy the average number of objects data to the upload queue and wait to be uploaded to the performance data management server. The corresponding performance data management server can feed back the average number of objects data to the performance data query device so that it can generate a statistical results diagram based on the average number of objects data for business personnel to view.
[0107] 404b2, when the target performance data dimension is the object time consumption statistics dimension, calculates the first heartbeat time consumption data corresponding to each heartbeat object in the heartbeat object set during the execution of a single frame.
[0108] In the object time consumption statistics dimension, it is necessary to calculate the total heartbeat time of each heartbeat object in each frame. In one possible implementation, when the business personnel enable the heartbeat object time consumption information statistics, the target performance data dimension in the target configuration file is the object time consumption statistics dimension. After the application server reads the object time consumption statistics dimension from the target configuration file, it can use the performance statistics component to calculate the execution information of each heartbeat object in the heartbeat object set when performing heartbeat operations during the single frame operation. Based on this execution information, the time consumption data corresponding to each heartbeat object in the heartbeat object set during the single frame operation is calculated, which is the first heartbeat time consumption data.
[0109] by Figure 1 For example, if the heartbeat object set contains Scene, Cell, and Actor, then the first heartbeat time data includes: the heartbeat time corresponding to the Scene performing the heartbeat operation in each frame, the heartbeat time corresponding to the Cell performing the heartbeat operation in each frame, and the heartbeat time corresponding to the Actor performing the heartbeat operation in each frame.
[0110] 404b3, when the target performance data dimension is the component time consumption statistics dimension, calculates the second heartbeat time consumption data of each object component corresponding to each heartbeat object in the heartbeat object set during the single frame operation. The object component is used to handle the object behavior of the heartbeat object.
[0111] In the component time consumption statistics dimension, it is necessary to calculate the total heartbeat time of each component corresponding to each heartbeat object in each frame. In one possible implementation, when the business personnel enable the component time consumption information statistics, the target performance data dimension in the target configuration file is the component time consumption statistics dimension. After the application server reads the component time consumption statistics dimension from the target configuration file, it can use the performance statistics component to calculate the execution information of each object component corresponding to each heartbeat object in the heartbeat object set during the execution of the heartbeat operation in a single frame. Based on this execution information, the heartbeat time consumption data corresponding to each object component of each heartbeat object in the heartbeat object set during the execution of a single frame is calculated, which is the second heartbeat time consumption data.
[0112] by Figure 1 For example, if the heartbeat object set contains Scene, Cell, and Actor, then the second heartbeat timeout data includes: the heartbeat timeout data corresponding to SceneComp, the heartbeat timeout data corresponding to CellComp, and the heartbeat timeout data corresponding to ActorComp.
[0113] 404b4, when the target performance data dimension is a detailed time consumption statistics dimension, calculates the third heartbeat time consumption data corresponding to each heartbeat object in the heartbeat object set at different running stages during the single frame operation, as well as the fourth heartbeat time consumption data of each heartbeat object having all object components.
[0114] In the detailed time consumption statistics dimension, it is necessary to collect data such as the time consumption of each heartbeat object in each frame during the three running stages of FirstPost, OnHbCost and SecondPost, the number of components owned by each heartbeat object and their total time consumption, and the number of child heartbeat objects owned by each heartbeat object and their total time consumption.
[0115] In one possible implementation, when business personnel enable detailed time consumption information statistics, the target performance data dimension in the target configuration file becomes the detailed time consumption statistics dimension. After the application server reads the detailed time consumption statistics dimension from the target configuration file, it can use the performance statistics component to count the execution information of each heartbeat object in the heartbeat object set at different running stages during the single frame operation. Based on this execution information, it can then count the third heartbeat time consumption data corresponding to each heartbeat object in the heartbeat object set at different running stages during the single frame operation, as well as the fourth heartbeat time consumption data of each heartbeat object having all object components.
[0116] by Figure 1For example, if the heartbeat object is an Actor, then the third heartbeat time data is: the heartbeat time of the Actor in the three stages of OnHbCost, FirstPost and SecondPost; the fourth heartbeat time data includes: the heartbeat time data of the Actor having all object components.
[0117] Upon completion of each frame's statistics, the first, second, third, and fourth heartbeat duration data for each heartbeat object in the entire heartbeat subtree will be obtained. If 100 players are logged into the application server, then the application server may need to count 100,000 heartbeat objects. Storing so much heartbeat duration data in each frame is obviously very performance-intensive. Therefore, in order to reduce the amount of performance data and extract the most critical performance data, in one possible implementation, after the heartbeat duration data for each frame is counted, the heartbeat objects in the heartbeat object set are classified to obtain at least one target object category. Then, the heartbeat duration data of the heartbeat objects in each target object category are categorized to obtain an object performance snapshot corresponding to each target object category.
[0118] In an exemplary example, the process of obtaining a performance snapshot of an object corresponding to a target object type may include the following steps:
[0119] First, classify the heartbeat objects in the heartbeat object set to obtain at least one target object type. Different target object types correspond to different heartbeat objects.
[0120] The classification dimension of the heartbeat object can be classified according to the node to which the heartbeat object belongs; for example, objects created by players can be classified into one category, and NPCs controlled by the background can be classified into another category, etc. The embodiments of this application do not limit the classification dimension.
[0121] In one possible implementation, the application server can classify the heartbeat objects in the heartbeat object set based on a preset classification dimension to obtain at least one target object type and at least one heartbeat object contained in the target object type.
[0122] For illustration purposes, if the heartbeat object set contains the following heartbeat objects: Player A, NPC1, Player B, NPC2, Player C, NPC3, Player D, and NPC4, then it includes two categories: the first target object type includes heartbeat objects such as Player A, Player B, Player C, and Player D, while the second target object type includes heartbeat objects such as NPC1, NPC2, NPC3, and NPC4.
[0123] 2. Select the heartbeat time data of the target object type from the target performance data. The heartbeat time data includes the first heartbeat time data, the second heartbeat time data, the third heartbeat time data, and the fourth heartbeat time data of the heartbeat object belonging to the target object type.
[0124] In order to obtain the object performance snapshot corresponding to the target object type, in one possible implementation, for the heartbeat objects contained in the target object type, the heartbeat time data of each heartbeat object belonging to the target object type is selected from the target performance data (the heartbeat time data corresponding to each performance data statistical dimension in the above embodiment), and determined as the object heartbeat time data corresponding to the target object type, and then the object heartbeat time data is classified.
[0125] 3. Based on the object heartbeat time data, determine the object performance snapshot corresponding to the target object type within a single frame. The object performance snapshot includes at least one of the following: the average time of the heartbeat object corresponding to the target object type, the average time of the heartbeat object corresponding to the target object type in different statistical stages, the average time of the heartbeat object with object components corresponding to the target object category, the average time of the sub-heartbeat object corresponding to the target object category, and the heartbeat objects with the top N heartbeat times in the target object category, where N is a positive integer.
[0126] In one possible implementation, after obtaining the object heartbeat time data corresponding to the target heartbeat object type, the object heartbeat time data can be categorized to obtain an object performance snapshot corresponding to the target heartbeat object type in each frame. The object performance snapshot includes at least one of the following: the average time of the target object type corresponding to the heartbeat object, the average time of the target object type corresponding to the heartbeat object in different statistical stages, the average time of the target object category corresponding to the heartbeat object with object components, the average time of the target object category corresponding to the sub-heartbeat objects, and the top N heartbeat objects with the highest heartbeat time in the target object category.
[0127] The average heartbeat time for each heartbeat object is calculated by averaging the heartbeat times of all heartbeat objects in the object heartbeat time data. The average heartbeat time for different statistical phases is calculated by averaging the heartbeat times of each heartbeat object in different running phases in the object heartbeat time data. The average heartbeat time for each object component is calculated by averaging the heartbeat times of the corresponding object components for each heartbeat object. The average heartbeat time for each child heartbeat object is calculated by averaging the heartbeat times of the corresponding child objects for each heartbeat object. The top N heartbeat objects are selected by comparing the heartbeat times of each heartbeat object type. If N can be 3, then the top 3 heartbeat objects with the highest heartbeat times are selected.
[0128] Since business personnel often pay more attention to the heartbeat time of heartbeat objects with large heartbeat times, in one possible implementation, when a heartbeat object is among the top N items in heartbeat time, the heartbeat time data of the corresponding object is also added to the object performance snapshot; that is, if the heartbeat time of the corresponding heartbeat object is high, the detailed time data of the corresponding heartbeat object needs to be retained so that business personnel can view it.
[0129] Optionally, if the heartbeat object is not among the top N items in heartbeat duration, then delete the heartbeat duration data corresponding to the heartbeat object, without retaining the detailed duration data corresponding to the heartbeat object.
[0130] Similar to the object quantity data in the above embodiment, after obtaining the object performance snapshot corresponding to each target object type, in order to facilitate the subsequent display of performance data, the object performance snapshots are integrated by the target time period. After obtaining the object performance snapshot corresponding to each target object type in each frame, based on the number of frames included in the target time period, M frame object performance snapshots corresponding to each target object type in the target time period are obtained, and then the M frame object performance snapshots are merged to obtain the object performance data corresponding to the target object type in the target time period.
[0131] The target time period can be 1 second, and M can be 10.
[0132] For example, the object performance data within 1 second may include: the average time spent on the heartbeat object corresponding to each target object type within 1 second, the average time spent on the heartbeat object corresponding to each target object type at different running stages within 1 second, the average time spent on the object components of the heartbeat object corresponding to each target object type within 1 second, the average time spent on the sub-heartbeat objects corresponding to each target object category within 1 second, the top N items of the heartbeat time spent on the heartbeat object corresponding to each target object type within 1 second, and the detailed time spent data corresponding to the top N items of the heartbeat object.
[0133] Optionally, after obtaining the above object performance data, the object performance data can be copied to the upload queue. When the object performance data and average number of objects in the upload queue accumulate to a certain size, they can be compressed and packaged through the data reporting process and uploaded to the performance data management server for storage. This allows business personnel to query the data in the performance data management server through the performance data query device.
[0134] like Figure 6The diagram illustrates statistical results of heartbeat object time consumption information according to an exemplary embodiment of this application. The left side of the line graph displays options, each representing the average time consumption of heartbeat objects corresponding to different target heartbeat object types. For example, Actor_Avator-Avg represents the average time consumption of heartbeat objects with the target heartbeat object type Actor_Avator, and Actor_NPC-Avg represents the average time consumption of heartbeat objects with the target heartbeat object type Actor_NPC. When a specific type of heartbeat object is selected, the line graph will display a line graph showing the change in the average time consumption of the specified type of heartbeat object over time.
[0135] When click Figure 6 When viewing data at a specific time point in the line chart shown, two options will pop up: AvgCostInfo (average time consumption information bar chart) and TopCostDetailInfo (maximum time consumption details table), as follows. Figure 7 As shown; when the "Average Elapsed Time Bar Chart" option is selected, you can see a bar chart showing the elapsed time of different object types within this second, as shown. Figure 7 The bar chart shows the time taken for different heartbeat objects within a second, for example, the average time taken for SceneMgr is 24779us, the average time taken for Scene is 12386us, the average time taken for Cell is 12384us, and the average time taken for Actor_Avator is 261us.
[0136] When TopCostDetailInfo (Maximum Elapsed Time Details Table) is selected, you can see the detailed information of the top 3 (configurable) heartbeat operations with the longest execution time within that second, as shown in Table 1. The first column represents the top three heartbeat operations for different types of heartbeat objects. The second column displays the actual execution time of these heartbeats. The third column contains detailed execution information for the longest-running heartbeat operation, including the object ID, object logical ID, the execution time of the object in the OnHbCost, FirstPost, and SecondPost phases, the number of components the object has and their total execution time, the number of child objects the object has and their total execution time, and the actual execution time of each time-consuming component of the object. For example, the Actor_Avatar-Top1 row shows that the actual execution time of the longest-running heartbeat operation for an Actor_Avatar type object is 6856 seconds, the object ID of the object that performed the operation is 8358683637315534848, and the logical ID is 1073751990, among other detailed data. We can also see that the heartbeat object has 26 components, taking a total of 6852us. Among them, the broadcaster component (ActorComp_Broadcaster) accounted for 6851 seconds, which was the main source of time consumption. In addition, from Cell_Normal-Top1, we can see that the Cell object containing the longest-lasting heartbeat operation has 14 components and 12839 child objects. The child objects took 52422us, which was the main source of time consumption.
[0137] Table 1
[0138]
[0139]
[0140] like Figure 8 As shown, this diagram illustrates the statistical results of detailed heartbeat object time consumption information according to an exemplary embodiment of this application. When detailed heartbeat object time consumption statistics are enabled, the time consumption data of different heartbeat objects in the three running stages of FirstPostCost, OnHbCost, and SecondPostCost, the time consumption data of their components, and their own time consumption data can be seen every second.
[0141] like Figure 9The diagram illustrates the statistical results of the time consumption information of the object component corresponding to the heartbeat object, as shown in an exemplary embodiment of this application. Besides the heartbeat object in the application server, the time consumption of different types of object components can also be viewed directly, using three methods: a "time consumption - duration" line chart, an average time consumption information bar chart, and a maximum time consumption details table. `ActorComp_AI_LOD-Avg` represents the average time consumption of the AI component corresponding to the heartbeat object of the character, and `ActorComp_Broadcaster` represents the average time consumption of the broadcaster component corresponding to the heartbeat object of the character.
[0142] Step 404b5: When the target performance data dimension is the object memory statistics dimension, calculate the memory usage data of each heartbeat object in the heartbeat object set in the application server during the execution of a single frame.
[0143] In the object memory statistics dimension, it is necessary to calculate the memory usage of each heartbeat object in each frame. In one possible implementation, when business users enable object memory statistics, the target performance data dimension in the target configuration file is the object memory statistics dimension; after the application server reads the object memory statistics dimension from the target configuration file, it can use the performance statistics component to calculate the memory usage of each heartbeat object during the application server's single-frame operation.
[0144] Optionally, after obtaining the memory usage data corresponding to each heartbeat object in each frame, it is also possible to statistically analyze the total memory usage, average memory usage, and detailed memory usage information of the heartbeat object with the largest memory usage for each target heartbeat object type, so as to analyze the memory problems of the application server.
[0145] like Figure 10 The diagram illustrates a performance data statistics schematic of an exemplary embodiment of this application. Each heartbeat object has a performance data snapshot (ObjSnapshot). The time consumption data collected for each frame is stored in the ObjSnapshot. For example, the performance snapshot data of a Scene is stored in the Snapshot corresponding to the Scene. By classifying and integrating the performance data snapshots of different heartbeat objects, a total performance data snapshot (PerfStatSnapshot, PSS) can be obtained.
[0146] In this embodiment, statistical dimensions of performance data corresponding to various heartbeat objects are provided, enabling business personnel to collect the required performance data as needed. In addition, in order to reduce the amount of performance data and extract key performance data, the performance data of each frame is classified and organized to obtain the object performance snapshot corresponding to each type of heartbeat object. While meeting the needs of business personnel for detailed time consumption information of heartbeat objects with large heartbeat time consumption data, the storage amount of performance data can be reduced.
[0147] like Figure 11 The diagram illustrates a process schematic of a snapshot of the performance of an integrated object, as shown in an exemplary embodiment of this application. The process includes:
[0148] Step 1101: Add the root node of the heartbeat subtree to be counted to ObjList.
[0149] After the target performance data for each frame is collected, steps 1101 to 1105 are executed.
[0150] Step 1102: Execute the subprocess to process the object performance snapshots of all objects in the entire heartbeat subtree of this frame to obtain the total object performance snapshot (PSS).
[0151] Step 1102 further includes steps 1102a to 1102g.
[0152] Step 1102a: Retrieve the first heartbeat object of ObjList and obtain the object type and object performance snapshot corresponding to the heartbeat object.
[0153] Step 1102b: Modify the time consumption data of the corresponding object type in PSS according to the time consumption information in the object performance snapshot, and clear the object performance snapshot.
[0154] Specifically, modifying the time consumption data of the corresponding object type in PPS based on the time consumption information in the object performance snapshot is the process of obtaining the object performance snapshots corresponding to different target object types in the above embodiment.
[0155] Step 1102c: Does the heartbeat object take longer than the top 3 object types?
[0156] Step 1102d: Save the information of the heartbeat object and detailed time consumption data to PSS.
[0157] If the heartbeat time of a heartbeat object is greater than the heartbeat times of the top 3 objects of that object type, then update the times of the top 3 objects based on the heartbeat time of the heartbeat object, and save the information and detailed time data of the heartbeat object to PSS; if the heartbeat time of a heartbeat object is not among the top 3, then there is no need to save the detailed time data corresponding to the heartbeat object.
[0158] Step 1102e: Add all child heartbeat objects of the heartbeat object to ObjList.
[0159] Step 1102f: ObjList is empty.
[0160] When ObjList is empty, it means that the performance data corresponding to each heartbeat object collected in the current frame has been integrated.
[0161] Step 1102g, subprocess ends.
[0162] Step 1103: Accumulate 1 second of time.
[0163] Step 1104: Copy the PSS within 1 second to the upload queue and clear the PSS.
[0164] Step 1105, statistics completed.
[0165] Please refer to Figure 12 This illustration shows a flowchart of a performance data statistics method provided in another exemplary embodiment of this application. This embodiment uses an application server 220 as an example to illustrate the method, which includes:
[0166] Step 1201: Obtain the target configuration file corresponding to the performance statistics component.
[0167] Step 1202: Based on the target configuration file, determine the target heartbeat object and target performance data dimension that the performance statistics component needs to collect. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be collected. The performance data is related to the running performance of the application server.
[0168] Step 1203: Using the performance statistics component, based on the execution information generated by the target heartbeat object performing heartbeat operations during the application server's operation, statistically analyze the target performance data of the target heartbeat object in the target performance data dimension.
[0169] The implementation methods for steps 1201 and 1203 can be referred to the above embodiments, and will not be repeated here.
[0170] Step 1204: If the target heartbeat object is the root node of the heartbeat tree corresponding to the application server, obtain the total heartbeat time corresponding to the target heartbeat object from the target performance data.
[0171] The total heartbeat time for the entire heartbeat tree of the application server reflects its overall workload. For example, if the server's heartbeat cycle is 100ms, and 20% of the time is reserved for non-heartbeat logic, the remaining 80ms represents the maximum available time for heartbeat operations in each frame. Therefore, the workload ratio (workload) of the application server in each frame can be expressed as:
[0172] Workload per frame = Total time spent on the heartbeat tree / Maximum available time (1)
[0173] Based on the application server workload determination method shown in formula (1), it can be seen that the workload of the current application server can be evaluated based on the statistically obtained target performance data. However, when calculating the workload requires obtaining the total heartbeat consumption of the entire heartbeat tree corresponding to the application server, the following steps are taken: Figure 1 For example, the total heartbeat time of the heartbeat tree, i.e. the heartbeat time of SceneMgr, corresponds to the total heartbeat time of the target heartbeat object corresponding to the root node of the heartbeat tree of the application server in one possible implementation. The total heartbeat time of the target heartbeat object is then determined as the total heartbeat time of the heartbeat tree of the application server in that frame.
[0174] Step 1205: Based on the total heartbeat time and the target heartbeat time, determine the workload value corresponding to the application server. The target heartbeat time is the maximum available time allocated by the application server for heartbeat operations.
[0175] In one possible implementation, once the total heartbeat time and the target heartbeat time are obtained, the workload value of the application server for each frame can be calculated based on formula (1) to determine the load of the application server in each frame. Then, the workload of the application server can be increased or decreased based on the size of the workload value to balance the workload of the application server.
[0176] For example, if the current workload of the application server is too high, the refresh frequency of the AI component of the NPC can be reduced to reduce the workload of the application server; if the workload of the application server is low, the refresh frequency can be increased to enhance the expressiveness of the NPC, etc.
[0177] Step 1206: Obtain the target correspondence between candidate load ranges and candidate performance metrics.
[0178] Optionally, the current performance metrics of the application server can be determined based on the application server's workload. In this embodiment, the performance metrics are defined as four colors: red, orange, yellow, and green. Each candidate performance metric corresponds to a candidate load range: red [0.9, +∞), orange [0.8, 0.9), yellow [0.6, 0.8), and green [0, 0.6]. Red indicates that the application server's load is too high and the workload must be reduced as soon as possible. Orange indicates that the application server's load is very high and high workload operations should be avoided as much as possible. Yellow indicates that the application server has a certain workload, but it is at a normal level. Green indicates that the application server's workload is low and it is in a low-load stage, so high-load operations can be performed to improve the player's user experience.
[0179] In one possible implementation, the application server is configured with a target correspondence between various candidate performance metrics and candidate load ranges, so that after determining the workload value corresponding to the application server, the current performance metrics of the application server can be determined based on the target object relationship.
[0180] Step 1207: Determine the target load range in which the workload value is located from the candidate load range.
[0181] Optionally, after obtaining the workload value corresponding to the application server, the target workload range in which the workload value is located is determined from the candidate workload range based on the workload value.
[0182] Step 1208: Determine the candidate performance metrics corresponding to the target load range as the target performance metrics currently corresponding to the application server.
[0183] Once the target load range corresponding to the workload value of the application server is determined, the candidate performance indicators corresponding to the target load range can be determined as the target performance indicators corresponding to the application server.
[0184] Optionally, since the heartbeat time fluctuation between adjacent frames is large, the performance indicators calculated from the workload value of each frame also change frequently, which cannot reflect the actual workload of the application server well. Therefore, in one possible implementation, the average workload value within a preset time period can be used as the current workload of the application server, so that other working modules can decide to increase or decrease their workload based on the current workload of the application server to balance the workload of the server.
[0185] For illustrative purposes, the preset time period can be 10 seconds, which means taking the average workload within 10 seconds as the current workload of the application server.
[0186] Optionally, after obtaining data such as the application server's workload value and target performance metrics, the workload value and target performance metrics can also be copied to the upload queue and waited to be uploaded to the performance data management server for storage, so that the performance data query device can directly read the data in the performance data management server for display.
[0187] In this embodiment, the current workload and performance indicators of the application server can be calculated based on the target performance data corresponding to the target heartbeat object, so as to provide access to other working modules. This allows other working modules to decide to increase or decrease their workload based on the current workload of the application server, thereby balancing the current workload of the application server.
[0188] The following are device embodiments of this application. For details not described in detail in the device embodiments, please refer to the above method embodiments.
[0189] Figure 13 This is a structural block diagram of a performance data statistics device provided in an exemplary embodiment of this application. The device may include:
[0190] Module 1301 is used to obtain the target configuration file corresponding to the performance statistics component.
[0191] The determination module 1302 is used to determine, based on the target configuration file, the target heartbeat object and the target performance data dimension that the performance statistics component needs to statistically analyze. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be analyzed. The performance data is related to the running performance of the application server.
[0192] The statistics module 1303 is used to, through the performance statistics component, statistically analyze the target performance data of the target heartbeat object in the target performance data dimension based on the execution information generated by the target heartbeat object performing the heartbeat operation during the operation of the application server.
[0193] Optionally, the statistics module 1303 is further configured to:
[0194] Based on the target configuration file, the target statistical mode of the performance statistics component is determined;
[0195] According to the target statistical model, the target performance data of the target heartbeat object is statistically analyzed in the target performance data dimension.
[0196] Optionally, the statistics module 1303 is further configured to:
[0197] When the target statistical mode is the first statistical mode, the target heartbeat object is statistically analyzed for the first performance data in the target performance data dimension.
[0198] When the target statistical mode is the second statistical mode, the set of heartbeat objects that the performance statistics component needs to count is determined. The set of heartbeat objects includes the target heartbeat object and child heartbeat objects with the target heartbeat object as the root node. The second performance data of each heartbeat object in the set of heartbeat objects is counted on the target performance data dimension, and the first performance data is included in the second performance data.
[0199] Optionally, the statistics module 1303 is further configured to:
[0200] When the target performance data dimension is the object quantity statistics dimension, the number of objects containing heartbeat objects in the heartbeat object set during the single frame operation is counted. The object quantity data includes the number of objects created, the number of objects destroyed, and the actual number of objects.
[0201] When the target performance data dimension is the object time consumption statistics dimension, the first heartbeat time consumption data corresponding to each heartbeat object in the heartbeat object set is counted during the single frame operation.
[0202] When the target performance data dimension is the component time consumption statistics dimension, the second heartbeat time consumption data of each heartbeat object in the heartbeat object set corresponding to each object component is statistically analyzed during the single frame operation. The object component is used to process the object behavior of the heartbeat object.
[0203] When the target performance data dimension is a detailed time consumption statistics dimension, the third heartbeat time consumption data corresponding to each heartbeat object in the heartbeat object set under different running stages during the single frame operation is statistically analyzed, as well as the fourth heartbeat time consumption data of each heartbeat object having all object components;
[0204] When the target performance data dimension is the object memory statistics dimension, the memory usage data of each heartbeat object in the heartbeat object set in the application server is counted during the execution of a single frame.
[0205] Optionally, the device further includes:
[0206] The classification module is used to classify the heartbeat objects in the heartbeat object set to obtain at least one target object type, and different target object types correspond to different heartbeat objects;
[0207] The selection module is used to select object heartbeat time data corresponding to the target object type from the target performance data. The object heartbeat time data includes the first heartbeat time data, the second heartbeat time data, the third heartbeat time data, and the fourth heartbeat time data of the heartbeat object belonging to the target object type.
[0208] The determining module is further configured to determine, based on the object heartbeat time data, an object performance snapshot corresponding to the target object type within a single frame. The object performance snapshot includes at least one of the following: the average time of the heartbeat object corresponding to the target object type, the average time of the heartbeat object corresponding to the target object type at different running stages, the average time of the object components owned by the heartbeat object corresponding to the target object category, the average time of the sub-heartbeat objects corresponding to the target object category, and the heartbeat objects with the top N heartbeat times in the target object category, where N is a positive integer.
[0209] Optionally, the device further includes:
[0210] An add module is used to add the object heartbeat time data corresponding to the heartbeat object to the object performance snapshot when the heartbeat object belongs to the top N items of the heartbeat time.
[0211] The deletion module is used to delete the object heartbeat time data corresponding to the heartbeat object if the heartbeat object is not among the top N items of the heartbeat time.
[0212] Optionally, the device further includes:
[0213] The acquisition module is further configured to acquire an M-frame object performance snapshot corresponding to the target object type within a target time period, wherein the target time period contains M frames and M is a positive integer;
[0214] The data processing module is used to merge the M-frame object performance snapshots to obtain the object performance data corresponding to the target object type in the target time period.
[0215] Optionally, the device further includes:
[0216] The acquisition module is also used to acquire the number of M-frame objects corresponding to the target object type in the target time period;
[0217] The data processing module is also used to merge the object quantity data of the M frames to obtain the average number of objects of the target object type in the target time period.
[0218] Optionally, the device further includes:
[0219] The acquisition module is further configured to, when the target heartbeat object is the root node of the heartbeat tree corresponding to the application server, obtain the total heartbeat time corresponding to the target heartbeat object from the target performance data;
[0220] The determining module is further configured to determine the workload corresponding to the application server based on the total heartbeat time and the target heartbeat time, wherein the target heartbeat time is the maximum available time allocated by the application server for the heartbeat operation.
[0221] Optionally, the device further includes:
[0222] The acquisition module is also used to acquire the target correspondence between candidate load ranges and candidate performance indicators;
[0223] The determining module is further configured to determine the target load range in which the workload is located from the candidate load range;
[0224] The determining module is further configured to determine the candidate performance indicators corresponding to the target load range as the target performance indicators currently corresponding to the application server.
[0225] Optionally, the acquisition module 1301 is further configured to:
[0226] The target configuration file is received from the target terminal. The target configuration file is generated based on the configuration operations in the performance statistics configuration page of the target terminal.
[0227] The device further includes:
[0228] The sending module is used to send the target performance data back to the target terminal so that the target terminal can display the target performance data in the performance statistics configuration page.
[0229] In summary, this application provides a method for performance data statistics of an application server. By adding a performance statistics component to the application server and determining the target heartbeat object and target performance data dimension to be statistically analyzed based on the target configuration file corresponding to the performance statistics component, users can specify the heartbeat object to be statistically analyzed and the target performance data to be analyzed through the target configuration file. This avoids analyzing other irrelevant heartbeat objects or performance data, thereby saving workload and data storage overhead in the performance data statistics process. In addition, the corresponding target performance data can be obtained directly at the heartbeat object level, and the heartbeat object to which the target performance data is targeted can be clearly identified. Therefore, when the target performance data indicates a performance problem, the relationship between the performance data and the heartbeat object can be used to more accurately find the performance problem in the server.
[0230] Please refer to Figure 14 This illustration shows a schematic diagram of a computer device according to an embodiment of this application. This computer device can be used to implement the performance data statistics method executed by the application server provided in the above embodiments. The computer device 1400 includes a Central Processing Unit (CPU) 1401, a system memory 1404 including Random Access Memory (RAM) 1402 and Read-Only Memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the CPU 1401. The computer device 1400 also includes a Basic Input / Output System (I / O) 1406 to facilitate information transfer between various devices within the computer, and a mass storage device 1407 for storing the operating system 1413, application programs 1414, and other program modules 1415.
[0231] The basic input / output system 1406 includes a display 1408 for displaying information and an input device 1409 for user input, such as a mouse or keyboard. Both the display 1408 and the input device 1409 are connected to the central processing unit 1401 via an input / output controller 1410 connected to the system bus 1405. The basic input / output system 1406 may also include the input / output controller 1410 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1410 also provides output to a display screen, printer, or other types of output devices.
[0232] The mass storage device 1407 is connected to the central processing unit 1401 via a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1407 and its associated computer-readable media provide non-volatile storage for the computer device 1400. That is, the mass storage device 1407 may include computer-readable media (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0233] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1404 and mass storage device 1407 described above can be collectively referred to as memory.
[0234] According to various embodiments of this application, the computer device 1400 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1400 can be connected to a network 1412 via a network interface unit 1411 connected to the system bus 1405, or the network interface unit 1411 can be used to connect to other types of networks or remote computer systems (not shown).
[0235] The memory also includes one or more programs stored in the memory and configured to be executed by one or more central processing units 1401.
[0236] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the performance data statistics method provided in any of the above exemplary embodiments.
[0237] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the performance data statistics method provided in the optional implementation described above.
[0238] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0239] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for statistical analysis of performance data, characterized in that, The method includes: Obtain the target configuration file corresponding to the performance statistics component; The target heartbeat object to be statistically analyzed, the target performance data dimension, and the target statistical mode of the performance statistics component configured in the target configuration file are determined. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be analyzed, and the performance data is related to the running performance of the application server. The target statistical mode is either a first statistical mode or a second statistical mode. The first statistical mode is used to analyze the performance data of the target heartbeat object, and the second statistical mode is used to analyze the performance data of each heartbeat object in the heartbeat object set. The heartbeat object set includes the target heartbeat object and child heartbeat objects with the target heartbeat object as the root node. The first statistical mode and the second statistical mode are two statistical modes supported by the target heartbeat object. Using the performance statistics component, based on the execution information generated by the target heartbeat object performing the heartbeat operation during the operation of the application server, the target performance data of the target heartbeat object in the target performance data dimension is statistically analyzed according to the target statistical mode.
2. The method according to claim 1, characterized in that, The step of calculating the target performance data of the target heartbeat object in the target performance data dimension according to the target statistical model includes: When the target statistical mode is the first statistical mode, the target heartbeat object is statistically analyzed for the first performance data in the target performance data dimension. When the target statistical mode is the second statistical mode, the second performance data of each heartbeat object in the heartbeat object set is calculated on the target performance data dimension, and the first performance data is included in the second performance data.
3. The method according to claim 2, characterized in that, The statistical analysis of the second performance data corresponding to each heartbeat object in the heartbeat object set on the target performance data dimension includes: When the target performance data dimension is the object quantity statistics dimension, the number of objects containing heartbeat objects in the heartbeat object set during the single frame operation is counted. The object quantity data includes the number of objects created, the number of objects destroyed, and the actual number of objects. When the target performance data dimension is the object time consumption statistics dimension, the first heartbeat time consumption data corresponding to each heartbeat object in the heartbeat object set is counted during the single frame operation. When the target performance data dimension is the component time consumption statistics dimension, the second heartbeat time consumption data of each heartbeat object in the heartbeat object set corresponding to each object component is statistically analyzed during the single frame operation. The object component is used to process the object behavior of the heartbeat object. When the target performance data dimension is a detailed time consumption statistics dimension, the third heartbeat time consumption data corresponding to each heartbeat object in the heartbeat object set under different running stages during the single frame operation is statistically analyzed, as well as the fourth heartbeat time consumption data of each heartbeat object having all object components; When the target performance data dimension is the object memory statistics dimension, the memory usage data of each heartbeat object in the heartbeat object set in the application server is counted during the execution of a single frame.
4. The method according to claim 3, characterized in that, The method further includes: The heartbeat objects in the heartbeat object set are classified to obtain at least one target object type, and different target object types correspond to different heartbeat objects; Select the object heartbeat time data corresponding to the target object type from the target performance data. The object heartbeat time data includes the first heartbeat time data, the second heartbeat time data, the third heartbeat time data, and the fourth heartbeat time data of the heartbeat object belonging to the target object type. Based on the object heartbeat time data, a performance snapshot of the target object type within a single frame is determined. The object performance snapshot includes at least one of the following: the average time of the heartbeat object corresponding to the target object type, the average time of the heartbeat object corresponding to the target object type at different running stages, the average time of the object components owned by the heartbeat object corresponding to the target object type, the average time of the child heartbeat object corresponding to the target object type, and the heartbeat objects with the top N heartbeat times of the target object type, where N is a positive integer.
5. The method according to claim 4, characterized in that, The method further includes: If the heartbeat object is among the top N items of the heartbeat duration, add the heartbeat duration data of the object corresponding to the heartbeat object to the object performance snapshot; If the heartbeat object is not among the top N items of heartbeat duration, delete the heartbeat duration data corresponding to the heartbeat object.
6. The method according to claim 4, characterized in that, The method further includes: Obtain an M-frame object performance snapshot corresponding to the target object type within the target time period, where the target time period contains M frames and M is a positive integer; The M-frame object performance snapshots are merged to obtain the object performance data corresponding to the target object type in the target time period.
7. The method according to claim 4, characterized in that, The method further includes: Obtain the number of M-frame objects corresponding to the target object type within the target time period, where the target time period contains M frames and M is a positive integer; The object quantity data of the M frames are merged to obtain the average number of objects of the target object type in the target time period.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: If the target heartbeat object is the root node of the heartbeat tree corresponding to the application server, the total heartbeat time corresponding to the target heartbeat object is obtained from the target performance data; Based on the total heartbeat time and the target heartbeat time, the workload corresponding to the application server is determined, where the target heartbeat time is the maximum available time allocated by the application server for the heartbeat operation.
9. The method according to claim 8, characterized in that, The method further includes: Obtain the target correspondence between candidate load ranges and candidate performance metrics; From the candidate load ranges, determine the target load range in which the workload is located; The candidate performance metrics corresponding to the target load range are determined as the target performance metrics currently corresponding to the application server.
10. The method according to any one of claims 1 to 7, characterized in that, The target configuration file corresponding to the performance statistics acquisition component includes: Receive the target configuration file sent by the target terminal, the target configuration file being generated based on the configuration operations in the performance statistics configuration page of the target terminal; The method further includes: The target performance data is fed back to the target terminal so that the target terminal can display the target performance data on the performance statistics configuration page.
11. A performance data statistics device, characterized in that, The device includes: The acquisition module is used to acquire the target configuration file corresponding to the performance statistics component; The determination module is used to determine the target heartbeat object, target performance data dimension, and target statistical mode of the performance statistics component configured in the target configuration file. The target heartbeat object is the object that performs heartbeat operations in the virtual scene supported by the application server. The target performance data dimension is used to characterize the data type of the performance data to be counted, and the performance data is related to the running performance of the application server. The target statistical mode is a first statistical mode or a second statistical mode. The first statistical mode is used to count the performance data of the target heartbeat object, and the second statistical mode is used to count the performance data of each heartbeat object in the heartbeat object set. The heartbeat object set includes the target heartbeat object and child heartbeat objects with the target heartbeat object as the root node. The first statistical mode and the second statistical mode are two statistical modes supported by the target heartbeat object. The statistics module is used to, through the performance statistics component, based on the execution information generated by the target heartbeat object performing the heartbeat operation during the operation of the application server, and according to the target statistics mode, to count the target performance data of the target heartbeat object in the target performance data dimension.
12. A server, characterized in that, The server includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the performance data statistics method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The readable storage medium stores at least one program, which is loaded and executed by a processor to implement the performance data statistics method as described in any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the performance data statistics method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Data acquisition method, and data analysis method and system
CN106649120A
Webpage performance analysis method, terminal equipment and computer readable storage medium
CN109840195A