A method, apparatus, device, and medium for performance testing of metadata collection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AISINO CORPORATION
- Filing Date
- 2021-11-12
- Publication Date
- 2026-06-30
Smart Images

Figure CN114168440B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of performance testing technology, and in particular to a performance testing method, apparatus, equipment, and medium for metadata acquisition. Background Technology
[0002] Existing testing technologies include functional testing and performance testing. Functional testing generally adopts a data-driven approach, using parameterized test scripts to obtain prepared static test data from files, and is executed based on browser automation testing frameworks (Selenium), automation testing tools (Unified Functional Testing, UFT), and request sending plugins (Postman). Performance testing, on the other hand, generally uses concurrent requests to the server, and is executed based on load testing tools (LoadRunner) and software stress testing tools (JMeter).
[0003] In existing technologies, when performing performance tests on metadata collection, the metadata is prepared manually by the testers. The metadata collection task is carried out according to the testers' operation instructions on the business system of the metadata collection device. The testers also perform tasks such as process monitoring and exception logging. Therefore, the level of automation in the performance test of metadata collection in existing technologies is low. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and medium for performance testing of metadata collection, in order to solve the problem of low automation in the performance testing of metadata collection in the prior art.
[0005] This invention provides a performance testing method for metadata collection, the method comprising:
[0006] Based on the number of target metadata contained in the received performance test instruction, randomize the metadata for that number of target metadata.
[0007] Create collection configuration information for the metadata to be collected and send it to the metadata collection device, so that the metadata collection device collects the target metadata according to the collection configuration information, and receive the performance indicators sent by the metadata collection device when collecting the target metadata.
[0008] Furthermore, the step of creating the collection configuration information for the metadata to be collected and sending it to the metadata collection device includes:
[0009] Create the target data type, data acquisition task, and post-acquisition storage location in the metadata acquisition device for the metadata to be collected. Call the interface provided by the metadata acquisition device to write the post-acquisition storage location, the target data type, and the data acquisition task into the metadata acquisition device.
[0010] Furthermore, the method also includes:
[0011] Based on the performance indicator conditions contained in the performance test instruction and the performance indicator itself, determine whether the performance indicator meets the performance indicator conditions.
[0012] If not, generate a test record indicating that the test failed;
[0013] If so, generate a test record indicating a successful test.
[0014] Furthermore, after generating the test record for the failed test, the method further includes:
[0015] Log information and runtime information generated during the collection of the metadata are written into the test record.
[0016] Furthermore, the performance metrics include response status codes, response time, CPU utilization, and memory utilization. Determining whether the performance metrics meet the performance metric conditions based on the performance metric conditions contained in the performance test instruction and the performance metrics themselves includes:
[0017] If the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance indicators are determined to meet the performance indicator conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata collection device has successfully collected the data.
[0018] Otherwise, it is determined that the performance index does not meet the performance index conditions.
[0019] Furthermore, the method also includes:
[0020] Update the number of tests and determine whether the updated number of tests has reached the preset number of tests;
[0021] If not, clear the collection configuration information, recreate the metadata collection configuration information and send it to the metadata collection device to retest the metadata collection device;
[0022] If so, generate and display a test report containing each test record generated during each execution.
[0023] Furthermore, writing the log information generated during the collection of the metadata into the test record includes:
[0024] Based on the pre-saved log keywords and the log information generated during the collection of the metadata, key log information containing the log keywords is determined.
[0025] The key log information is written into the test record.
[0026] Furthermore, writing the runtime information generated during the metadata collection process into the test record includes:
[0027] Based on the pre-saved class and method information and the thread execution information generated during the collection of the metadata, determine the core thread execution information corresponding to the class and method information in the thread execution information;
[0028] The core runtime information of the thread is written into the test record.
[0029] Accordingly, the present invention provides a performance testing device for metadata collection, the device comprising:
[0030] The generation module is used to randomly generate metadata of the target metadata quantity based on the target metadata quantity contained in the received performance test instruction;
[0031] The processing module is used to create collection configuration information for the metadata to be collected and send it to the metadata collection device, so that the metadata collection device can collect the target metadata according to the collection configuration information, and receive the performance indicators sent by the metadata collection device when collecting the target metadata.
[0032] Furthermore, the processing module is specifically used to create the target data type, data acquisition task, and post-acquisition storage location in the metadata acquisition device for the metadata to be collected, and to call the interface provided by the metadata acquisition device to write the post-acquisition storage location, the target data type, and the data acquisition task into the metadata acquisition device.
[0033] Furthermore, the device also includes:
[0034] The judgment module is used to determine whether the performance indicator meets the performance indicator conditions contained in the performance test instruction and the performance indicator itself; if not, the generation module is triggered to execute the step of generating a test record of test failure; if yes, the generation module is triggered to execute the step of generating a test record of test success.
[0035] Furthermore, the device also includes:
[0036] The recording module is used to write the log information and running information generated during the collection of metadata into the test record after the generation module generates a test record for a failed test.
[0037] Further, the judgment module is specifically used to determine if the performance indicators include response status code, response time, CPU utilization, and memory utilization. If the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance indicator is determined to meet the performance indicator conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata acquisition device has successfully acquired the data; otherwise, the performance indicator is determined not to meet the performance indicator conditions.
[0038] Furthermore, the judgment module is also used to update the number of tests and determine whether the updated number of tests has reached the preset number of tests. If not, the processing module is triggered to perform the step of cleaning up the collection configuration information, recreating the collection configuration information of the metadata, and sending it to the metadata collection device to retest the metadata collection device. If yes, the generation module is triggered to perform the step of generating and displaying a test report containing each test record generated during each execution.
[0039] Furthermore, the recording module is specifically used to determine key log information containing the log keywords based on pre-saved log keywords and log information generated during the collection of the metadata; and to write the key log information into the test record.
[0040] Furthermore, the recording module is specifically used to determine the core thread running information corresponding to the class and method information in the thread running information based on the pre-saved class and method information and the thread running information generated during the collection of the metadata; and to write the core thread running information into the test record.
[0041] Accordingly, the present invention provides an electronic device, the electronic device including a processor and a memory, the memory being used to store program instructions, and the processor being used to execute the computer program stored in the memory to implement any of the steps of the above-described performance testing method for metadata acquisition.
[0042] Accordingly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described methods for performance testing of metadata acquisition.
[0043] This invention provides a method, apparatus, device, and medium for performance testing of metadata collection. The method involves randomly generating metadata of the target metadata quantity based on the target metadata quantity contained in a received performance test instruction; creating collection configuration information for the metadata to be collected and sending it to a metadata collection device; enabling the metadata collection device to collect the target metadata according to the collection configuration information; and receiving performance metrics from the metadata collection device during the collection of the target metadata. Because this invention can automatically and randomly generate metadata of the target metadata quantity, create metadata collection configuration information and send it to the metadata collection device, and receive performance metrics from the metadata collection device, manual intervention in the metadata collection performance testing process is eliminated, thereby improving the automation level of metadata collection performance testing. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram illustrating the process of a performance testing method for metadata collection provided in an embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram illustrating the process of a performance testing method for metadata collection provided in an embodiment of the present invention;
[0047] Figure 3 This application provides a schematic diagram of the structure of a performance testing device for metadata acquisition.
[0048] Figure 4 This is a schematic diagram of another metadata acquisition performance testing device provided in an embodiment of the present invention;
[0049] Figure 5 This is a schematic diagram of an electronic device structure provided in this application. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0051] To improve the automation of performance testing for metadata collection, embodiments of the present invention provide a method, apparatus, device, and medium for performance testing of metadata collection.
[0052] Example 1:
[0053] Figure 1 This is a schematic diagram of a performance testing method for metadata collection provided in an embodiment of the present invention. The process includes the following steps:
[0054] S101: Based on the number of target metadata contained in the received performance test instruction, randomly generate metadata for the target metadata number.
[0055] The metadata collection performance testing method provided in this embodiment of the invention is applied to electronic devices, wherein the electronic devices may be PCs, tablets, smart terminals, servers, etc., and the servers may be local servers or cloud servers.
[0056] To automate the performance testing of metadata collection, this embodiment of the invention first generates the metadata to be collected. Metadata refers to data that describes data, primarily information describing data attributes, such as primary keys, foreign keys, and indexes in an Oracle table.
[0057] After receiving a performance test command, the electronic device randomly generates metadata corresponding to the target metadata quantity contained in the performance test command. Specifically, this can be achieved by receiving a trigger operation on the display screen via a start button or other preset button, or by pressing, sliding, or clicking at a preset position on the display screen; and by receiving the input target metadata quantity, or by receiving a selection operation on the displayed metadata quantity, to determine the target metadata quantity contained in the test command.
[0058] The target metadata quantity is a positive integer. Ideally, to improve the accuracy of metadata collection performance testing, the target metadata quantity should be large, for example, 150,000. The generated target metadata quantity includes metadata from various data types, such as metadata from Oracle, relational database management systems (MySQL), object-relational database management systems (PostgreSQL), and distributed storage systems (HBase).
[0059] S102: Create collection configuration information for the metadata to be collected and send it to the metadata collection device, so that the metadata collection device collects the target metadata according to the collection configuration information, and receive the performance indicators sent by the metadata collection device when collecting the target metadata.
[0060] To enable the metadata acquisition device to collect the generated metadata, in this embodiment of the invention, acquisition configuration information for the metadata to be collected is created. This configuration information includes the mount point of the metadata to be collected, the target data type, and the data acquisition task. The mount point refers to the storage location of the collected metadata within the metadata acquisition device, and the data acquisition task includes the acquisition time and the number of acquisition cycles.
[0061] After creating the collection configuration information for the metadata to be collected, in order for the metadata collection device to collect it, the collection configuration information is sent to the metadata collection device, so that the metadata collection device can collect the target metadata according to the collection configuration information. Specifically, the collection configuration information can be sent to the metadata collection device through an interface, through local area network communication, or through wired communication. This embodiment of the invention does not limit the method.
[0062] After the metadata acquisition device has collected the target metadata, in order to determine the performance of the metadata acquisition device in collecting metadata, the electronic device monitors the metadata acquisition device and receives the performance indicators of the metadata acquisition device when collecting the target metadata.
[0063] In this embodiment of the invention, metadata of the target metadata quantity is randomly generated based on the target metadata quantity contained in the received performance test instruction; collection configuration information for the metadata to be collected is created and sent to the metadata collection device, enabling the metadata collection device to collect the target metadata according to the collection configuration information, and performance indicators sent by the metadata collection device during the collection of the target metadata are received. Because this embodiment of the invention can automatically and randomly generate metadata of the target metadata quantity, create metadata collection configuration information and send it to the metadata collection device, and receive performance indicators sent by the metadata collection device, manual intervention in the metadata collection performance testing process is not required, thereby improving the automation level of metadata collection performance testing.
[0064] Example 2:
[0065] To improve the automation level of performance testing for metadata collection, based on the above embodiments, in this embodiment of the invention, the step of creating collection configuration information for the metadata to be collected and sending it to the metadata collection device includes:
[0066] Create the target data type, data acquisition task, and post-acquisition storage location in the metadata acquisition device for the metadata to be collected. Call the interface provided by the metadata acquisition device to write the post-acquisition storage location, the target data type, and the data acquisition task into the metadata acquisition device.
[0067] To improve the automation of performance testing for metadata collection, in this embodiment of the invention, any data type is randomly selected as the target data type based on each type of pre-saved metadata, and any storage location is randomly selected as the post-collection storage location of the metadata based on the pre-saved storage location in the metadata collection device, and a data collection task is created based on the pre-saved parameters.
[0068] The electronic device calls the interface provided by the metadata acquisition device. Through the page provided by this interface, it writes the created post-acquisition storage location, target data type, and data acquisition task to the metadata acquisition device. This allows the metadata acquisition device to collect target metadata of the target data type according to the data acquisition task and save the target metadata in the post-acquisition storage location. Preferably, in this embodiment of the invention, the interface provided by the metadata acquisition device is a RESTful interface.
[0069] Example 3:
[0070] To improve the automation level of performance testing for metadata collection, based on the above embodiments, in this embodiment of the invention, the method further includes:
[0071] Based on the performance indicator conditions contained in the performance test instruction and the performance indicator itself, determine whether the performance indicator meets the performance indicator conditions.
[0072] If not, generate a test record indicating that the test failed;
[0073] If so, generate a test record indicating a successful test.
[0074] To improve the automation of performance testing, in this embodiment of the invention, after receiving the performance indicators, the electronic device also needs to generate a test record to determine whether the test was successful based on the performance indicators.
[0075] To determine whether the test is successful, the received performance test instruction also includes performance indicator conditions. Based on the received performance indicators and performance indicator conditions, if the performance indicators meet the performance indicator conditions, a test record of successful test is generated; if the performance indicators do not meet the performance indicator conditions, a test record of failed test is generated.
[0076] Since the electronic device in this embodiment of the invention receives multiple performance indicators, and the received performance test instruction includes the performance indicator conditions corresponding to each performance indicator, in order to determine whether the test is successful, for each performance indicator, it is determined whether the performance indicator meets the corresponding performance indicator conditions. If each performance indicator meets the corresponding performance indicator conditions, a test record of successful test is generated. If any performance indicator does not meet the corresponding performance indicator conditions, a test record of failed test is generated.
[0077] Example 4:
[0078] To improve the automation of performance testing for metadata collection, based on the above embodiments, in this embodiment of the invention, after generating test records of failed tests, the method further includes:
[0079] Log information and runtime information generated during the collection of the metadata are written into the test record.
[0080] To improve the automation of performance testing for metadata collection, in this embodiment of the invention, during the metadata collection process, the electronic device automatically generates log information and operational information. The log information includes business system log information and test method log information; the operational information includes thread operational information and Structured Query Language (SQL) operational information.
[0081] Among them, thread execution information refers to the execution information of an electronic device when using a stack trace tool (Jstack) to dump threads. SQL execution information includes SQL statements, execution start time, and execution duration.
[0082] After generating test records for failed tests, the generated log information and runtime information should be written into the test records to facilitate analysis of the reasons for the test failures.
[0083] In order to generate test records, in this embodiment of the invention, writing the log information generated during the collection of the metadata into the test records includes:
[0084] Based on the pre-saved log keywords and the log information generated during the collection of the metadata, key log information containing the log keywords is determined.
[0085] The key log information is written into the test record.
[0086] Since the log information generated during the metadata collection process is quite cumbersome, in order to generate test records and improve user experience, in this embodiment of the invention, log keywords are pre-stored. Based on the log information generated during the metadata collection process and the log keywords, the log information is filtered to determine the key log information containing the log keywords, and the key log information is written into the test record.
[0087] In order to generate test records, in this embodiment of the invention, writing the runtime information generated during the collection of the metadata into the test records includes:
[0088] Based on the pre-saved class and method information and the thread execution information generated during the collection of the metadata, determine the core thread execution information corresponding to the class and method information in the thread execution information;
[0089] The core runtime information of the thread is written into the test record.
[0090] Since a large amount of thread execution information is generated during the metadata collection process, in order to record test data and improve user experience, in this embodiment of the invention, class and method information is pre-stored. Based on the thread execution information and class and method information generated during the metadata collection process, the core thread execution information corresponding to the class and method information in the thread execution information is determined, and the core thread execution information is written into the test record.
[0091] Example 5:
[0092] To determine whether a performance metric meets the performance metric conditions, based on the above embodiments, in this embodiment of the invention, the performance metric includes a response status code, response time, CPU utilization, and memory utilization. The step of determining whether the performance metric meets the performance metric conditions based on the performance metric conditions contained in the performance test instruction and the performance metric itself includes:
[0093] If the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance indicators are determined to meet the performance indicator conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata collection device has successfully collected the data.
[0094] Otherwise, it is determined that the performance index does not meet the performance index conditions.
[0095] To determine whether performance indicators meet the performance indicator conditions, in this embodiment of the invention, performance indicators include response status codes, response time, CPU utilization, and memory utilization. The response status code indicates whether the metadata acquisition device successfully acquired metadata. For example, response status codes include 0000 and 9999. If the response status code is 0000, it indicates that the metadata acquisition device successfully acquired metadata; if the response status code is 9999, it indicates that the metadata acquisition device successfully acquired metadata. Response time refers to the interval between the end time and the start time of metadata acquisition. CPU utilization refers to the ratio of CPU resources used during metadata acquisition to the total CPU resources. CPU utilization also refers to the ratio of the amount of memory used during metadata acquisition to the total amount of memory provided.
[0096] Based on the response status code in the received performance metrics and the target response status code in the performance test instruction, determine whether the response status code and the target response status code are the same. If the response status code and the target response status code are the same, then based on the response time, CPU utilization, and memory utilization in the received performance metrics and the corresponding thresholds in the performance test instruction, determine whether the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds. If so, it is determined that the performance metrics meet the performance metric conditions contained in the performance test instruction.
[0097] If the response status code is different from the target response status code, or if the response time is greater than the corresponding response time threshold, or if the CPU utilization is greater than the corresponding CPU utilization threshold, or if the memory utilization is greater than the corresponding memory utilization threshold, then the performance metric is determined to be unsatisfactory.
[0098] Example 6:
[0099] To generate a test report, based on the above embodiments, in this embodiment of the invention, the method further includes:
[0100] Update the number of tests and determine whether the updated number of tests has reached the preset number of tests;
[0101] If not, clear the collection configuration information, recreate the metadata collection configuration information and send it to the metadata collection device to retest the metadata collection device;
[0102] If so, generate and display a test report containing each test record generated during each execution.
[0103] To generate a test report, in this embodiment of the invention, the electronic device stores a preset number of tests, and the test report can only be generated after metadata collection is performed after the preset number of tests. Therefore, the electronic device updates the test count based on the current number of tests, that is, it uses the sum of the current number of tests and 1 as the updated count, and determines whether the updated count has reached the preset number of tests.
[0104] If the updated number of times does not reach the preset number, the next metadata collection will still need to be performed. Therefore, the electronic device cleans up the collection configuration information, which is the collection configuration information generated during the last test. The metadata collection configuration information is recreated and sent to the metadata collection device to reproduce the test.
[0105] If the number of updates reaches the preset number, a test report containing each test record generated during each execution will be produced and displayed. Specifically, the test report will be displayed on the screen in text format.
[0106] Example 7:
[0107] The performance testing method for metadata collection of the present invention is illustrated below through a specific embodiment. Figure 2 This is a schematic diagram illustrating the process of a performance testing method for metadata collection provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes the following steps:
[0108] S201: Based on the number of target metadata contained in the received performance test instruction, randomly generate metadata for the target metadata number.
[0109] S202: Create the target data type, data acquisition task, and post-acquisition storage location in the metadata acquisition device for the metadata to be collected. Call the interface provided by the metadata acquisition device to write the post-acquisition storage location, the target data type, and the data acquisition task into the metadata acquisition device.
[0110] S203: Performance metrics when receiving target metadata sent by the metadata acquisition device, including response status code, response time, CPU utilization, and memory utilization.
[0111] S204: Based on the performance index conditions and performance indexes contained in the performance test instruction, determine whether the performance indexes meet the performance index conditions; if not, proceed to S205; if yes, proceed to S206.
[0112] S205: Generate a test record for a failed test, write the log information and running information generated during the collection of the metadata into the test record, and proceed to S207.
[0113] S206: Generate a test record indicating successful testing.
[0114] S207: Update the number of tests and determine whether the updated number of tests has reached the preset number of tests. If not, proceed to S208; if yes, proceed to S209.
[0115] S208: Clear the data collection configuration information and proceed to S202.
[0116] S209: Generate and display a test report containing each test record generated during each execution.
[0117] Example 8:
[0118] Figure 3 This is a schematic diagram of the structure of a performance testing device for metadata acquisition provided in this application, as shown below. Figure 3 As shown, the device includes:
[0119] The generation module 301 is used to randomly generate metadata of the target metadata quantity based on the target metadata quantity contained in the received performance test instruction;
[0120] The processing module 302 is used to create collection configuration information for the metadata to be collected and send it to the metadata collection device, so that the metadata collection device collects the target metadata according to the collection configuration information, and receives the performance indicators sent by the metadata collection device when collecting the target metadata.
[0121] Furthermore, the processing module is specifically used to create the target data type, data acquisition task, and post-acquisition storage location in the metadata acquisition device for the metadata to be collected, and to call the interface provided by the metadata acquisition device to write the post-acquisition storage location, the target data type, and the data acquisition task into the metadata acquisition device.
[0122] Furthermore, the device also includes:
[0123] The judgment module is used to determine whether the performance indicator meets the performance indicator conditions contained in the performance test instruction and the performance indicator itself; if not, the generation module is triggered to execute the step of generating a test record of test failure; if yes, the generation module is triggered to execute the step of generating a test record of test success.
[0124] Furthermore, the device also includes:
[0125] The recording module is used to write the log information and running information generated during the collection of metadata into the test record after the generation module generates a test record for a failed test.
[0126] Further, the judgment module is specifically used to determine if the performance indicators include response status code, response time, CPU utilization, and memory utilization. If the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance indicator is determined to meet the performance indicator conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata acquisition device has successfully acquired the data; otherwise, the performance indicator is determined not to meet the performance indicator conditions.
[0127] Furthermore, the judgment module is also used to update the number of tests and determine whether the updated number of tests has reached the preset number of tests. If not, the processing module is triggered to perform the step of cleaning up the collection configuration information, recreating the collection configuration information of the metadata, and sending it to the metadata collection device to retest the metadata collection device. If yes, the generation module is triggered to perform the step of generating and displaying a test report containing each test record generated during each execution.
[0128] Furthermore, the recording module is specifically used to determine key log information containing the log keywords based on pre-saved log keywords and log information generated during the collection of the metadata; and to write the key log information into the test record.
[0129] Furthermore, the recording module is specifically used to determine the core thread running information corresponding to the class and method information in the thread running information based on the pre-saved class and method information and the thread running information generated during the collection of the metadata; and to write the core thread running information into the test record.
[0130] Figure 4 This is a schematic diagram of another metadata acquisition performance testing device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the device includes a data module 401, a service module 402, a log module 403, and a report module 404.
[0131] The data module 401 is used to randomly generate metadata of the target metadata quantity according to the target metadata quantity contained in the received performance test instruction, and to clean up the collection configuration information, which is equivalent to the generation module 301 in the embodiment of the present invention.
[0132] The business module 402 is used to create the collection configuration information of the metadata to be collected, call the interface provided by the metadata collection device, and write the collection configuration information into the metadata collection device, which is equivalent to the processing module 302 in this embodiment of the invention.
[0133] The log module 403 is used to determine key log information containing the log keywords based on pre-saved log keywords and log information generated during the collection of the metadata; to determine the core thread running information corresponding to the class and method information in the thread running information based on pre-saved class and method information and thread running information generated during the collection of the metadata; and to save SQL running information, which is equivalent to the recording module in this embodiment of the invention.
[0134] The reporting module 404 is used to generate test records and a test report containing each test record. It writes the log information and running information generated during the metadata collection process into the test records of test failures, which is equivalent to the generation module and recording module in the embodiment of the present invention.
[0135] Example 9:
[0136] Figure 5 This application provides a schematic diagram of an electronic device structure. Based on the above embodiments, this invention also provides an electronic device, such as... Figure 5 As shown, it includes: processor 501, communication interface 502, memory 503 and communication bus 504, wherein processor 501, communication interface 502 and memory 503 communicate with each other through communication bus 504.
[0137] The memory 503 stores a computer program, which, when executed by the processor 501, causes the processor 501 to perform the following steps:
[0138] Based on the number of target metadata contained in the received performance test instruction, randomize the metadata for that number of target metadata.
[0139] Create collection configuration information for the metadata to be collected and send it to the metadata collection device, so that the metadata collection device collects the target metadata according to the collection configuration information, and receive the performance indicators sent by the metadata collection device when collecting the target metadata.
[0140] Furthermore, the processor 501 is specifically used to create the collection configuration information of the metadata to be collected and send it to the metadata collection device, including: creating the target data type of the metadata to be collected, the data collection task and the post-collection storage location in the metadata collection device, calling the interface provided by the metadata collection device, and writing the post-collection storage location, the target data type and the data collection task into the metadata collection device.
[0141] Furthermore, the processor 501 is also configured to determine whether the performance indicator meets the performance indicator conditions based on the performance indicator conditions contained in the performance test instruction and the performance indicator itself; if not, generate a test record indicating a test failure; if yes, generate a test record indicating a test success.
[0142] Furthermore, the processor 501 is also used to write the log information and running information generated during the collection of metadata into the test record after the test record of the test failure is generated.
[0143] Further, the processor 501 is specifically configured to handle the performance metrics, including response status codes, response times, CPU utilization, and memory utilization. The step of determining whether a performance metric meets the performance metric conditions based on the performance metric conditions contained in the performance test instruction and the performance metric itself includes: if the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance metric is determined to meet the performance metric conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata acquisition device has successfully acquired the metadata; otherwise, the performance metric is determined not to meet the performance metric conditions.
[0144] Furthermore, the processor 501 is also used to update the number of tests and determine whether the updated number of tests has reached the preset number of tests; if not, the collection configuration information is cleared, the collection configuration information of the metadata is recreated and sent to the metadata collection device to retest the metadata collection device; if yes, a test report containing each test record is generated and displayed based on each test record generated during each execution.
[0145] Furthermore, the processor 501 is specifically used to write the log information generated during the collection of the metadata into the test record, including: determining key log information containing the log keywords based on pre-saved log keywords and the log information generated during the collection of the metadata; and writing the key log information into the test record.
[0146] Furthermore, the processor 501 is specifically used to write the runtime information generated during the metadata collection process into the test record, including: determining the core runtime information of the thread corresponding to the class and method information in the thread runtime information based on the pre-saved class and method information and the thread runtime information generated during the metadata collection process; and writing the core runtime information of the thread into the test record.
[0147] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0148] Communication interface 502 is used for communication between the above-mentioned electronic device and other devices.
[0149] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0150] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0151] Example 10:
[0152] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program executable by a processor. When the program is run on the processor, the processor executes the following steps:
[0153] Based on the number of target metadata contained in the received performance test instruction, randomize the metadata for that number of target metadata.
[0154] Create collection configuration information for the metadata to be collected and send it to the metadata collection device, so that the metadata collection device collects the target metadata according to the collection configuration information, and receive the performance indicators sent by the metadata collection device when collecting the target metadata.
[0155] Furthermore, the step of creating the collection configuration information for the metadata to be collected and sending it to the metadata collection device includes:
[0156] Create the target data type, data acquisition task, and post-acquisition storage location in the metadata acquisition device for the metadata to be collected. Call the interface provided by the metadata acquisition device to write the post-acquisition storage location, the target data type, and the data acquisition task into the metadata acquisition device.
[0157] Furthermore, the method also includes:
[0158] Based on the performance indicator conditions contained in the performance test instruction and the performance indicator itself, determine whether the performance indicator meets the performance indicator conditions.
[0159] If not, generate a test record indicating that the test failed;
[0160] If so, generate a test record indicating a successful test.
[0161] Furthermore, after generating the test record for the failed test, the method further includes:
[0162] Log information and runtime information generated during the collection of the metadata are written into the test record.
[0163] Furthermore, the performance metrics include response status codes, response time, CPU utilization, and memory utilization. Determining whether the performance metrics meet the performance metric conditions based on the performance metric conditions contained in the performance test instruction and the performance metrics themselves includes:
[0164] If the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance indicators are determined to meet the performance indicator conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata collection device has successfully collected the data.
[0165] Otherwise, it is determined that the performance index does not meet the performance index conditions.
[0166] Furthermore, the method also includes:
[0167] Update the number of tests and determine whether the updated number of tests has reached the preset number of tests;
[0168] If not, clear the collection configuration information, recreate the metadata collection configuration information and send it to the metadata collection device to retest the metadata collection device;
[0169] If so, generate and display a test report containing each test record generated during each execution.
[0170] Furthermore, writing the log information generated during the collection of the metadata into the test record includes:
[0171] Based on the pre-saved log keywords and the log information generated during the collection of the metadata, key log information containing the log keywords is determined.
[0172] The key log information is written into the test record.
[0173] Furthermore, writing the runtime information generated during the metadata collection process into the test record includes:
[0174] Based on the pre-saved class and method information and the thread execution information generated during the collection of the metadata, determine the core thread execution information corresponding to the class and method information in the thread execution information;
[0175] The core runtime information of the thread is written into the test record.
[0176] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0177] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0178] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0179] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0180] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A performance testing method for metadata collection, characterized in that, The method includes: Based on the number of target metadata contained in the received performance test instruction, random metadata of the target metadata number is generated, wherein the randomly generated metadata refers to information describing data attributes; Based on each data type of the pre-saved metadata, randomly select any data type as the target data type. Based on the storage location in the pre-saved metadata acquisition device, randomly select any storage location as the post-acquisition storage location of the metadata. Create a data acquisition task based on the pre-saved parameters. Send the post-acquisition storage location, the target data type, and the data acquisition task as the acquisition configuration information of the metadata to the metadata acquisition device, so that the metadata acquisition device can acquire the target metadata according to the acquisition configuration information. Receive the performance indicators sent by the metadata acquisition device when acquiring the target metadata. The method further includes: Based on the performance indicator conditions contained in the performance test instruction and the performance indicator itself, determine whether the performance indicator meets the performance indicator conditions. If not, generate a test record indicating that the test failed; If so, generate a test record indicating successful testing; The performance metrics include response status codes, response time, CPU utilization, and memory utilization. Determining whether the performance metrics meet the performance metric conditions based on the performance metric conditions contained in the performance test instruction and the performance metrics themselves includes: If the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance indicators are determined to meet the performance indicator conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata collection device has successfully collected the data. Otherwise, it is determined that the performance index does not meet the performance index conditions.
2. The method according to claim 1, characterized in that, After generating test records of failed tests, the method further includes: Log information and runtime information generated during the collection of the metadata are written into the test record.
3. The method according to claim 1, characterized in that, The method further includes: Update the number of tests and determine whether the updated number of tests has reached the preset number of tests; If not, clear the collection configuration information, recreate the metadata collection configuration information and send it to the metadata collection device to retest the metadata collection device; If so, generate and display a test report containing each test record generated during each execution.
4. The method according to claim 2, characterized in that, The step of writing the log information generated during the collection of the metadata into the test record includes: Based on the pre-saved log keywords and the log information generated during the collection of the metadata, key log information containing the log keywords is determined. The key log information is written into the test record.
5. The method according to claim 2, characterized in that, The step of writing the runtime information generated during the collection of the metadata into the test record includes: Based on the pre-saved class and method information and the thread execution information generated during the collection of the metadata, determine the core thread execution information corresponding to the class and method information in the thread execution information; The core runtime information of the thread is written into the test record.
6. A performance testing device for metadata acquisition, characterized in that, The device includes: The generation module is used to randomly generate metadata of the target metadata quantity based on the target metadata quantity contained in the received performance test instruction, wherein the randomly generated metadata refers to information describing data attributes; The processing module is used to randomly select any data type as the target data type according to each data type of the pre-saved metadata, randomly select any storage location as the post-collection storage location of the metadata according to the pre-saved storage location in the metadata acquisition device, create a data acquisition task according to the pre-saved parameters, send the post-collection storage location, the target data type, and the data acquisition task as the acquisition configuration information of the metadata to the metadata acquisition device, so that the metadata acquisition device can acquire the target metadata according to the acquisition configuration information, and receive the performance indicators sent by the metadata acquisition device when acquiring the target metadata. The device further includes: The judgment module is used to determine whether the performance indicator meets the performance indicator conditions based on the performance indicator conditions contained in the performance test instruction and the performance indicator itself; if not, the generation module is triggered to execute the step of generating a test record of test failure; if yes, the generation module is triggered to execute the step of generating a test record of test success. The judgment module is specifically used to determine if the performance indicators include response status code, response time, CPU utilization, and memory utilization. If the response status code is the same as the target response status code contained in the performance test instruction, and the response time, CPU utilization, and memory utilization are all not greater than the corresponding thresholds contained in the performance test instruction, then the performance indicator is determined to meet the performance indicator conditions contained in the performance test instruction, wherein the target response status code indicates that the metadata acquisition device has successfully acquired the data; otherwise, the performance indicator is determined not to meet the performance indicator conditions.
7. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. The memory stores a computer program that, when executed by the processor, causes the processor to perform the method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, It stores a computer program executable by a processor, which, when run on the processor, causes the processor to perform the method according to any one of claims 1-5.