CN115695227A - Performance testing method, device, electronic equipment and readable storage medium - Google Patents
Performance testing method, device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN115695227A CN115695227A CN202110831533.4A CN202110831533A CN115695227A CN 115695227 A CN115695227 A CN 115695227A CN 202110831533 A CN202110831533 A CN 202110831533A CN 115695227 A CN115695227 A CN 115695227A
- Authority
- CN
- China
- Prior art keywords
- log
- load balancing
- balancing device
- information
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 152
- 238000000034 method Methods 0.000 claims abstract description 43
- 238000011056 performance test Methods 0.000 claims abstract description 24
- 230000008569 process Effects 0.000 claims abstract description 15
- 230000002159 abnormal effect Effects 0.000 claims description 81
- 238000012545 processing Methods 0.000 claims description 43
- 238000004590 computer program Methods 0.000 claims description 11
- 238000010276 construction Methods 0.000 claims description 5
- 238000012546 transfer Methods 0.000 claims description 5
- 238000001914 filtration Methods 0.000 claims description 2
- 230000002349 favourable effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 239000003795 chemical substances by application Substances 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000006399 behavior Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 238000000513 principal component analysis Methods 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000010076 replication Effects 0.000 description 2
- 238000010187 selection method Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000003542 behavioural effect Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000000586 desensitisation Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本申请涉及设备性能测试技术领域,具体而言,本申请涉及一种性能测试方法、装置、电子设备及可读存储介质。The present application relates to the technical field of equipment performance testing, and in particular, the present application relates to a performance testing method, device, electronic equipment and readable storage medium.
背景技术Background technique
随着工程技术的不断发展,越来越多基于服务器集群实现的应用系统为人们日常的生活和工作提供服务。在应用系统中,可以采用负载均衡设备,即网络服务设备,对多台后端服务器进行流量分发,提高应用系统对外的服务能力。其中,对负载均衡设备进行性能测试,获知该设备的处理性能,有利于保证应用系统的稳定性。With the continuous development of engineering technology, more and more application systems based on server clusters provide services for people's daily life and work. In the application system, a load balancing device, that is, a network service device, can be used to distribute traffic to multiple back-end servers and improve the external service capability of the application system. Among them, performing a performance test on the load balancing device to know the processing performance of the device is beneficial to ensure the stability of the application system.
相关技术中,在对负载均衡设备的性能测试时候,通常采用线下测试方式,然而线下的测试环境与负载均衡设备实际应用所处的线上的运行环境存在差异,导致测试结果准确度低,且测试效率低。In related technologies, when testing the performance of load balancing devices, offline testing methods are usually used. However, there are differences between the offline test environment and the online operating environment where the load balancing device is actually applied, resulting in low accuracy of test results. , and the test efficiency is low.
发明内容Contents of the invention
本申请的目的旨在至少能解决上述的技术缺陷之一,特提出以下技术方案:The purpose of the application aims to at least solve one of the above-mentioned technical defects, and proposes the following technical solutions:
第一方面,提供了一种性能测试方法,包括:In the first aspect, a performance testing method is provided, including:
获取日志文件;所述日志文件包括负载均衡设备运行时的日志数据;Obtain a log file; the log file includes log data when the load balancing device is running;
解析所述日志文件,得到与用户请求相关的关键信息;Analyzing the log file to obtain key information related to the user request;
基于所述关键信息向所述负载均衡设备发送测试请求;sending a test request to the load balancing device based on the key information;
基于所述负载均衡设备在处理所述测试请求时的运行状态,确定所述负载均衡设备的性能。Based on the running status of the load balancing device when processing the test request, the performance of the load balancing device is determined.
结合第一方面,在第一方面的第一种实施方式中,所述解析所述日志文件,得到与用户请求相关的关键信息,包括:With reference to the first aspect, in the first implementation manner of the first aspect, the parsing of the log file obtains key information related to the user request, including:
针对每一所述日志文件,获取与预设日志模板中日志属性对应的日志信息;For each of the log files, obtain the log information corresponding to the log attribute in the preset log template;
对每一所述日志信息进行筛选,得到与用户请求相关的关键信息。Each of the log information is screened to obtain key information related to the user request.
结合第一方面的第一种实施方式,在第一方面的第二种实施方式中,所述对每一所述日志信息进行筛选,得到与用户请求相关的关键信息之前,还包括:With reference to the first implementation manner of the first aspect, in the second implementation manner of the first aspect, before the filtering of each log information to obtain key information related to user requests, further includes:
对所述日志文件中的日志信息进行合法性检查;Checking the validity of the log information in the log file;
删除未通过所述合法性检查的日志文件。Log files that fail the described legality checks are deleted.
结合第一方面的第二种实施方式,在第一方面的第三种实施方式中,所述对所述日志文件中的日志信息进行合法性检查,包括:With reference to the second implementation manner of the first aspect, in the third implementation manner of the first aspect, the checking of the validity of the log information in the log file includes:
基于预设的异常标签对日志文件中的日志信息进行合法性检查;Check the validity of the log information in the log file based on the preset exception label;
若确定日志文件中的日志信息携带有与所述预设的异常标签相应的信息,则确定该日志文件未通过所述合法性检查;If it is determined that the log information in the log file carries information corresponding to the preset abnormal label, then it is determined that the log file has not passed the legality check;
若确定日志文件中的日志信息未携带与所述预设的异常标签相应的信息,则确定该日志文件通过所述合法性检查。If it is determined that the log information in the log file does not carry information corresponding to the preset exception tag, it is determined that the log file passes the validity check.
结合第一方面的第二种或第三种实施方式,在第一方面的第四种实施方式中,所述对所述日志文件中的日志信息进行合法性检查,包括:With reference to the second or third implementation manner of the first aspect, in the fourth implementation manner of the first aspect, the checking of the validity of the log information in the log file includes:
预估所述日志文件中的日志信息包括异常信息的异常概率;所述异常信息包括:预设的关键词、变量异常信息、分布异常信息中的至少一种;It is estimated that the log information in the log file includes an abnormal probability of abnormal information; the abnormal information includes: at least one of preset keywords, variable abnormal information, and distribution abnormal information;
若所述异常概率大于预设概率,确定该日志文件未通过合法性检查;If the abnormal probability is greater than the preset probability, it is determined that the log file has not passed the legality check;
若所述异常概率小于或等于预设概率,确定该日志文件通过合法性检查。If the abnormal probability is less than or equal to the preset probability, it is determined that the log file passes the legality check.
结合第一方面,在第一方面的第五种实施方式中,所述基于所述关键信息向所述负载均衡设备发送测试请求,包括:With reference to the first aspect, in a fifth implementation manner of the first aspect, the sending a test request to the load balancing device based on the key information includes:
通过预设请求构造工具基于每条日志文件对应的关键信息生成文件传输curl命令;Generate a file transfer curl command based on the key information corresponding to each log file through the preset request construction tool;
基于所述curl命令向所述负载均衡设备发送测试请求。Sending a test request to the load balancing device based on the curl command.
结合第一方面,在第一方面的第六种实施方式中,所述基于所述负载均衡设备在处理所述测试请求时的运行状态,确定所述负载均衡设备的性能,包括:With reference to the first aspect, in the sixth implementation manner of the first aspect, the determining the performance of the load balancing device based on the running status of the load balancing device when processing the test request includes:
在所述负载均衡设备处理各日志文件分别对应的测试请求后,获取所述负载均衡设备的运行状态信息;After the load balancing device processes the test requests corresponding to each log file, obtain the running status information of the load balancing device;
基于所述运行状态信息确定所述负载均衡设备在处理所述测试请求时的运行状态;determining an operating state of the load balancing device when processing the test request based on the operating state information;
若所述负载均衡设备运行状态为异常,则确定性能未达标;If the operating state of the load balancing device is abnormal, it is determined that the performance is not up to standard;
若所述负载均衡设备运行状态为正常,则确定性能达标。If the running state of the load balancing device is normal, it is determined that the performance is up to standard.
结合第一方面的第六种实施方式,在第一方面的第七种实施方式中,所述运行状态信息包括状态文件和内核转储文件中的至少一种;所述状态文件用于记录所述负载均衡设备运行状态为正常时的信息;所述内核转储文件用于记录所述负载均衡设备运行状态为异常时的信息;With reference to the sixth implementation manner of the first aspect, in the seventh implementation manner of the first aspect, the running state information includes at least one of a state file and a core dump file; the state file is used to record all The information when the operating state of the load balancing device is normal; the kernel dump file is used to record the information when the operating state of the load balancing device is abnormal;
所述基于所述运行状态信息确定所述负载均衡设备在处理所述测试请求时的运行状态,包括:The determining the running state of the load balancing device when processing the test request based on the running state information includes:
基于所述运行状态信息是否包括内核转储文件确定所述负载均衡设备在处理所述测试请求时的运行状态;若所述运行状态信息未包括内核转储文件,确定所述负载均衡设备运行状态为正常;若所述运行状态信息包括内核转储文件,确定所述负载均衡设备运行状态为异常;Determine the operating state of the load balancing device when processing the test request based on whether the operating state information includes a core dump file; if the operating state information does not include a core dump file, determine the operating state of the load balancing device is normal; if the running state information includes a kernel dump file, determine that the running state of the load balancing device is abnormal;
和/或,基于所述状态文件的文件数量与所述测试请求的请求数量的比值,确定所述负载均衡设备在处理所述测试请求时的运行状态;若所述比值大于或等于预设比值,确定所述负载均衡设备运行状态为正常;若所述比值小于预设比值,确定所述负载均衡设备运行状态为异常;And/or, based on the ratio of the number of files in the status file to the number of requests for the test request, determine the operating status of the load balancing device when processing the test request; if the ratio is greater than or equal to a preset ratio , determining that the operating state of the load balancing device is normal; if the ratio is less than a preset ratio, determining that the operating state of the load balancing device is abnormal;
和/或,基于所述状态文件和内核转储文件分别对应的权重系数及在所述运行状态信息中的文件数量占比,确定所述负载均衡设备在处理所述测试请求时对应的达标值;若所述达标值小于预设达标阈值,确定所述负载均衡设备运行状态为异常;若所述达标值大于或等于预设达标阈值,确定所述负载均衡设备运行状态为正常。And/or, based on the respective weight coefficients corresponding to the state file and the core dump file and the proportion of the number of files in the running state information, determine the corresponding standard value of the load balancing device when processing the test request ; If the standard attainment value is less than the preset standard attainment threshold, determine that the load balancing device is running abnormally; if the standard attainment value is greater than or equal to the preset standard attainment threshold, determine that the load balancing device is running normally.
第二方面,提供了一种性能测试装置,包括:In a second aspect, a performance testing device is provided, including:
日志获取模块,用于获取日志文件;所述日志文件包括负载均衡设备运行时的日志数据;The log obtaining module is used to obtain log files; the log files include log data when the load balancing device is running;
日志解析模块,用于解析所述日志文件,得到与用户请求相关的关键信息;A log parsing module, configured to parse the log file to obtain key information related to the user request;
请求发送模块,用于基于所述关键信息向所述负载均衡设备发送测试请求;A request sending module, configured to send a test request to the load balancing device based on the key information;
性能确定模块,用于基于所述负载均衡设备在处理所述测试请求时的运行状态,确定所述负载均衡设备的性能。A performance determining module, configured to determine the performance of the load balancing device based on the running state of the load balancing device when processing the test request.
第三方面,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现本申请第一方面所示的性能测试方法。The third aspect provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the program, the performance testing method shown in the first aspect of the present application is implemented.
第四方面,提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现本申请第一方面所示的性能测试方法。In a fourth aspect, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium. When the program is executed by a processor, the performance testing method shown in the first aspect of the present application is implemented.
本申请提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solution provided by the application are:
本申请在获取日志文件后,解析该日志文件进而在获得与用户请求相关的关键信息后,基于关键信息向负载均衡设备发送测试请求,进而基于负载均衡设备处理测试请求时的运行状态,确定该负载均衡设备的性能;其中,日志文件包括负载均衡设备运行时的日志数据,也即本申请可以通过解析负载均衡设备的日志文件来模拟线上流量完成对负载均衡设备的线下性能测试,可以有效降低线下的测试环境与负载均衡设备实际应用所处线上的运行环境所存在的差异,提高线下测试所得结果的准确度,降低测试成本并提高测试效率。After obtaining the log file, the application parses the log file and obtains the key information related to the user request, then sends a test request to the load balancing device based on the key information, and then determines the test request based on the running status of the load balancing device when processing the test request. The performance of the load balancing device; wherein, the log file includes the log data when the load balancing device is running, that is, the application can simulate online traffic by parsing the log file of the load balancing device to complete the offline performance test of the load balancing device. Effectively reduce the difference between the offline test environment and the online operating environment where the load balancing device is actually applied, improve the accuracy of offline test results, reduce test costs and improve test efficiency.
本申请附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the application will be set forth in part in the description which follows, and will become apparent from the description, or may be learned by practice of the application.
附图说明Description of drawings
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, wherein:
图1为相关技术中采用交换机端口镜像流量的方案示意图;FIG. 1 is a schematic diagram of a solution using switch port mirroring traffic in the related art;
图2为本申请实施例提供的一种性能测试方法的流程示意图;Fig. 2 is a schematic flow chart of a performance testing method provided by the embodiment of the present application;
图3为本申请实施例提供的一种性能测试方案的示意图;Fig. 3 is a schematic diagram of a performance testing scheme provided by the embodiment of the present application;
图4为本申请实施例提供的一种性能测试方案的示意图;FIG. 4 is a schematic diagram of a performance testing scheme provided in the embodiment of the present application;
图5为本申请实施例提供的一种性能测试装置的结构示意图;FIG. 5 is a schematic structural diagram of a performance testing device provided in an embodiment of the present application;
图6为本申请实施例提供的一种性能测试的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device for performance testing provided by an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施例,实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本申请,而不能解释为对本申请的限制。Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present application, and are not construed as limiting the present application.
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。应该理解,当我们称元件被“连接”或“耦接”到另一元件时,它可以直接连接或耦接到其他元件,或者也可以存在中间元件。此外,这里使用的“连接”或“耦接”可以包括无线连接或无线耦接。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。Those skilled in the art will understand that unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the word "comprising" used in the description of the present application refers to the presence of features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, integers, Steps, operations, elements, components and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Additionally, "connected" or "coupled" as used herein may include wireless connection or wireless coupling. The expression "and/or" used herein includes all or any elements and all combinations of one or more associated listed items.
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.
下面对本申请涉及到的技术、名词等进行说明。The technologies, terms, etc. involved in this application will be described below.
负载均衡设备:是对多台后端服务器进行流量分发的网络服务设备。在基于服务器集群实现的应用系统中,可以通过流量分发,快速提高应用系统对外服务的能力。另,负载均衡设备也被称为“四到七层交换机”,其中,四层负载均衡主要通过报文中的目标地址和端口,结合负载均衡设备的服务器选择方式,决定最终选择的内部服务器;七层负载均衡主要通过报文中应用层内容,结合负载均衡设备设置的服务器的选择方式,决定最终选择的内部服务器。也即,七层负载均衡工作在OSI模型(Open System InterconnectionReference Model,开放式系统互联通信参考模型)的应用层,是基于虚拟的URL(uniformresource locator,统一资源定位符)或主机IP(Internet Protocol,网际互联协议)的负载均衡。Load balancing device: It is a network service device that distributes traffic to multiple back-end servers. In an application system implemented based on server clusters, traffic distribution can be used to rapidly improve the external service capability of the application system. In addition, the load balancing device is also called "four-to-seven-layer switch". Among them, the four-layer load balancing mainly determines the final selected internal server through the target address and port in the message, combined with the server selection method of the load balancing device; Layer-7 load balancing mainly determines the final selected internal server through the content of the application layer in the message, combined with the server selection method set by the load balancing device. That is to say, seven-layer load balancing works at the application layer of the OSI model (Open System Interconnection Reference Model, Open System Interconnection Communication Reference Model), and is based on a virtual URL (uniform resource locator, uniform resource locator) or host IP (Internet Protocol, Internet Protocol) load balancing.
线上流量:即真实流量。由于预发布环境需要真实流量做功能的回归与验证,对于一些可用性和业务容错性要求较高的应用,可以采用真实流量进行测试。Online traffic: that is, real traffic. Since the pre-release environment requires real traffic for functional regression and verification, for some applications that require high availability and business fault tolerance, real traffic can be used for testing.
HTTPS(Hyper Text Transfer Protocol over SecureSocket Layer),是以安全为目标的HTTP通道,在HTTP的基础上通过传输加密和身份认证保证传输过程的安全性。HTTPS (Hyper Text Transfer Protocol over SecureSocket Layer) is an HTTP channel aimed at security. On the basis of HTTP, the security of the transmission process is guaranteed through transmission encryption and identity authentication.
在负载均衡设备的性能测试中,由于线上用户访问行为较为复杂,线下模拟很难保持与用户行为一致,导致线下模拟不够真实,且线下模拟场景有限,可能会出现业务覆盖不全的情况,因此线上流量对负载均衡设备应用程序测试是一项重要的内容,但是线下的测试环境很难完全模拟线上的运行环境。在相关技术中,为了能够真实地进行测试,提供了一种采用交换机端口镜像流量的方案,其通过在镜像交换机上设置流量控制策略,将线上网关的流量拷贝到测试网关节点上,以实现四层线上流量复制。In the performance test of load balancing equipment, due to the complex online user access behavior, offline simulation is difficult to keep consistent with user behavior, resulting in unrealistic offline simulation, and limited offline simulation scenarios, which may lead to incomplete business coverage Therefore, online traffic is an important content for load balancing device application testing, but it is difficult for the offline test environment to fully simulate the online operating environment. In the related technology, in order to be able to test in reality, a scheme of using switch port mirroring traffic is provided, which copies the traffic of the online gateway to the test gateway node by setting the traffic control policy on the mirroring switch to realize Layer 4 online traffic replication.
然而,如图1所示,如果同样采用交换机端口镜像流量的方案,对七层负载均衡进行线上流量复制,由于大部分流量都使用了HTTPS协议,而HTTPS协议需要服务器和客户端个产生一个随机数(密钥),这就会出现测试环境与线上环境的服务器密钥不一致的情况,因此HTTPS流量实际无法与测试环境的负载均衡设备建联,导致该方案无法适用于七层负载均衡的线上流量复制。However, as shown in Figure 1, if the switch port mirroring traffic solution is also used to replicate online traffic for Layer 7 load balancing, most of the traffic uses the HTTPS protocol, and the HTTPS protocol requires the server and the client to generate a Random number (key), which will cause the server key in the test environment and the online environment to be inconsistent, so the HTTPS traffic cannot actually establish a connection with the load balancing device in the test environment, making this solution unsuitable for Layer 7 load balancing copy of online traffic.
针对现有技术中所存在的上述至少一个技术问题或者需要改善的地方,本申请提出一种性能测试方法,该方法通过自动解析负载均衡设备的线上日志来模拟线上流量完成对负载均衡设备的性能测试。本申请提供的方案可以理解为是对交换机端口镜像方法无法实现HTTPS流量建联的补充。本申请技术方案的实施只需要提供负载均衡设备的线上日志,即可实现批量流量复制,在遍历负载均衡设备的日志文件后(如在测试环境中跑线上运行时的日志数据所记录的行为数据),通过检查负载均衡设备是否出现异常来确定性能测试的结果,该技术方案有利于降低测试成本,提高测试效率,节约测试时间。Aiming at at least one of the above-mentioned technical problems existing in the prior art or areas that need to be improved, this application proposes a performance testing method, which simulates online traffic by automatically parsing the online logs of the load balancing device to complete the load balancing device performance testing. The solution provided in this application can be understood as a supplement to the inability to implement HTTPS traffic connection establishment in the switch port mirroring method. The implementation of the technical solution of this application only needs to provide the online log of the load balancing device to realize batch traffic replication. After traversing the log files of the load balancing device (as recorded in the log data when running online in the test environment Behavioral data), and determine the result of the performance test by checking whether the load balancing device is abnormal. This technical solution is beneficial to reduce the test cost, improve the test efficiency, and save the test time.
本申请实施例提供的方案涉及设备性能测试技术,具体通过如下实施例进行说明。The solutions provided in the embodiments of the present application relate to equipment performance testing technologies, which are specifically described through the following embodiments.
下面以具体地实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本申请的实施例进行描述。The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below in conjunction with the accompanying drawings.
本技术领域技术人员可以理解,这里所使用的“终端”可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、MID(Mobile Internet Device,移动互联网设备)等;“服务器”可以用独立的服务器或者是多个服务器组成的服务器集群来实现。Those skilled in the art can understand that the "terminal" used here can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, a personal digital assistant), a MID (Mobile Internet Device, a mobile Internet device), etc.; It can be realized by an independent server or a server cluster composed of multiple servers.
本申请实施例中提供了一种可能的实现方式,如图2所示,提供了一种性能测试方法,可以包括以下步骤S101-S104:A possible implementation is provided in the embodiment of the present application. As shown in FIG. 2, a performance testing method is provided, which may include the following steps S101-S104:
步骤S101:获取日志文件;日志文件包括负载均衡设备运行时的日志数据。Step S101: Obtain a log file; the log file includes log data when the load balancing device is running.
具体地,可以从处于线上的运行环境的负载设备中获取日志文件(log文件),也可以从用于存储负载均衡设备的日志服务器Log sever中获取;其中,线上的运行环境可以是负载均衡设备在应用系统实际应用时所处的环境。而本申请实施例可以执行应用于线下的测试环境,也即对负载均衡设备进行性能测试时所处的环境。Specifically, the log file (log file) can be obtained from the load device in the online operating environment, or can be obtained from the log server Log server used to store the load balancing device; wherein, the online operating environment can be a load Balance the environment in which the equipment is placed in the actual application of the application system. However, the embodiment of the present application may be implemented in an offline test environment, that is, the environment in which the performance test of the load balancing device is performed.
其中,步骤S101所获取的日志文件包括多条,每一日志文件包括负载均衡设备在线上环境中处理某一请求时对应的日志数据。其中,Log sever可以支持跟踪日志、分页查看、下载文件等功能,因此,本申请实施例可以通过Log sever获取负载均衡设备的日志文件。其中,如图4所示,Log sever可以构成日志系统的一部分。Wherein, the log file acquired in step S101 includes multiple items, and each log file includes corresponding log data when the load balancing device processes a certain request in the online environment. Wherein, the Log server can support functions such as tracking logs, viewing by page, and downloading files. Therefore, in this embodiment of the present application, the log files of the load balancing device can be obtained through the Log server. Wherein, as shown in FIG. 4, the Log server may constitute a part of the log system.
在本申请实施例中,执行的主程序在日志系统中获取case运行时相关的log文件,log文件也即日志文件,其记录了提供服务的系统与用户之间交互的信息。日志文件可以包括操作对象的某些操作和其操作结果按时间排序的集合数据;如,针对网络搜索而言,日志文件可以记录是利用网络搜索引擎搜索信息的用户在搜索信息期间与该网络搜索引擎发生互动的过程(记录的内容可以包括但不限于用户信息、提供服务的时间、服务出错的信息)。In the embodiment of the present application, the executed main program obtains log files related to case runtime in the log system, and the log files are also log files, which record the interaction information between the system providing the service and the user. The log file may include certain operations of the operation object and the aggregated data of its operation results sorted by time; for example, for web search, the log file may record whether a user who uses a web search engine to search for information interacts with the web searcher during the search for information. The engine interaction process (recorded content may include but not limited to user information, service provision time, service error information).
步骤S102:解析日志文件,得到与用户请求相关的关键信息。Step S102: Analyze the log file to obtain key information related to the user request.
具体地,解析日志文件可以是指针对步骤S101中获取到的日志文件进行解析处理,如采用正则的方式,解析原始日志格式,使日志数据结构化。如在解析的过程中,可以根据IP字段解析出对应的地址位置、经纬度等信息;在本申请中,可以通过解析日志文件获取到与用户请求相关的关键信息。Specifically, parsing the log file may refer to performing parsing processing on the log file acquired in step S101, for example, parsing the original log format in a regular manner to make the log data structured. For example, in the parsing process, the corresponding address location, latitude and longitude and other information can be parsed according to the IP field; in this application, key information related to the user request can be obtained by parsing the log file.
步骤S103:基于关键信息向负载均衡设备发送测试请求。Step S103: Send a test request to the load balancing device based on the key information.
具体地,基于关键信息向负载均衡设备发送测试请求时,可以是基于关键信息通过请求工具构造HTTP/HTTPS请求,并将构造所得的请求视为测试用的请求,向测试环境中的负载均衡设备发送。可以理解的是,该过程在模拟日志文件中记录的与线上用户访问行为相关的请求,并将模拟所得的测试请求向测试环境中的负载均衡设备发送,以查看处于测试环境中的负载均衡设备处理该测试请求时应用程序的运行情况。Specifically, when sending a test request to the load balancing device based on key information, an HTTP/HTTPS request can be constructed through a request tool based on the key information, and the constructed request can be regarded as a test request, and sent to the load balancing device in the test environment send. It is understandable that this process records requests related to online user access behavior in the simulated log file, and sends the simulated test request to the load balancing device in the test environment to view the load balancing in the test environment. The behavior of the application while the device is processing the test request.
步骤S104:基于负载均衡设备在处理测试请求时的运行状态,确定负载均衡设备的性能。Step S104: Based on the running state of the load balancing device when processing the test request, determine the performance of the load balancing device.
具体地,本申请实施例可以通过负载均衡设备处理测试请求后,检查负载均衡设备,如果检查发现负载均衡设备在处理测试请求时发生了崩溃、卡顿等问题运行状态为异常的问题时,可以确定负载均衡设备未通过当前的性能测试,也即负载均衡设备的性能不达标;如果检查发现负载均衡设备在处理测试请求时运行状态为正常,则可以确定负载均衡设备通过当前的性能测试,也即负载均衡设备的性能达标。Specifically, in the embodiment of the present application, after processing the test request through the load balancing device, check the load balancing device. If the inspection finds that the load balancing device has problems such as crashes and freezes when processing the test request, and the running status is abnormal, you can Determine that the load balancing device has not passed the current performance test, that is, the performance of the load balancing device is not up to standard; That is, the performance of the load balancing device meets the standard.
本申请实施例提供的性能测试方法可以应用于线下的测试环境中,通过自动解析负载均衡设备的日志文件(运行时的日志数据)来模拟线上流量完成对负载均衡设备的性能测试,该方法的实施降低了线下的测试环境与线上的运行环境之间的差异,有利于提高测试的准确度,降低测试成本,提高测试效率。The performance test method provided by the embodiment of the present application can be applied to an offline test environment, and the performance test of the load balancer device is completed by simulating online traffic by automatically parsing the log file (log data at runtime) of the load balancer device. The implementation of the method reduces the difference between the offline test environment and the online operating environment, which is beneficial to improving the accuracy of the test, reducing the test cost and improving the test efficiency.
下面针对本申请中遍历所有日志文件的具体处理过程进行说明。The specific process of traversing all log files in this application will be described below.
在一实施例中,如图3所示,步骤S102至步骤S103所执行的内容为遍历日志文件;具体地,步骤S102中解析日志文件,得到与用户请求相关的关键信息,包括以下步骤A1-A2:In one embodiment, as shown in FIG. 3, the content executed from step S102 to step S103 is to traverse the log file; specifically, the log file is parsed in step S102 to obtain key information related to the user request, including the following steps A1- A2:
步骤A1:针对每一日志文件,获取与预设日志模板中日志属性对应的日志信息。Step A1: For each log file, obtain the log information corresponding to the log attribute in the preset log template.
具体地,可以理解的是,获取回来的日志文件可以以非结构化的数据格式存在,本申请可以通过预设日志模板对日志文件进行格式化处理,也即将非结构化的日志数据转换为结构化的日志数据。其中,预设日志模板可以是针对应用需求自定义设置的,在本申请实施例中,考虑到需要模拟线上的用户请求构造测试请求,因此,可以根据构造测试请求所需的信息对应的日志属性预先设置所采用的日志模板。其中,日志属性可以包括IP地址、时间、用户名、域名、请求协议、用户代理等信息。Specifically, it can be understood that the acquired log files may exist in an unstructured data format, and this application may format the log files through a preset log template, that is, convert unstructured log data into structured standardized log data. Among them, the preset log template can be customized according to application requirements. In the embodiment of the present application, considering the need to simulate online user requests to construct test requests, therefore, the log corresponding to the information required for constructing test requests can be Property pre-sets the log template used. Wherein, the log attribute may include information such as IP address, time, user name, domain name, request protocol, and user agent.
可选地,预设日志模板中还可以包括自定义设置的日志格式(如各类日志分析工具所采用的格式)、在屏幕上显示的格式(如以表格、或罗列的形式在屏幕上显示日志信息)、日志等级(如致命错误FATAL、一般错误ERROR、警告WARN、一般信息INFO、调试信息DEBUG等几个等级)等信息。下面结合表1针对所获取的与预设日志模板中日志属性对应的日志信息进行举例说明:Optionally, the preset log template may also include a custom-set log format (such as the format adopted by various log analysis tools), a format displayed on the screen (such as displayed on the screen in the form of a table or a list) log information), log level (such as fatal error FATAL, general error ERROR, warning WARN, general information INFO, debugging information DEBUG, etc.) and other information. The following is an example of the acquired log information corresponding to the log attributes in the preset log template in conjunction with Table 1:
假设当前获取的某一条日志文件A(对应表1中序号为1的日志信息)为:Jan 1812:09:07shgh01-cp-netproxy124102.shgh01.ksyun.com tengine:2021-01-18T12:09:07+08:00218.28.204.55:48108120.92.172.246:443172.18.1.11:91000.0490.049200200321156"POSThttps://ipay.cloudwalk.cn/restaurant/api/order/initialOrder HTTP/1.1""-""okhttp/3.10.0"。Assume that a certain log file A currently obtained (corresponding to the log information with the serial number 1 in Table 1) is: Jan 1812:09:07shgh01-cp-netproxy124102.shgh01.ksyun.com tengine:2021-01-18T12:09:07 +08:00218.28.204.55:48108120.92.172.246:443172.18.1.11:91000.0490.049200200321156"POSThttps://ipay.cloudwalk.cn/restaurant/api/order/initialOrder HTTP/1.1""-"10"okhttp/ .
表1Table 1
具体地,表1中首行的项目对应为预设日志模板中的各项日志属性;其中,首行最后一列中“......”表示在同一预设日志模板中还可以针对需求设置其他的日志属性。其中,序号为1所在行对应的日志信息为从上述日志文件A中获取的日志信息。其中,序号为N可以表示当前获取的日志文件共有N条,所在行“xxx”表示在对应日志文件N中获取的日志信息。Specifically, the items in the first row in Table 1 correspond to the various log attributes in the preset log template; among them, the "..." in the last column of the first row indicates that the same preset log template can also be used for requirements Set other logging properties. Wherein, the log information corresponding to the row with the serial number 1 is the log information obtained from the above log file A. Wherein, the serial number N may indicate that there are N log files currently acquired, and the row "xxx" indicates the log information acquired in the corresponding log file N.
步骤A2:对每一日志信息进行筛选,得到与用户请求相关的关键信息。Step A2: Filter each log information to obtain key information related to the user request.
具体地,与用户请求相关的关键信息可以基于构造测试请求所需的参数设定。其中,关键信息可以包括以下至少一项:请求长度、HTTP请求方法、请求协议(如HTTP/HTTPS)、请求头Host字段、统一资源标识符(Uniform Resource Identifier,URI)、用户代理信息(User_agent信息)。Specifically, the key information related to the user request may be based on parameter settings required for constructing the test request. Wherein, the key information may include at least one of the following: request length, HTTP request method, request protocol (such as HTTP/HTTPS), request header Host field, uniform resource identifier (Uniform Resource Identifier, URI), user agent information (User_agent information ).
假设构造测试请求时使用到日志属性中请求长度、http请求方法、协议、请求的url、host和uri以及用户代理信息时,直接在每一日志信息中获取对应的信息。结合上述表1所示的例子,针对序号1对应的日志信息,执行步骤A2可以得到如下关键信息:Assuming that the request length, http request method, protocol, requested url, host and uri, and user agent information in the log attributes are used when constructing the test request, the corresponding information is directly obtained in each log information. Combined with the example shown in Table 1 above, for the log information corresponding to serial number 1, perform step A2 to obtain the following key information:
请求长度:321;Request length: 321;
http请求方法:POST;HTTP request method: POST;
协议:https:Protocol: https:
请求的url、host和uri:Requested url, host and uri:
ipay.cloudwalk.cn/restaurant/api/order/initialOrder;ipay.cloudwalk.cn/restaurant/api/order/initialOrder;
用户代理信息:okhttp/3.10.0。User agent information: okhttp/3.10.0.
在一实施例中,在解析日志文件后,可以获得各日志文件对应的配置文件(上述实施例中所述的日志信息、关键信息等可以存储在配置文件中);可选地,如图4所示,本申请实施例中,可以是在获取到线上log文件后,以每一行log作为一条日志文件,并针对该条日志文件进行解析。In one embodiment, after parsing the log files, configuration files corresponding to each log file can be obtained (the log information, key information, etc. described in the foregoing embodiments can be stored in the configuration file); optionally, as shown in Figure 4 As shown, in the embodiment of the present application, after the online log file is obtained, each line of log may be used as a log file, and the log file may be analyzed.
在一实施例中,如图4所示,为进一步提高测试的效率,同时避免因为日志文件中的日志信息所记录信息出错导致性能测试结果出现偏差,在步骤A2对每一日志信息进行筛选,得到与用户请求相关的关键信息之前,还针对每一日志文件中的日志信息进行合法性检查,具体地还包括步骤A3-A4:In one embodiment, as shown in FIG. 4 , in order to further improve the efficiency of the test and avoid deviations in the performance test results due to errors in the information recorded in the log information in the log file, each log information is screened in step A2, Before obtaining the key information related to the user request, the legality of the log information in each log file is also checked, specifically including steps A3-A4:
步骤A3:对日志文件中的日志信息进行合法性检查。Step A3: Check the validity of the log information in the log file.
步骤A4:删除未通过合法性检查的日志文件。Step A4: Delete the log files that fail the legality check.
具体地,在获取到每一条日志文件对应的日志信息后,对该条日志文件中的日志信息进行合法性检查,且仅在该条日志文件通过合法性检查时,执行后续的步骤;否则删除该条日志文件,并对下一条日志文件中的日志信息进行合法性检查。Specifically, after obtaining the log information corresponding to each log file, the log information in the log file is checked for legality, and only when the log file passes the legality check, the subsequent steps are performed; otherwise, delete log file, and check the validity of the log information in the next log file.
在一可行的实施例中,步骤A3中对日志文件中的日志信息进行合法性检查,包括以下步骤A31-A33:In a feasible embodiment, the log information in the log file is checked for legality in step A3, including the following steps A31-A33:
步骤A31:基于预设的异常标签对日志文件中的日志信息进行合法性检查;Step A31: Check the validity of the log information in the log file based on the preset abnormal label;
步骤A32:若确定日志文件中的日志信息携带有与预设的异常标签相应的信息,则确定该日志文件未通过合法性检查;Step A32: If it is determined that the log information in the log file carries information corresponding to the preset abnormal label, then it is determined that the log file has not passed the legality check;
步骤A33:若确定日志文件中的日志信息未携带与预设的异常标签相应的信息,则确定该日志文件通过合法性检查。Step A33: If it is determined that the log information in the log file does not carry information corresponding to the preset exception tag, then it is determined that the log file passes the legality check.
具体地,可以设定多个异常标签,进而基于异常标签对日志信息进行检查(如可以通过监督学习的算法模型实现)。其中,异常标签可以针对日志属性或预设日志模板中包括的信息设定,举例说明:由于不同的日志文件可能对应于不同的日志等级,适应本申请实施例可以设定仅采用日志等级为一般信息INFO所对应的日志文件进行线上流量的模拟,因此可以针对日志等级设定异常标签,如设定异常标签1对应于致命错误FATAL的日志等级、异常标签2对应于一般错误ERROR的日志等级、异常标签3对应于警告WARN的日志等级、异常标签4对应于调试信息DEBUG的日志等级;在进行合法性检查时,将日志文件中日志属性为日志等级的日志信息与设定的各异常标签进行比对,若该日志信息与任一异常标签相应,则确定该日志文件未通过合法性检查;若该日志信息与任何异常标签都不相应,则确定该日志文件通过合法性检查。Specifically, multiple abnormal labels can be set, and then the log information can be checked based on the abnormal labels (for example, it can be realized by an algorithm model of supervised learning). Among them, the abnormal label can be set for the information included in the log attribute or the preset log template. For example: since different log files may correspond to different log levels, it can be set to only use the log level as general in the embodiment of this application. The log file corresponding to the information INFO simulates the online traffic, so you can set the exception label for the log level, such as setting the exception label 1 to correspond to the log level of fatal error FATAL, and the exception label 2 to correspond to the log level of general error ERROR , Exception label 3 corresponds to the log level of warning WARN, and exception label 4 corresponds to the log level of debugging information DEBUG; when performing a legality check, the log information in the log file whose log attribute is the log level is compared with the set exception labels Perform comparison, if the log information corresponds to any abnormal label, it is determined that the log file has not passed the legality check; if the log information does not correspond to any abnormal label, then it is determined that the log file has passed the legality check.
可选地,本申请实施例基于步骤A31进行合法性检查时还可以输出检查结果,如在确定日志文件中的日志信息携带有与预设的异常标签相应的信息时,输出与至少一个异常标签相应的日志信息;如在确定日志文件中的日志信息未携带与预设的异常标签相应的信息时,输出为空NULL的检查结果。在此基础上,进行是否通过合法性检查的判断时,还可以基于检查结果是否为空NULL进行;如检查结果为空NULL,则确定相应的日志文件通过合法性检查;如检查结果不为空NULL,则确定相应的日志文件未通过合法性检查。Optionally, the embodiment of the present application may also output the check result when performing the legality check based on step A31, for example, when it is determined that the log information in the log file contains information corresponding to the preset abnormal tag, output the information corresponding to at least one abnormal tag Corresponding log information; if it is determined that the log information in the log file does not carry the information corresponding to the preset exception label, the output is an empty NULL check result. On this basis, when making a judgment on whether to pass the legality check, it can also be based on whether the check result is empty NULL; if the check result is empty NULL, then determine that the corresponding log file has passed the legality check; if the check result is not empty NULL, it is determined that the corresponding log file has failed the legality check.
在一可行的实施例中,步骤A3中对日志文件中的日志信息进行合法性检查,包括以下步骤A34-A36:In a feasible embodiment, the log information in the log file is checked for legality in step A3, including the following steps A34-A36:
步骤A34:预估日志文件中的日志信息包括异常信息的异常概率;Step A34: Estimate the abnormal probability that the log information in the log file includes abnormal information;
步骤A35:若所述异常概率大于预设概率,确定该日志文件未通过合法性检查;Step A35: If the abnormal probability is greater than the preset probability, determine that the log file has not passed the legality check;
步骤A36:若所述异常概率小于或等于预设概率,确定该日志文件通过合法性检查。Step A36: If the abnormality probability is less than or equal to the preset probability, determine that the log file has passed the legality check.
具体地,异常信息可以包括预设的关键词、变量异常信息、分布异常信息中的至少一种。其中,预设的关键词可以表征需求中希望排除的日志文件,如希望排除状态码为202所对应的日志文件时,可以设定关键词为202。其中,日志信息是日志文件中的变量,因此,变量异常信息可以是指所表征信息出现异常的日志信息;如针对日志属性“协议”而言,某一日志文件中协议所对应的日志信息为空NULL时,则可以确定该日志信息为变量异常信息。其中,分布异常信息可以是指与日志属性不匹配的日志信息;如日志属性为“http请求方法”时,某一日志文件中的日志信息为“https”,则可以确定该日志信息为分布异常信息。Specifically, the abnormal information may include at least one of preset keywords, variable abnormal information, and distribution abnormal information. Among them, the preset keyword can represent the log file that needs to be excluded in the requirement. For example, if you want to exclude the log file corresponding to the status code 202, you can set the keyword as 202. Among them, the log information is a variable in the log file. Therefore, the variable abnormal information can refer to the log information that the information represented is abnormal; for example, for the log attribute "protocol", the log information corresponding to the protocol in a log file is When NULL is empty, it can be determined that the log information is variable exception information. Among them, the abnormal distribution information may refer to log information that does not match the log attribute; for example, when the log attribute is "http request method", and the log information in a log file is "https", it can be determined that the log information is abnormal distribution information.
可选地,可以通过机器学习算法对日志文件中的日志信息包括异常信息的异常概率进行预估,如可以通过聚类、PCA(Principal Component Analysis,主成分分析)等的算法模型实现,输出每条日志文件对应的异常概率,并在异常概率大于预设概率的情况下,确定对应的日志文件未通过合法性检查;在异常概率小于或等于预设概率的情况下,确定对应的日志文件通过合法性检查。Optionally, a machine learning algorithm can be used to estimate the abnormal probability of the log information in the log file including abnormal information, such as through clustering, PCA (Principal Component Analysis, principal component analysis) and other algorithm models, and output every The abnormal probability corresponding to each log file, and if the abnormal probability is greater than the preset probability, it is determined that the corresponding log file has not passed the legality check; when the abnormal probability is less than or equal to the preset probability, it is determined that the corresponding log file has passed Legality check.
可选地,还可以针对各项异常信息设置权重系数,基于日志文件的日志信息中包括异常信息的维度和各项异常信息分别对应的权重系数计算异常概率。举例说明:假设预设概率为0.3且设定预设的关键词对应的权重系数为0.5,变量异常信息对应的权重系数为0.3,分布异常信息对应的权重系数为0.2;其中某一条日志文件的日志信息中,包括3个预设关键词、一条变量异常信息、无分布异常信息时,其对应的异常概率为:0.45(0.5*3+0.3*1+0.2*0);则可以确定异常概率大于预设概率,该条日志文件未通过合法性检查。Optionally, weight coefficients can also be set for each item of abnormal information, and the abnormal probability is calculated based on the dimensions of the log information including the abnormal information in the log file and the weight coefficients corresponding to each item of abnormal information. For example: Assume that the default probability is 0.3 and the weight coefficient corresponding to the preset keyword is set to 0.5, the weight coefficient corresponding to variable abnormal information is 0.3, and the weight coefficient corresponding to distribution abnormal information is 0.2; one of the log files When the log information includes 3 preset keywords, a variable abnormal information, and no distribution abnormal information, the corresponding abnormal probability is: 0.45 (0.5*3+0.3*1+0.2*0); then the abnormal probability can be determined Greater than the preset probability, the log file fails the legality check.
可选地,合法性检查还可以通过过滤器filter实现,在进行关键信息的筛选之前,通过过滤器滤掉与需求不相关的日志信息,以进一步提高性能测试的效率。如可以是等级过滤器(也成级别过滤器),对符合过滤等级的日志文件进行删除,对不符合过滤等级的日志文件进行保留。Optionally, the legitimacy check can also be implemented through a filter. Before screening key information, log information irrelevant to requirements is filtered out through the filter, so as to further improve the efficiency of performance testing. For example, it can be a level filter (also known as a level filter), delete log files that meet the filter level, and retain log files that do not meet the filter level.
下面针对基于关键信息向负载均衡设备发送测试请求的具体过程进行说明。The following describes the specific process of sending a test request to the load balancing device based on key information.
在一实施例中,步骤S103中基于关键信息向负载均衡设备发送测试请求,包括步骤B1-B2:In one embodiment, in step S103, a test request is sent to the load balancing device based on key information, including steps B1-B2:
步骤B1:通过预设请求构造工具基于每条日志文件对应的关键信息生成文件传输curl命令。Step B1: Generate a file transfer curl command based on the key information corresponding to each log file through the preset request construction tool.
步骤B2:基于curl命令向负载均衡设备发送测试请求。Step B2: Send a test request to the load balancing device based on the curl command.
具体地,预设请求构造工具可以是curl等工具,通过该工具基于关键信息生成curl命令和请求(如构造的报文);如图4所示,可以基于筛选得到的关键信息,生成curl(全称CommandLine URL或CommandLine Uniform Resource Locator)命令;其中,curl命令是在命令行方式下工作,利用URL的语法进行数据的传输或者文件的传输。可选地,在构建测试请求时,还可以结合负载均衡设备监听的服务端口号port、虚拟IP地址(virtual_ip,VIP)等进行。Specifically, the preset request construction tool can be tools such as curl, through which curl commands and requests (such as constructed messages) are generated based on key information; as shown in Figure 4, curl( The full name is CommandLine URL or CommandLine Uniform Resource Locator) command; among them, the curl command works in the command line mode, and uses the URL syntax to transmit data or file transmission. Optionally, when constructing the test request, it can also be combined with the service port number port and virtual IP address (virtual_ip, VIP) that the load balancing device monitors.
举例说明:基于上述日志文件A对应的关键信息,可以使用curl工具,结合负载均衡设备监听的ip地址(如10.111.76.129)和端口(如8080)构造报文:For example: based on the key information corresponding to the above log file A, you can use the curl tool to construct a message in combination with the IP address (such as 10.111.76.129) and port (such as 8080) monitored by the load balancing device:
curl-X POST--url"https://10.111.76.129:8080/ipay.cloudwalk.cn/restaurant/api/order/initialOrder"--user-agent"okhttp/3.10.0"--data′*******.....******′*curl-X POST --url "https://10.111.76.129:8080/ipay.cloudwalk.cn/restaurant/api/order/initialOrder" --user-agent "okhttp/3.10.0" --data′** *****.....******′*
其中,报文长度为321,报文长度携带的数据用“*”代替,也即进行了脱敏处理。Among them, the message length is 321, and the data carried in the message length is replaced with "*", that is, the desensitization process is performed.
可选地,使用curl命令发送测试请求可以是HTTP的POST请求(用于提交数据)。Optionally, using the curl command to send the test request may be an HTTP POST request (for submitting data).
下面对本申请中基于负载均衡设备在处理测试请求时的运行状态确定负载均衡设备的性能的具体处理过程进行说明。The specific processing process of determining the performance of the load balancing device based on the running status of the load balancing device when processing the test request in this application will be described below.
在一实施例中,如图3所示,步骤S104所执行的内容为检查设备;具体地,步骤S104中基于负载均衡设备在处理测试请求时的运行状态,确定负载均衡设备的性能,包括以下步骤C1-C4:In one embodiment, as shown in FIG. 3, the content executed in step S104 is to check the device; specifically, in step S104, based on the running status of the load balancing device when processing the test request, the performance of the load balancing device is determined, including the following Steps C1-C4:
步骤C1:在负载均衡设备处理各日志文件分别对应的测试请求后,获取负载均衡设备的运行状态信息。Step C1: After the load balancing device processes the test requests corresponding to each log file, obtain the running status information of the load balancing device.
其中,运行状态信息包括状态文件和内核转储文件中的至少一种。状态文件用于记录负载均衡设备运行状态为正常时的信息;内核转储文件用于记录负载均衡设备运行状态为异常时的信息。Wherein, the running state information includes at least one of a state file and a core dump file. The status file is used to record the information when the load balancing device is running normally; the kernel dump file is used to record the information when the load balancing device is running abnormally.
具体地,在本申请实施例中,当负载均衡设备出现卡死等运行状态为异常的问题时,可以主动丢弃运行状态为异常的线程,并生成内核转储coredump文件;如果在获取负载均衡设备的运行状态信息时,发现了相应的coredump文件,可以通过分析该coredump文件,查看负载均衡设备出现异常的情况。可选地,在coredump文件中,记录有线程的运行状态,可以是通过设定标签对不同的运行状态进行标识。若在coredump文件中查询到设定对应于运行状态为异常的标签时,也即运行状态信息表征负载均衡设备运行状态为异常;若在coredump文件中未发现对应于运行状态为异常状态的标签时,也即运行状态表征负载均衡设备运行状态为正常。Specifically, in the embodiment of the present application, when the load balancing device is stuck and other running status is abnormal, it can actively discard the thread whose running status is abnormal, and generate a coredump file; if the load balancing device is obtained The corresponding coredump file is found when the running status information is displayed, and the abnormality of the load balancing device can be checked by analyzing the coredump file. Optionally, in the coredump file, the running state of the thread is recorded, and different running states may be identified by setting labels. If the label corresponding to the abnormal operation status is found in the coredump file, that is, the operation status information indicates that the operation status of the load balancing device is abnormal; if no label corresponding to the abnormal operation status is found in the coredump file , that is, the running status indicates that the running status of the load balancing device is normal.
具体地,状态文件可以为预设数值大小的文件,如为0k的文件,该状态文件的生成表征负载均衡设备在处理某一测试请求时的运行状态为正常。Specifically, the state file may be a file with a preset numerical size, such as a file of 0k, and the generation of the state file indicates that the load balancing device is in a normal operating state when processing a certain test request.
步骤C2:基于运行状态信息确定负载均衡设备在处理测试请求时的运行状态。Step C2: Determine the running state of the load balancing device when processing the test request based on the running state information.
步骤C3:若负载均衡设备运行状态为异常,则确定性能未达标(未通过测试)。Step C3: If the running state of the load balancing device is abnormal, it is determined that the performance does not meet the standard (fails the test).
步骤C4:若负载均衡设备运行状态为正常,则确定性能达标(通过测试)。Step C4: If the running state of the load balancing device is normal, it is determined that the performance is up to standard (passed the test).
具体地,本申请实施例可以在负载均衡设备处理完所有测试请求后,最终确定负载均衡设备的性能测试结果;也即在遍历所有日志文件结束后,确定负载均衡设备的性能测试结果。也可以在负载均衡设备每处理完一个或设定数值的多个测试请求后,同步获取运行状态信息,并确定负载均衡设备的性能测试结果,并在确定负载均衡设备未通过性能测试的同时停止遍历后续的日志文件,以提高性能测试的效率,降低性能测试的成本。Specifically, in this embodiment of the present application, the performance test result of the load balancing device can be finally determined after the load balancing device has processed all test requests; that is, the performance test result of the load balancing device can be determined after traversing all log files. It is also possible to obtain the running status information synchronously after each load balancing device has processed one or multiple test requests with a set value, and determine the performance test results of the load balancing device, and stop when it is determined that the load balancing device has failed the performance test. Traverse subsequent log files to improve the efficiency of performance testing and reduce the cost of performance testing.
可选地,在步骤C2中基于运行状态信息确定负载均衡设备在处理测试请求时的运行状态,包括以下步骤C21-C23中的至少一项:Optionally, in step C2, based on the running state information, determining the running state of the load balancing device when processing the test request includes at least one of the following steps C21-C23:
步骤C21:基于运行状态信息是否包括内核转储文件确定负载均衡设备在处理测试请求时的运行状态;若运行状态信息未包括内核转储文件,确定负载均衡设备运行状态为正常;若运行状态信息包括内核转储文件,确定负载均衡设备运行状态为异常。Step C21: Determine the running state of the load balancing device when processing the test request based on whether the running state information includes a core dump file; if the running state information does not include a core dump file, determine that the running state of the load balancing device is normal; if the running state information Including the core dump file, it is determined that the operating status of the load balancing device is abnormal.
具体地,在本申请实施例中,内核转储文件仅在负载均衡设备运行状态为异常时生成,当运行状态信息仅包括coredump文件时,也即当获取的运行状态信息为空null时,表征为负载均衡设备运行状态为正常,可以直接确定负载均衡设备的性能达标;当所获取的运行状态信息中包括coredump文件时,表征负载均衡设备运行状态为异常,可以直接确定负载均衡设备的性能未达标。Specifically, in this embodiment of the application, the core dump file is only generated when the load balancing device is running abnormally. When the running state information only includes the coredump file, that is, when the obtained running state information is null, the representation If the running state of the load balancing device is normal, it can be directly determined that the performance of the load balancing device is up to standard; when the obtained running state information includes the coredump file, it indicates that the running state of the load balancing device is abnormal, and it can be directly determined that the performance of the load balancing device is not up to standard .
步骤C22:基于状态文件的文件数量与测试请求的请求数量的比值,确定负载均衡设备在处理测试请求时的运行状态;若比值大于或等于预设比值,确定负载均衡设备运行状态为正常;若比值小于预设比值,确定负载均衡设备运行状态为异常。Step C22: Based on the ratio of the number of files in the state file to the number of requests for the test request, determine the running status of the load balancing device when processing the test request; if the ratio is greater than or equal to the preset ratio, determine that the running status of the load balancing device is normal; if If the ratio is smaller than the preset ratio, it is determined that the operating state of the load balancing device is abnormal.
具体地,状态文件的生成可以表征负载均衡设备在处理对应测试请求时运行状态为正常。基于此,在负载均衡设备处理完所有日志文件对应的测试请求后,可以基于状态文件的文件数量与测试请求的请求数量的比值确定负载均衡设备在处理测试请求时最终体现的运行状态。Specifically, the generation of the status file may indicate that the load balancing device is running normally when processing the corresponding test request. Based on this, after the load balancing device processes the test requests corresponding to all the log files, the final running status of the load balancing device when processing the test requests can be determined based on the ratio of the number of state files to the number of test requests.
举例说明:假设预设比值为0.76,测试请求的请求数量为10000,状态文件的文件数量为8000时,状态文件的文件数量与测试请求的请求数量比值为0.8(8000/10000),则两者的比值大于预设比值,可以确定负载均衡设备运行正常。For example: Assuming that the preset ratio is 0.76, the number of test requests is 10000, and the number of status files is 8000, the ratio of the number of status files to the number of test requests is 0.8 (8000/10000), then both If the ratio is greater than the preset ratio, it can be determined that the load balancing device is operating normally.
步骤C23:基于状态文件和内核转储文件分别对应的权重系数及在运行状态信息中的文件数量占比,确定负载均衡设备在处理测试请求时对应的达标值;若达标值小于预设达标阈值,确定负载均衡设备运行状态为异常;若达标值大于或等于预设达标阈值,确定负载均衡设备运行状态为正常。Step C23: Based on the weight coefficients corresponding to the state files and core dump files and the proportion of the number of files in the running state information, determine the corresponding compliance value of the load balancing device when processing the test request; if the compliance value is less than the preset compliance threshold , it is determined that the load balancing device is running abnormally; if the up-to-standard value is greater than or equal to the preset up-to-standard threshold, it is determined that the load balancing device is running normally.
具体地,文件大小为预设数值的状态文件可以是文件大小为0k的状态文件。可以针对状态文件与coredump文件分别设定相应的权重系数,如状态文件对应的权重系数为0.3,coredump文件对应的权重系数为0.7;则可以通过状态文件与coredump文件在运行状态信息中的数量占比进行加权和计算,确定出运行状态信息对应的达标值。假设状态文件包括30,coredump文件包括10,则状态文件的数量占比为0.75,coredump文件的数量占比为0.25;此时可计算出运行状态信息所表征负载均衡设备的达标值=0.3*0.75+0.7*0.25=0.4。此时,可以将达标值与预设达标阈值进行比较,若小于预设达标阈值,则运行状态信息表征负载均衡设备运行状态为异常;若大于或等于预设达标阈值,则运行状态表征负载均衡设备运行状态为正常。Specifically, the state file whose file size is a preset value may be a state file whose file size is 0k. Corresponding weight coefficients can be set for status files and coredump files respectively. For example, the weight coefficient corresponding to status files is 0.3, and the weight coefficient corresponding to coredump files is 0.7; The ratio is weighted and calculated to determine the up-to-standard value corresponding to the running status information. Assuming that the status file includes 30 and the coredump file includes 10, the ratio of the number of status files is 0.75, and the ratio of the number of coredump files is 0.25; at this time, the up-to-standard value of the load balancing device represented by the running status information can be calculated = 0.3*0.75 +0.7*0.25=0.4. At this point, you can compare the up-to-standard value with the preset up-to-standard threshold. If it is less than the pre-set up-to-standard threshold, the running status information indicates that the load balancing device is running abnormally; if it is greater than or equal to the preset up-to-standard threshold, the running status indicates that the load balancing device The equipment operation status is normal.
可选地,还可以直接输出计算所得的达标值,以反馈负载均衡设备当前的性能状态。Optionally, the calculated up-to-standard value can also be directly output to feed back the current performance status of the load balancing device.
本申请实施例中提供了一种可能的实现方式,如图5所示,提供了一种性能测试装置500,该性能测试装置500可以包括:日志获取模块501、日志解析模块502、请求发送模块503、性能确定模块504。A possible implementation is provided in the embodiment of the present application. As shown in FIG. 5, a performance testing device 500 is provided, and the performance testing device 500 may include: a
其中,日志获取模块501,用于获取日志文件;日志文件包括负载均衡设备运行时的日志数据;日志解析模块502,用于解析日志文件,得到与用户请求相关的关键信息;请求发送模块503用于基于关键信息向负载均衡设备发送测试请求;性能确定模块504,用于基于负载均衡设备在处理测试请求时的运行状态,确定负载均衡设备的性能。Wherein, the
可选地,日志解析模块502用于执行解析日志文件,得到与用户请求相关的关键信息时,具体用于:Optionally, when the
针对每一日志文件,获取与预设日志模板中日志属性对应的日志信息;For each log file, obtain the log information corresponding to the log attribute in the preset log template;
对每一日志信息进行筛选,得到与用户请求相关的关键信息。Screen each log information to obtain key information related to user requests.
可选地,日志解析模块502用于执行对每一日志信息进行筛选,得到与用户请求相关的关键信息之前,还用于:Optionally, the
对日志文件中的日志信息进行合法性检查;Check the validity of the log information in the log file;
删除未通过合法性检查的日志文件。Delete log files that fail the legality check.
可选地,日志解析模块502用于执行对日志文件中的日志信息进行合法性检查时,具体用于:Optionally, when the
基于预设的异常标签对日志文件中的日志信息进行合法性检查;Check the validity of the log information in the log file based on the preset exception label;
若确定日志文件中的日志信息携带有与预设的异常标签相应的信息,则确定该日志文件未通过合法性检查;If it is determined that the log information in the log file carries information corresponding to the preset abnormal label, it is determined that the log file has not passed the legality check;
若确定日志文件中的日志信息未携带与预设的异常标签相应的信息,则确定该日志文件通过合法性检查。If it is determined that the log information in the log file does not carry information corresponding to the preset exception tag, it is determined that the log file passes the legality check.
可选地,日志解析模块502用于执行对日志文件中的日志信息进行合法性检查时,具体用于:Optionally, when the
预估日志文件中的日志信息包括异常信息的异常概率;异常信息包括:预设的关键词、变量异常信息、分布异常信息中的至少一种;The log information in the estimated log file includes the abnormal probability of abnormal information; the abnormal information includes: at least one of preset keywords, variable abnormal information, and distribution abnormal information;
若异常概率大于预设概率,确定该日志文件未通过合法性检查;If the abnormal probability is greater than the preset probability, it is determined that the log file has not passed the legality check;
若异常概率小于或等于预设概率,确定该日志文件通过合法性检查。If the abnormality probability is less than or equal to the preset probability, it is determined that the log file passes the legality check.
可选地,请求发送模块503用于执行基于关键信息向负载均衡设备发送测试请求时,具体用于:Optionally, when the
通过预设请求构造工具基于每条日志文件对应的关键信息生成文件传输curl命令;Generate a file transfer curl command based on the key information corresponding to each log file through the preset request construction tool;
基于curl命令向负载均衡设备发送测试请求。Send a test request to the load balancing device based on the curl command.
可选地,性能确定模块504用于执行基于负载均衡设备在处理测试请求时的运行状态,确定负载均衡设备的性能时,具体用于:Optionally, the
在负载均衡设备处理各日志文件分别对应的测试请求后,获取负载均衡设备的运行状态信息;After the load balancing device processes the test requests corresponding to each log file, obtain the running status information of the load balancing device;
基于运行状态信息确定负载均衡设备在处理测试请求时的运行状态;Determine the running status of the load balancing device when processing the test request based on the running status information;
若负载均衡设备运行状态为异常,则确定性能未达标;If the operating status of the load balancing device is abnormal, it is determined that the performance is not up to standard;
若负载均衡设备运行状态为正常,则确定性能达标。If the running status of the load balancing device is normal, it is determined that the performance is up to standard.
可选地,运行状态信息包括状态文件和内核转储文件中的至少一种;状态文件用于记录负载均衡设备运行状态为正常时的信息;内核转储文件用于记录负载均衡设备运行状态为异常时的信息;其中,性能确定模块用于执行基于运行状态信息确定负载均衡设备在处理测试请求时的运行状态时,具体用于:Optionally, the running state information includes at least one of a state file and a core dump file; the state file is used to record information when the load balancing device is running normally; the core dump file is used to record the load balancing device running as Abnormal information; wherein, the performance determination module is used to determine the operating status of the load balancing device when processing the test request based on the operating status information, specifically for:
基于运行状态信息是否包括内核转储文件确定负载均衡设备在处理测试请求时的运行状态;若运行状态信息未包括内核转储文件,确定负载均衡设备运行状态为正常;若运行状态信息包括内核转储文件,确定负载均衡设备运行状态为异常;Determine the running status of the load balancing device when processing test requests based on whether the running status information includes a core dump file; if the running status information does not include a core dump file, determine that the running status of the load balancing device is normal; if the running status information includes a kernel dump Store files to determine that the operating status of the load balancing device is abnormal;
和/或,基于状态文件的文件数量与测试请求的请求数量的比值,确定负载均衡设备在处理测试请求时的运行状态;若比值大于或等于预设比值,确定负载均衡设备运行状态为正常;若比值小于预设比值,确定负载均衡设备运行状态为异常;And/or, based on the ratio of the number of files in the status file to the number of requests for the test request, determine the running status of the load balancing device when processing the test request; if the ratio is greater than or equal to the preset ratio, determine that the running status of the load balancing device is normal; If the ratio is less than the preset ratio, it is determined that the operating state of the load balancing device is abnormal;
和/或,基于状态文件和内核转储文件分别对应的权重系数及在运行状态信息中的文件数量占比,确定负载均衡设备在处理测试请求时对应的达标值;若达标值小于预设达标阈值,确定负载均衡设备运行状态为异常;若达标值大于或等于预设达标阈值,确定负载均衡设备运行状态为正常。And/or, based on the weight coefficients corresponding to the status file and the core dump file and the proportion of the number of files in the running status information, determine the corresponding standard value of the load balancing device when processing the test request; if the standard value is less than the preset standard Threshold, determine that the operating status of the load balancing device is abnormal; if the compliance value is greater than or equal to the preset compliance threshold, determine that the operating status of the load balancing device is normal.
本公开实施例的性能测试装置可执行本公开的实施例所提供的一种性能测试方法,其实现原理相类似,本公开各实施例中的性能测试装置中的各模块所执行的动作是与本公开各实施例中的性能测试方法中的步骤相对应的,对于性能测试装置的各模块的详细功能描述具体可以参见前文中所示的对应的性能测试方法中的描述,此处不再赘述。The performance testing device in the embodiments of the present disclosure can execute a performance testing method provided in the embodiments of the present disclosure, and its implementation principle is similar. The actions performed by the modules in the performance testing devices in the embodiments of the present disclosure are the same as Corresponding to the steps in the performance testing method in each embodiment of the present disclosure, for the detailed functional description of each module of the performance testing device, please refer to the description in the corresponding performance testing method shown above, and will not repeat them here .
基于与本公开的实施例中所示的方法相同的原理,本公开的实施例中还提供了一种电子设备,该电子设备可以包括但不限于:处理器和存储器;存储器,用于存储计算机操作指令;处理器,用于通过调用计算机操作指令执行实施例所示的性能测试方法。与现有技术相比,本申请中的性能测试方法可以通过解析负载均衡设备的线上日志来模拟线上流量完成对负载均衡设备的性能测试,有利于提高测试的准确度,降低测试成本,提高测试效率。Based on the same principle as the method shown in the embodiments of the present disclosure, the embodiments of the present disclosure also provide an electronic device, which may include but not limited to: a processor and a memory; a memory for storing computer An operation instruction; a processor, configured to execute the performance testing method shown in the embodiment by calling the computer operation instruction. Compared with the prior art, the performance test method in this application can simulate the online traffic by analyzing the online log of the load balancing device to complete the performance test of the load balancing device, which is conducive to improving the accuracy of the test and reducing the test cost. Improve testing efficiency.
在一个可选实施例中提供了一种电子设备,如图6所示,图6所示的电子设备600包括:处理器601和存储器603。其中,处理器601和存储器603相连,如通过总线602相连。可选地,电子设备600还可以包括收发器604。需要说明的是,实际应用中收发器604不限于一个,该电子设备600的结构并不构成对本申请实施例的限定。An optional embodiment provides an electronic device, as shown in FIG. 6 , the
处理器601可以是CPU(Central Processing Unit,中央处理器),通用处理器,DSP(Digital Signal Processor,数据信号处理器),ASIC(Application SpecificIntegrated Circuit,专用集成电路),FPGA(Field Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器601也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。The
总线602可包括一通路,在上述组件之间传送信息。总线602可以是PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(ExtendedIndustry Standard Architecture,扩展工业标准结构)总线等。总线602可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器603可以是ROM(Read Only Memory,只读存储器)或可存储静态信息和指令的其他类型的静态存储设备,RAM(Random Access Memory,随机存取存储器)或者可存储信息和指令的其他类型的动态存储设备,也可以是EEPROM(Electrically ErasableProgrammable Read Only Memory,电可擦可编程只读存储器)、CD-ROM(Compact DiscRead Only Memory,只读光盘)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
存储器603用于存储执行本申请方案的应用程序代码,并由处理器601来控制执行。处理器601用于执行存储器603中存储的应用程序代码,以实现前述方法实施例所示的内容。The
其中,电子设备包括但不限于:移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。另,电子设备还可以是服务器,服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器,但本申请并不局限于此。图6示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Among them, electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDA (Personal Digital Assistants), PAD (Tablet Computers), and stationary terminals such as digital TVs, desktop computers, and the like. In addition, the electronic device can also be a server, and the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud Cloud servers for basic cloud computing services such as storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and big data and artificial intelligence platforms, but this application does not limited to this. The electronic device shown in FIG. 6 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当其在计算机上运行时,使得计算机可以执行前述方法实施例中相应内容。与现有技术相比,本申请中的性能测试方法可以通过解析负载均衡设备运行时的日志数据来模拟线上流量完成对负载均衡设备的性能测试,有利于提高测试的准确度,降低测试成本,提高测试效率。An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when it is run on a computer, the computer can execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the performance test method in this application can simulate the online traffic by analyzing the log data of the load balancing device to complete the performance test of the load balancing device, which is conducive to improving the accuracy of the test and reducing the test cost , improve test efficiency.
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow chart of the accompanying drawings are displayed sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the order of execution is also It is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the methods shown in the above-mentioned embodiments.
本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述实施例提供的方法步骤。An embodiment of the present application provides a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method steps provided in the foregoing embodiments.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional Procedural Programming Language - such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,日志获取模块还可以被描述为“用于获取日志文件的模块”。The modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the module does not constitute a limitation of the module itself under certain circumstances, for example, the log acquisition module may also be described as "a module for acquiring log files".
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the disclosure scope involved in this disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110831533.4A CN115695227A (en) | 2021-07-22 | 2021-07-22 | Performance testing method, device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110831533.4A CN115695227A (en) | 2021-07-22 | 2021-07-22 | Performance testing method, device, electronic equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115695227A true CN115695227A (en) | 2023-02-03 |
Family
ID=85045150
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110831533.4A Pending CN115695227A (en) | 2021-07-22 | 2021-07-22 | Performance testing method, device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115695227A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116155889A (en) * | 2023-03-14 | 2023-05-23 | 平安壹钱包电子商务有限公司 | A debugging method, device, storage medium and electronic equipment |
CN116248558A (en) * | 2023-02-14 | 2023-06-09 | 上海观测未来信息技术有限公司 | Reference test method, device and system for observability data gateway |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103902446A (en) * | 2012-12-27 | 2014-07-02 | 北京新媒传信科技有限公司 | Network server automated testing method and device |
US20140198667A1 (en) * | 2011-05-17 | 2014-07-17 | British Telecommunications Public Limited Company | Measurement method |
CN108399114A (en) * | 2018-03-21 | 2018-08-14 | 财付通支付科技有限公司 | A kind of system performance testing method, apparatus and storage medium |
CN112202625A (en) * | 2019-07-08 | 2021-01-08 | 中国移动通信集团浙江有限公司 | Network element abnormity diagnosis method and device, computing equipment and computer storage medium |
CN112612664A (en) * | 2020-12-24 | 2021-04-06 | 百度在线网络技术(北京)有限公司 | Electronic equipment testing method and device, electronic equipment and storage medium |
-
2021
- 2021-07-22 CN CN202110831533.4A patent/CN115695227A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140198667A1 (en) * | 2011-05-17 | 2014-07-17 | British Telecommunications Public Limited Company | Measurement method |
CN103902446A (en) * | 2012-12-27 | 2014-07-02 | 北京新媒传信科技有限公司 | Network server automated testing method and device |
CN108399114A (en) * | 2018-03-21 | 2018-08-14 | 财付通支付科技有限公司 | A kind of system performance testing method, apparatus and storage medium |
CN112202625A (en) * | 2019-07-08 | 2021-01-08 | 中国移动通信集团浙江有限公司 | Network element abnormity diagnosis method and device, computing equipment and computer storage medium |
CN112612664A (en) * | 2020-12-24 | 2021-04-06 | 百度在线网络技术(北京)有限公司 | Electronic equipment testing method and device, electronic equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116248558A (en) * | 2023-02-14 | 2023-06-09 | 上海观测未来信息技术有限公司 | Reference test method, device and system for observability data gateway |
CN116155889A (en) * | 2023-03-14 | 2023-05-23 | 平安壹钱包电子商务有限公司 | A debugging method, device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11711420B2 (en) | Automated management of resource attributes across network-based services | |
JP6280155B2 (en) | Techniques for network replication | |
US8001422B1 (en) | Shadow testing services | |
US9645910B1 (en) | Cross platform mobile HTML debugging | |
US20200233790A1 (en) | Designer defined mocking service behavior | |
US8990778B1 (en) | Shadow test replay service | |
CN103946809B (en) | Generate production server load activity for test servers | |
US10963370B2 (en) | Default mock implementations at a server | |
US10705946B2 (en) | Techniques for real time server testing in a production environment | |
CN103428042B (en) | Server is carried out the method and system of stress test | |
US8230325B1 (en) | Structured document customizable comparison systems and methods | |
CN105262608B (en) | Monitoring method and device for network service | |
US10397051B1 (en) | Configuration and testing of network-based service platform resources using a service platform specific language | |
CN110851471B (en) | Distributed log data processing method, device and system | |
US10986020B2 (en) | Reconstructing message flows based on hash values | |
CN114064475B (en) | Cloud native application testing method, device, equipment and storage medium | |
CN113535668A (en) | Log data processing method and device | |
CN110380890A (en) | A kind of CDN system service quality detection method and system | |
CN115695227A (en) | Performance testing method, device, electronic equipment and readable storage medium | |
CN117971799A (en) | Data development platform and data development method | |
CN112527453B (en) | Virtualization information simulation system, method and computer-readable storage medium | |
CN115996179A (en) | Service node testing method, device, readable medium and electronic equipment | |
CN117632445A (en) | Request processing method and device, task execution method and device | |
US12118350B1 (en) | Hierarchical clustering for coding practice discovery | |
CN115913912B (en) | Method and device for intercepting message and generating service link diagram |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |