WO2019169727A1 - 网络流量测试方法、装置、设备以及计算机可读存储介质 - Google Patents

网络流量测试方法、装置、设备以及计算机可读存储介质 Download PDF

Info

Publication number
WO2019169727A1
WO2019169727A1 PCT/CN2018/085271 CN2018085271W WO2019169727A1 WO 2019169727 A1 WO2019169727 A1 WO 2019169727A1 CN 2018085271 W CN2018085271 W CN 2018085271W WO 2019169727 A1 WO2019169727 A1 WO 2019169727A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
network traffic
traffic data
slave
time
Prior art date
Application number
PCT/CN2018/085271
Other languages
English (en)
French (fr)
Inventor
彭明强
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019169727A1 publication Critical patent/WO2019169727A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a network traffic testing method, apparatus, device, and computer readable storage medium.
  • the embodiment of the present invention provides a network traffic testing method, apparatus, device, and computer readable storage medium, which can quickly and accurately calculate statistics of network traffic data, thereby accurately calculating total network traffic data, and implementing the slave network server. Unified management.
  • the embodiment of the present application provides a network traffic testing method, where the method is applied to a server, where the server is connected to multiple slave servers, and the method includes: sending a corresponding startup test command to multiple slave servers to Obtaining corresponding network traffic data of each slave server after starting from the server; determining a test time from the start of the slave server, determining whether the test time reaches a preset time threshold T; if the test time reaches a preset The time threshold T is sent to all the slave servers to stop the test command, so that all the slave servers stop working; according to the corresponding network traffic data obtained by the server when the test time reaches the preset time threshold T, the total data is calculated.
  • Network traffic data is applied to a server, where the server is connected to multiple slave servers, and the method includes: sending a corresponding startup test command to multiple slave servers to Obtaining corresponding network traffic data of each slave server after starting from the server; determining a test time from the start of the slave server, determining whether the test time reaches a preset time threshold
  • the embodiment of the present application further provides a network traffic testing device, where the device includes: a sending unit, configured to send a corresponding startup test instruction to multiple slave servers to acquire each after starting from all the server Corresponding network traffic data from the server; a timing unit, configured to start a test time from the start of the slave server, determine whether the test time reaches a preset time threshold T; and the control unit is configured to: if the test time reaches a pre- Setting a time threshold T, sending a stop test command to all slave servers to stop all slave servers; and a processing unit for all slave network corresponding networks obtained when the test time reaches a preset time threshold T The traffic data is calculated and the total network traffic data is calculated.
  • a sending unit configured to send a corresponding startup test instruction to multiple slave servers to acquire each after starting from all the server Corresponding network traffic data from the server
  • a timing unit configured to start a test time from the start of the slave server, determine whether the test time reaches a preset time threshold T
  • the control unit is
  • the embodiment of the present application further provides a computer device, including: a memory, configured to store a program for implementing network traffic testing; and a processor, configured to run a program for implementing network traffic testing stored in the memory, To perform the method as described above.
  • an embodiment of the present application further provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors, To achieve the method as described above.
  • the embodiment of the present application can quickly and accurately implement statistics on network traffic data, thereby accurately calculating total network traffic data, and implementing unified management of the slave server.
  • FIG. 1 is a schematic flowchart of a network traffic testing method according to an embodiment of the present application
  • FIG. 2 is another schematic flowchart of a network traffic testing method according to an embodiment of the present application.
  • FIG. 3 is another schematic flowchart of a network traffic testing method according to an embodiment of the present application.
  • FIG. 4 is another schematic flowchart of a network traffic testing method according to an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of a network traffic testing apparatus according to an embodiment of the present application.
  • FIG. 6 is another schematic block diagram of a network traffic testing apparatus according to an embodiment of the present application.
  • FIG. 7 is another schematic block diagram of a network traffic testing apparatus according to an embodiment of the present application.
  • FIG. 8 is another schematic block diagram of a network traffic testing apparatus according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a network traffic testing method according to an embodiment of the present application.
  • the method can be applied to a server that is connected to a plurality of slave servers. As shown in FIG. 1, the method includes steps S101 to S104.
  • each of the slave servers is electrically connected to the terminal, and the number of slave servers is not limited in the embodiment of the present application.
  • Each slave server can accept a corresponding start test command.
  • Each start test command includes a start control signal and the number of concurrent tasks.
  • Each slave server can include several tasks, each of which can define its own behavior, such as web login behavior, list data query behavior, form submission behavior, etc., and the user can preset the weight of each task according to needs.
  • Each slave server starts after receiving the start test command and starts to work. At this time, the corresponding network traffic data generated by each slave server can be obtained.
  • the step S101 includes steps S201 to S203.
  • S201 Send a startup control signal and a corresponding number of concurrent tasks to the plurality of slave servers to start the corresponding slave server, and the number of concurrent tasks corresponding to each slave server is less than or equal to the number of tasks accommodated by the slave server.
  • the startup control signal is sent to the slave server, the slave server starts, and the slave server after the startup can perform the corresponding network traffic test.
  • a number of concurrent tasks must be set in advance, that is, each server must correspondingly preset the number of concurrent tasks that match it.
  • the number of concurrent tasks corresponding to one slave server is less than or equal to the number of tasks that the slave server accommodates, so that it is more convenient for subsequent stress testing.
  • S202 Control, according to the number of concurrent tasks corresponding to the slave server, and a preset rule, a task whose number of calls from the server is the same as the number of concurrent tasks, and start a thread corresponding to the number of concurrent tasks to perform respectively.
  • Task since each slave server includes a plurality of tasks, the number of concurrent tasks is generally less than or equal to the number of tasks each slave server includes. Performing another task requires starting a thread, so the number of tasks called from the server is the same as the number of threads started.
  • each task has its own behavior and weight defined in advance, so the preset rule may refer to the probability that the task is randomly selected according to the weight defined by the task itself when the task is called from the server.
  • the preset rule may refer to the probability that the task is randomly selected according to the weight defined by the task itself when the task is called from the server.
  • the weight of the task is significant, the probability of being called from the server is also increased.
  • the weight of the task is small, the probability of being called by the server is also reduced. For example, if a slave server includes three tasks, if the weight of the first task is 0.3, the weight of the second task is 0.9, the weight of the third task is 0.5, and the number of concurrent tasks is two, according to the task. The size of the weight defined by itself, the second task and the third task can be called from the server.
  • S203 Perform, by the slave server, all the called tasks, and determine corresponding network traffic data of the slave server.
  • the server executes all the invoked tasks, the sum of the network traffic data occupied by all the invoked tasks may be counted, and the sum is the corresponding network traffic data of the server.
  • the network traffic data includes a number of sending requests and a quantity of sent data
  • each invoked task includes a web login behavior, a list data query behavior, and a form submission behavior
  • the step S203 may include Steps S301 to S303.
  • the number of sending requests refers to the number of requests sent from each action included in all invoked tasks in the server.
  • the number of sending requests of one of the called tasks may be, when one of the called tasks includes a web login behavior, a list data query behavior, and a form submission behavior, the number of sent requests of the called task is a web login behavior.
  • the amount of transmitted data refers to the size of data transmitted from each of the actions included in all invoked tasks in the server.
  • the amount of data sent by one of the called tasks may be, when one of the called tasks includes a web login behavior, a list data query behavior, and a form submission behavior, the amount of data sent by the called task is web login behavior.
  • S102 Calculate a test time from the start of the slave server, and determine whether the test time reaches a preset time threshold T.
  • a preset time threshold T In the embodiment of the present application, when the startup test command is received from the server and the startup test is started, the timing is started, that is, the corresponding test time can be obtained in real time, and in order to enable unified management and testing, a preset time threshold T needs to be set. To avoid test errors.
  • test time reaches the preset time threshold T
  • send a stop test command to all slave servers to stop all slave servers.
  • the test time reaches the preset time threshold T it indicates that the test needs to be ended, and the test data is analyzed accordingly.
  • all the slaves receive the stop test command, they stop working. At this time, all the corresponding tasks of the slave threads in the slave server stop testing, and also Stop the acquisition of all network traffic data from the server.
  • S104 Calculate total network traffic data according to the corresponding network traffic data obtained by the server when the test time reaches the preset time threshold T.
  • the total network traffic data may specifically include the total number of transmission requests and the amount of data to be sent. Therefore, the average number of transmission requests per second may also be calculated according to the preset time threshold T and the total number of transmission requests.
  • dividing the preset time threshold T into at least one preset cycle time t means that the preset time threshold T can be divided into a plurality of preset cycle times t, wherein less than one preset cycle time t Also recorded as a preset cycle time t.
  • the step S104 includes: acquiring, according to the preset cycle time t, all the corresponding network traffic data returned from the server, to calculate real-time total network traffic data, until the test time reaches the preset time threshold T, and The last real-time total network traffic data is taken as the total network traffic data.
  • the timing is started when the slave server is started, thereby obtaining a corresponding test time.
  • all network traffic data returned from the server can be obtained every preset cycle time t, thereby calculating a corresponding real-time total network traffic data.
  • the network traffic data calculation is more accurate, and the network traffic test pressure is reduced.
  • All the slave network servers need to return the network traffic data every preset cycle time t.
  • the preset cycle time t of each slave server is equal, so that it is convenient to acquire and count the network traffic data of all slave servers on time.
  • the number of the slave servers can also be set according to actual needs. Therefore, in order to calculate the real-time total network traffic data, it is necessary to obtain all the network traffic data returned from the server.
  • the real-time total network traffic data includes the total number of real-time transmission requests and the total amount of real-time transmission data.
  • the data flow corresponding to all the network traffic returned from the server is obtained every predetermined cycle time t to calculate the real-time total network traffic data, including steps S401-S403.
  • n is an integer greater than or equal to 1.
  • the network traffic data returned during the current preset cycle time t n includes the number of transmission requests and the amount of transmitted data of all the slave servers in the current preset cycle time t n .
  • n is an integer greater than or equal to 1, and n cannot be greater than the number of preset cycle times t at which the preset time threshold T can be divided. For example, when the preset time threshold T can be divided into 1 preset cycle time t, n can only take 1; when the preset time threshold T can be divided into 2 preset cycle times t, then n can take 1 And 2; so you can analogize by analogy.
  • the network traffic data returned during the previous preset cycle time t (n-1) includes the number of transmission requests and the amount of transmitted data of all the slave servers in the previous preset cycle time t (n-1) .
  • the real-time total network traffic data calculated in the previous preset cycle time t (n-1) refers to all the slaves from the start of the server start to the end of the previous preset cycle time t (n-1) .
  • the network traffic data returned by the server When the value of n is 1, it means that the real-time total network traffic data in the time period of the preset cycle time t 0 is 0.
  • the preset time threshold T when the preset time threshold T is only divided into a preset cycle time t, all the network traffic data returned from the server in the preset cycle time t is the real-time total network traffic data.
  • the preset time threshold T can be divided into two or more preset cycle times t, the real-time total network traffic data in the penultimate preset cycle time t is obtained by calculation, and the second-to-last preset cycle time is obtained.
  • the sum of the real-time total network traffic data in t and the network data traffic returned from the server during the last preset cycle time t obtained is taken as the total network traffic data that should be obtained during the entire testing process.
  • the total network traffic data may specifically include the total number of transmission requests and the average number of transmission requests per second. Therefore, the average number of transmission requests per second may also be calculated according to the preset time threshold T and the total number of transmission requests.
  • the embodiment of the present application can quickly and accurately perform statistics on network traffic data, thereby accurately calculating total network traffic data, and implementing unified management of the slave server.
  • the embodiment of the present application further provides a network traffic testing device, where the device 100 includes: a sending unit 101, a timing unit 102, a control unit 103, and a processing unit 104.
  • the sending unit 101 is configured to send a corresponding startup test command to multiple slave servers to acquire corresponding network traffic data of each slave server after all slave servers are started.
  • each startup test instruction includes a startup control signal and a corresponding number of concurrent tasks
  • the transmitting unit 101 includes an adjustment unit 201, an execution unit 202, and a determination unit 203.
  • the adjusting unit 201 is configured to send a startup control signal and a corresponding number of concurrent tasks to the plurality of slave servers to start the corresponding slave server, where the number of concurrent tasks corresponding to each slave server is less than or equal to the task accommodated by the slave server. number.
  • the executing unit 202 is configured to control, according to the number of concurrent tasks corresponding to the slave server and a preset rule, a task whose number of calls from the server is the same as the number of concurrent tasks, and the number of startups corresponding to the number of concurrent tasks The thread executes the called task separately.
  • the determining unit 203 is configured to determine, by using the slave server, all the called tasks, and determine corresponding network traffic data of the slave server.
  • the network traffic data includes a number of sending requests and a quantity of sent data
  • each of the called tasks includes a web login behavior, a list data query behavior, and a form submission behavior
  • the determining unit 203 includes The first calculation unit 301, the second calculation unit 302, and the third calculation unit 303.
  • the first calculating unit 301 is configured to add the number of sending requests of the web login behavior of all called tasks executed by the server, the number of sending requests of the list data query behavior, and the number of sending requests of the form submitting behavior, to Get the number of send requests from this slave.
  • the second calculating unit 302 is configured to add the sent data amount of the web login behavior of all called tasks executed by the server, the sent data amount of the list data query behavior, and the sent data amount of the form submitting behavior, to The amount of transmitted data from the slave server is obtained.
  • the third calculating unit 303 is configured to add the number of sending requests from the server to the amount of sent data of the server to obtain corresponding network traffic data of the server.
  • the timing unit 102 is configured to start a test time from the start of the slave server, and determine whether the test time reaches a preset time threshold T.
  • the control unit 103 is configured to send a stop test command to all the slave servers to stop all the slave servers if the test time reaches the preset time threshold T.
  • the processing unit 104 is configured to calculate total network traffic data according to the corresponding network traffic data obtained by the server when the test time reaches the preset time threshold T.
  • dividing the preset time threshold T into at least one preset cycle time t means that the preset time threshold T can be divided into a plurality of preset cycle times t, wherein less than one preset cycle time t Also recorded as a preset cycle time t.
  • the processing unit 104 is further configured to acquire, according to the preset cycle time t, all the corresponding network traffic data returned from the server, to calculate real-time total network traffic data, until the test time reaches the preset time threshold T And the last real-time total network traffic data is taken as total network traffic data.
  • the timing is started when the slave server is started, thereby obtaining a corresponding test time.
  • all network traffic data returned from the server can be obtained every preset cycle time t, thereby calculating a corresponding real-time total network traffic data.
  • the processing unit 104 includes: a first obtaining unit 401, a second acquiring unit 402, and a counting unit 403.
  • the first obtaining unit 401 is configured to obtain all network traffic data returned from the server in the current preset cycle time t n , where n is an integer greater than or equal to 1.
  • the second obtaining unit 402 is configured to obtain real-time total network traffic data calculated in a previous preset period time t (n-1) .
  • the statistics unit 403 is configured to collect real-time total network traffic data calculated in the previous preset cycle time t (n-1) and all network traffic data returned from the server in the current preset cycle time t n Adding to obtain the real-time total network traffic data corresponding to the current preset cycle time t n .
  • the embodiment of the present application can quickly and accurately perform statistics on network traffic data, thereby accurately calculating total network traffic data, and implementing unified management of the slave server.
  • Each unit of the device in the embodiment of the present application has a one-to-one correspondence with each step of the method in the foregoing embodiment, so the specific analysis and principle are not described herein again.
  • FIG. 9 is a schematic structural diagram of a computer device according to the present application.
  • the device may be a terminal or a server, wherein the terminal may be a communication-enabled electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
  • the server can be a standalone server or a server cluster consisting of multiple servers.
  • the computer device 500 includes a processor 502, a non-volatile storage medium 503, an internal memory 504, and a network interface 505 connected by a system bus 501.
  • the non-volatile storage medium 503 of the computer device 500 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can be caused to perform a network traffic testing method.
  • the processor 502 of the computer device 500 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for the operation of a computer program in a non-volatile storage medium that, when executed by the processor, causes the processor 502 to perform the network traffic testing method of the above-described embodiments.
  • the network interface 505 of the computer device 500 is used to perform network communications, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the embodiment of the computer device shown in FIG. 9 does not constitute a limitation on the specific configuration of the computer device. In other embodiments, the computer device may include more or fewer components than illustrated. Or combine some parts, or different parts.
  • the application further provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the above-described embodiments Network traffic test method.
  • the foregoing storage medium of the present application includes: a magnetic disk, an optical disk, a read-only memory (ROM), and the like, which can store various program codes.
  • the units in all embodiments of the present invention may be implemented by a general-purpose integrated circuit, such as a CPU (Central Processing Unit), or by an ASIC (Application Specific Integrated Circuit).
  • the steps in the network traffic test method of the embodiment of the present application may be sequentially adjusted, merged, and deleted according to actual needs.
  • the units in the network traffic test terminal of the embodiment of the present application may be combined, divided, and deleted according to actual needs.

Abstract

本申请实施例公开了一种网络流量测试方法、装置、设备以及计算机可读存储介质,其中所述方法应用于服务器,所述服务器与多个从服务器相连,所述方法包括向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据;从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T;若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作;根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。

Description

网络流量测试方法、装置、设备以及计算机可读存储介质
本申请要求于2018年3月6日提交中国专利局、申请号为CN201810183220.0、申请名称为“网络流量测试方法、装置、设备以及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种网络流量测试方法、装置、设备以及计算机可读存储介质。
背景技术
对于网络中的某个服务器需要做网络流量压力测试时,由于单一的网络压测设备具有性能瓶颈,面对网络流量数据过大的情况,该单一的网络压测设备则无法满足压力测试需求。同时由于网络压测设备的硬件、软件具有多样性,故其性能也有较大差异,并且该网络压测设备无法对多个从服务器进行统一的管理以及分配测试流量权重。
发明内容
本申请实施例提供一种网络流量测试方法、装置、设备以及计算机可读存储介质,能够快速准确地实现对网络流量数据的统计,从而准确地计算得到总网络流量数据,并实现对从服务器的统一的管理。
一方面,本申请实施例提供了一种网络流量测试方法,该方法应用于服务器,该服务器与多个从服务器相连,所述方法包括:向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据;从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T;若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作;根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。
另一方面,本申请实施例还提供了一种网络流量测试装置,该装置包括:发送单元,用于向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据;计时单元,用于从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T;控制单元,用于若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作;处理单元,用于根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。
又一方面,本申请实施例还提供了一种计算机设备,包括:存储器,用于存储实现网络流量测试的程序;以及处理器,用于运行所述存储器中存储的实现网络流量测试的程序,以执行如上所述方法。
再一方面,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行,以实现如上所述方法。
实施本申请实施例能够快速准确地实现对网络流量数据的统计,从而准确地计算得到总网络流量数据,并实现对从服务器的统一的管理。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种网络流量测试方法的示意流程图;
图2是本申请实施例提供的一种网络流量测试方法的另一示意流程图;
图3是本申请实施例提供的一种网络流量测试方法的另一示意流程图;
图4是本申请实施例提供的一种网络流量测试方法的另一示意流程图;
图5是本申请实施例提供的一种网络流量测试装置的示意性框图;
图6是本申请实施例提供的一种网络流量测试装置的另一示意性框图;
图7是本申请实施例提供的一种网络流量测试装置的另一示意性框图;
图8是本申请实施例提供的一种网络流量测试装置的另一示意性框图;
图9是本申请实施例提供的一种计算机设备结构组成示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,图1是本申请实施例提供的一种网络流量测试方法的示意流程图。该方法可以应用于服务器,所述服务器与多个从服务器相连。如图1所示,该方法包括步骤S101~S104。
S101,向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据。在本申请实施例中,每个从服务器均与终端电性相连,且在本申请实施例中对从服务器的数量并不进行相应的限定。每个从服务器均可以接受一个与其相对应的启动测试指令。每个启动测试指令包括启动控制信号以及并发任务数。每个从服务器均可以包括若干任务,其中每个任务均可定义自身的行为,如web登录行为、列表数据查询行为、表单提交行为等,同时用户可以根据需要预设每个任务自身的权重。每个从服务器在接收到启动测试指令后即启动,并开始工作,此时则可以获取每个从服务器产生的相应的网络流量数据。
进一步地,如图2所示,所述步骤S101包括步骤S201~S203。
S201,向多个从服务器发送启动控制信号以及对应的并发任务数,以启动相应的从服务器,每个从服务器对应的并发任务数均小于或等于该从服务器容纳的任务数。在本申请实施例中,为了使得网络流量测试更方便精确,需要对多个与终端相连的从服务器发送启动控制信号。当启动控制信号一发送到从服务器,从服务器就进行启动,启动后的从服务器才可以进行相应的网络流量测试。又因为每个从服务器均容纳有多个任务,所以在测试过程中,要预先设置好一个并发任务数,即每个服务器均要对应地预设好与其相匹配的并发任务数,具体的,其中一个从服务器对应的并发任务数小于或等于该从服务器容纳的任务数,以便后续进行压力测试时更为方便。
S202,根据该从服务器对应的并发任务数以及预设规则,控制该从服务器调用数量与所述并发任务数相同的任务,并启动数量与所述并发任务数相对应 的线程以分别执行被调用的任务。在本申请实施例中,因每个从服务器均包括容纳有若干任务,故并发任务数一般小于或者等于每个从服务器包括容纳的任务数。又执行一个任务需要启动一个线程,故从服务器调用任务的数量与启动的线程的数量是相同的。
再者,每个任务都预先定义有自身的行为以及权重,故所述预设规则可以指,在从服务器调用任务时,根据任务自身定义的权重大小,其被随机选到的概率也随之不同,可以理解,当任务的权重大时,其被从服务器调用的概率也随之增大,当任务的权重小时,其被服务器调用的概率也随之减小。例如,若一个从服务器包括三个任务,若第一个任务的权重为0.3,第二个任务的权重为0.9,第三个任务的权重为0.5,而并发任务数为二,此时根据任务自身定义的权重的大小,该从服务器被调用的即可为第二个任务和第三个任务。
S203,通过该从服务器执行所有被调用的任务,确定该从服务器相应的网络流量数据。在本申请实施例中,该服务器执行所有被调用的任务时,即可以统计所有被调用的任务占用的网络流量数据的总和,该总和即为该服务器相应的网络流量数据。
进一步地,如图3所示,所述网络流量数据包括发送请求数以及发送数据量,每个被调用的任务均包括web登录行为、列表数据查询行为以及表单提交行为,所述步骤S203可以包括步骤S301~S303。
S301,将该从服务器执行的所有被调用的任务的web登录行为的发送请求数、列表数据查询行为的发送请求数以及表单提交行为的发送请求数相加,以得到该从服务器的发送请求数。在本申请实施例中,所述发送请求数是指从服务器中的所有被调用的任务所包括的每个行为所发送的请求的数量。例如,其中一个被调用任务的发送请求的数量可以是,当其中一个被调用的任务包括web登录行为、列表数据查询行为以及表单提交行为时,该被调用的任务的发送请求数为web登陆行为的发送请求数、列表数据查询行为的发送请求数以及表单提交行为的发送请求数这三者的和值。故从服务器的发送请求数即为所有被调用任务的发送请求的数量的总和。
S302,将该从服务器执行的所有被调用的任务的web登录行为的发送数据量、列表数据查询行为的发送数据量以及表单提交行为的发送数据量相加,以得到该从服务器的发送数据量。在本申请实施例中,所述发送数据量是指从服 务器中的所有被调用的任务所包括的每个行为所发送的数据的大小。例如,其中一个被调用任务的发送数据量可以是,当其中一个被调用的任务包括web登录行为、列表数据查询行为以及表单提交行为时,该被调用的任务的发送数据量为web登陆行为的发送数据量、列表数据查询行为的发送数据量以及表单提交行为的发送数据量这三者的和值。故从服务器的发送数据量即为所有被调用任务的发送数据量的总和。
S303,将该从服务器的发送请求数与该服务器的发送数据量相加,以得到该服务器相应的网络流量数据。在本申请实施例中,该服务器的发送请求数与该服务器的发送数据量的总和即为该服务器的网络流量数据。由此可知,通过计算单个从服务器的网络流量数据,可以求得所有从服务器的网络流量数据。同理,当被调用的任务还包括其他的行为时,也可以根据上述方式确定包括所有行为的该被调用任务的发送请求数以及发送数据量,继而确定对应的服务器的网络流量数据。
S102,从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T。在本申请实施例中,当从服务器接收到启动测试指令并进行启动测试时,开始计时,即可以实时得到相应的测试时间,为了能够进行统一管理和测试,需要设置一预设时间阀值T,以避免测试误差。
S103,若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作。在本申请实施例中,若所述测试时间达到预设时间阀值T,则表明此时测试需要结束,并对测试的数据进行相应的分析。此时需要向所有从服务器发送停止测试指令,当所有从服务器接收到停止测试指令后,即停止工作,此时所有的从服务器中的被启动过的线程所有对应的任务均停止测试,并且也停止对所有从服务器的网络流量数据的获取。
S104,根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。在本申请实施例中,当所述测试时间达到预设时间阀值T时,可以根据需要将所有从服务器相应的网络流量数据相加从而计算得到总网络流量数据。所述总网络流量数据具体可以包括总发送请求数以及发送数据量,故同时也可以根据预设时间阀值T以及总发送请求数计算得到平均每秒发送请求数。
作为进一步地,将预设时间阀值T分为至少一个预设周期时间t,是指可以 将预设时间阀值T分为若干个预设周期时间t,其中不足一个预设周期时间t的也记为一个预设周期时间t。在所有从服务器停止测试时,可以获取最后一个预设周期时间t内所有从服务器返回的网络数据流量。所述步骤S104包括:每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,直至所述测试时间达到所述预设时间阀值T,并将最后的实时总网络流量数据作为总网络流量数据。其中,当所述从服务器启动时就开始计时,从而得到一个相应的测试时间。在测试时间内,可以每隔预设周期时间t即获取一次所有从服务器返回的网络流量数据,从而计算得到一个相应的实时总网络流量数据。
具体地,为了进行统一管理和测试,使得网络流量数据计算更为准确,减少网络流量测试压力,需要所有从服务器每隔预设周期时间t返回一次网络流量数据。同时,每个从服务器的预设周期时间t均相等,从而方便按时获取并统计所有从服务器的网络流量数据。所述从服务器的数量也可以根据实际需要进行设置,故为了计算得到实时总网络流量数据,需要获取所有的从服务器返回的网络流量数据。所述实时总网络流量数据包括实时总发送请求数以及实时总发送数据量。
作为更进一步地,如图4所示,所述每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,包括步骤S401~S403。
S401,获取当前预设周期时间t n内的所有从服务器返回的网络流量数据,n为大于或等于1的整数。其中,该在当前预设周期时间t n内返回的网络流量数据包括了所有从服务器在当前预设周期时间t n内的发送请求数以及发送数据量。n为大于或等于1的整数,同时n不能大于预设时间阀值T能够分成的预设周期时间t的个数。例如,当预设时间阀值T能够分成1个预设周期时间t时,此时n即只能取1;当预设时间阈值T能够分成2个预设周期时间t时,此时n能取1和2;故可以依次类推。
S402,获取前一预设周期时间t (n-1)内计算得到的实时总网络流量数据。其中,该在前一预设周期时间t (n-1)内返回的网络流量数据包括了所有从服务器在前一预设周期时间t (n-1)内的发送请求数以及发送数据量。而前一预设周期时间t (n-1)内计算得到的实时总网络流量数据是指从从服务器启动开始计时到前一预 设周期时间t (n-1)结束这段时间内所有从服务器返回的网络流量数据。当n取值为1时,则表示预设周期时间t 0这一时间段内的实时总网络流量数据为0。
S403,将该前一预设周期时间t (n-1)内计算得到的实时总网络流量数据与当前预设周期时间t n内获取的所有从服务器返回的网络流量数据相加,以得到当前预设周期时间t n所对应的实时总网络流量数据。其中,确定该前一预设周期时间t (n-1)内计算得到的实时总网络流量数据后,将其与当前预设周期时间t n内获取的所有从服务器返回的网络流量数据相加,即可以得到当前预设周期时间t n所对应的实时总网络流量数据。
具体的,当预设时间阀值T只分成一个预设周期时间t时,预设周期时间t内所有从服务器返回的网络流量数据即为实时总网络流量数据。当预设时间阀值T能分成两个以上的预设周期时间t时,通过计算得到倒数第二个预设周期时间t内的实时总网络流量数据,并将倒数第二个预设周期时间t内的实时总网络流量数据与获取的最后一个预设周期时间t内所有从服务器返回的网络数据流量相加的和值作为整个测试过程应得的总网络流量数据。所述总网络流量数据具体可以包括总发送请求数以及平均每秒发送请求数,故同时也可以根据预设时间阀值T以及总发送请求数计算得到平均每秒发送请求数。
综上,本申请实施例能够快速准确地实现对网络流量数据的统计,从而准确地计算得到总网络流量数据,并实现对从服务器的统一的管理。
请参阅图5,对应上述网络流量测试方法,本申请实施例还提出一种网络流量测试装置,该装置100包括:发送单元101、计时单元102、控制单元103以及处理单元104。
所述发送单元101,用于向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据。
进一步地,如图6所示,每个启动测试指令均包括启动控制信号以及对应的并发任务数,所述发送单元101包括:调整单元201、执行单元202以及确定单元203。
所述调整单元201,用于向多个从服务器发送启动控制信号以及对应的并发任务数,以启动相应的从服务器,每个从服务器对应的并发任务数均小于或等于该从服务器容纳的任务数。
所述执行单元202,用于根据该从服务器对应的并发任务数以及预设规则, 控制该从服务器调用数量与所述并发任务数相同的任务,并启动数量与所述并发任务数相对应的线程以分别执行被调用的任务。
所述确定单元203,用于通过该从服务器执行所有被调用的任务,确定该从服务器相应的网络流量数据。
进一步地,如图7所示,所述网络流量数据包括发送请求数以及发送数据量,每个被调用的任务均包括web登录行为、列表数据查询行为以及表单提交行为,所述确定单元203包括:第一计算单元301、第二计算单元302以及第三计算单元303。
所述第一计算单元301,用于将该从服务器执行的所有被调用的任务的web登录行为的发送请求数、列表数据查询行为的发送请求数以及表单提交行为的发送请求数相加,以得到该从服务器的发送请求数。
所述第二计算单元302,用于将该从服务器执行的所有被调用的任务的web登录行为的发送数据量、列表数据查询行为的发送数据量以及表单提交行为的发送数据量相加,以得到该从服务器的发送数据量。
所述第三计算单元303,用于将该从服务器的发送请求数与该服务器的发送数据量相加,以得到该服务器相应的网络流量数据。
计时单元102,用于从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T。
控制单元103,用于若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作。
处理单元104,用于根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。
作为进一步地,将预设时间阀值T分为至少一个预设周期时间t,是指可以将预设时间阀值T分为若干个预设周期时间t,其中不足一个预设周期时间t的也记为一个预设周期时间t。在所有从服务器停止测试时,可以获取最后一个预设周期时间t内所有从服务器返回的网络数据流量。所述处理单元104还用于每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,直至所述测试时间达到所述预设时间阀值T,并将最后的实时总网络流量数据作为总网络流量数据。其中,当所述从服务器启动时就开始计时,从而得到一个相应的测试时间。在测试时间内,可以每隔预设周期时间t 即获取一次所有从服务器返回的网络流量数据,从而计算得到一个相应的实时总网络流量数据。
作为更进一步地,如图8所示,所述处理单元104包括:第一获取单元401、第二获取单元402以及统计单元403。
所述第一获取单元401,用于获取当前预设周期时间t n内的所有从服务器返回的网络流量数据,n为大于或等于1的整数。
所述第二获取单元402,用于获取前一预设周期时间t (n-1)内计算得到的实时总网络流量数据。
所述统计单元403,用于将该前一预设周期时间t (n-1)内计算得到的实时总网络流量数据与当前预设周期时间t n内获取的所有从服务器返回的网络流量数据相加,以得到当前预设周期时间t n所对应的实时总网络流量数据。
综上,本申请实施例能够快速准确地实现对网络流量数据的统计,从而准确地计算得到总网络流量数据,并实现对从服务器的统一的管理。本申请实施例中的装置的各个单元均与上述实施例中的方法的各个步骤一一对应,故其具体的分析和原理在此不再赘述。
上述网络流量测试装置可以实现为一种计算机程序的形式,计算机程序可以在如图9所示的计算机设备上运行。图9为本申请一种计算机设备的结构组成示意图。该设备可以是终端,也可以是服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。参照图9,该计算机设备500包括通过系统总线501连接的处理器502、非易失性存储介质503、内存储器504和网络接口505。其中,该计算机设备500的非易失性存储介质503可存储操作系统5031和计算机程序5032,该计算机程序5032被执行时,可使得处理器502执行一种网络流量测试方法。该计算机设备500的处理器502用于提供计算和控制能力,支撑整个计算机设备500的运行。该内存储器504为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器执行时,可使得处理器502执行上述实施例的网络流量测试方法。计算机设备500的网络接口505用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图9中示出的计算机设备的实施例并不构成对计算机设备具体构成的限定,在其他实施例中,计算机设备可以包括比图示 更多或更少的部件,或者组合某些部件,或者不同的部件布置。
本申请还提供了一种计算机可读存储介质,计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行,以实现上述实施例的网络流量测试方法。
本申请前述的存储介质包括:磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等各种可以存储程序代码的介质。本发明所有实施例中的单元可以通过通用集成电路,例如CPU(Central Processing Unit,中央处理器),或通过ASIC(Application Specific Integrated Circuit,专用集成电路)来实现。
本申请实施例网络流量测试方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例网络流量测试终端中的单元可以根据实际需要进行合并、划分和删减。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种网络流量测试方法,其特征在于,所述方法应用于服务器,所述服务器与多个从服务器相连,所述方法包括:
    向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据;
    从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T;
    若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作;
    根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。
  2. 如权利要求1所述的方法,其特征在于,每个启动测试指令均包括启动控制信号以及对应的并发任务数,所述向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据,包括:
    向多个从服务器发送启动控制信号以及对应的并发任务数,以启动相应的从服务器,每个从服务器对应的并发任务数均小于或等于该从服务器容纳的任务数;
    根据该从服务器对应的并发任务数以及预设规则,控制该从服务器调用数量与所述并发任务数相同的任务,并启动数量与所述并发任务数相对应的线程以分别执行被调用的任务;
    通过该从服务器执行所有被调用的任务,确定该从服务器相应的网络流量数据。
  3. 如权利要求2所述的方法,其特征在于,所述网络流量数据包括发送请求数以及发送数据量,每个被调用的任务均包括web登录行为、列表数据查询行为以及表单提交行为,所述通过该从服务器执行所有被调用的任务,确定该服务器相应的网络流量数据包括:
    将该从服务器执行的所有被调用的任务的web登录行为的发送请求数、列表数据查询行为的发送请求数以及表单提交行为的发送请求数相加,以得到该从服务器的发送请求数;
    将该从服务器执行的所有被调用的任务的web登录行为的发送数据量、列表数据查询行为的发送数据量以及表单提交行为的发送数据量相加,以得到该从服务器的发送数据量;
    将该从服务器的发送请求数与该服务器的发送数据量相加,以得到该服务器相应的网络流量数据。
  4. 如权利要求1所述的方法,其特征在于,将预设时间阀值T分为至少一个预设周期时间t,所述根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据,包括:
    每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,直至所述测试时间达到所述预设时间阀值T,并将最后的实时总网络流量数据作为总网络流量数据。
  5. 如权利要求4所述的方法,其特征在于,所述每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,包括:
    获取当前预设周期时间t n内的所有从服务器返回的网络流量数据,n为大于或等于1的整数;
    获取前一预设周期时间t (n-1)内计算得到的实时总网络流量数据;
    将该前一预设周期时间t (n-1)内计算得到的实时总网络流量数据与当前预设周期时间t n内获取的所有从服务器返回的网络流量数据相加,以得到当前预设周期时间t n所对应的实时总网络流量数据。
  6. 一种网络流量测试装置,其特征在于,所述装置包括:
    发送单元,用于向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据;
    计时单元,用于从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T;
    控制单元,用于若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作;
    处理单元,用于根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。
  7. 如权利要求6所述的装置,其特征在于,每个启动测试指令均包括启动控 制信号以及对应的并发任务数,所述发送单元,包括:
    调整单元,用于向多个从服务器发送启动控制信号以及对应的并发任务数,以启动相应的从服务器,每个从服务器对应的并发任务数均小于或等于该从服务器容纳的任务数;
    执行单元,用于根据该从服务器对应的并发任务数以及预设规则,控制该从服务器调用数量与所述并发任务数相同的任务,并启动数量与所述并发任务数相对应的线程以分别执行被调用的任务;
    确定单元,用于通过该从服务器执行所有被调用的任务,确定该从服务器相应的网络流量数据。
  8. 如权利要求7所述的装置,其特征在于,所述网络流量数据包括发送请求数以及发送数据量,每个被调用的任务均包括web登录行为、列表数据查询行为以及表单提交行为,所述确定单元包括:
    第一计算单元,用于将该从服务器执行的所有被调用的任务的web登录行为的发送请求数、列表数据查询行为的发送请求数以及表单提交行为的发送请求数相加,以得到该从服务器的发送请求数;
    第二计算单元,用于将该从服务器执行的所有被调用的任务的web登录行为的发送数据量、列表数据查询行为的发送数据量以及表单提交行为的发送数据量相加,以得到该从服务器的发送数据量;
    第三计算单元,用于将该从服务器的发送请求数与该服务器的发送数据量相加,以得到该服务器相应的网络流量数据。
  9. 如权利要求6所述的装置,其特征在于,将预设时间阀值T分为至少一个预设周期时间t,所述处理单元还用于每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,直至所述测试时间达到所述预设时间阀值T,并将最后的实时总网络流量数据作为总网络流量数据。
  10. 如权利要求9所述的装置,所述处理单元,包括:
    第一获取单元,用于获取当前预设周期时间t n内的所有从服务器返回的网络流量数据,n为大于或等于1的整数;
    第二获取单元,用于获取前一预设周期时间t (n-1)内计算得到的实时总网络流量数据;
    统计单元,用于将该前一预设周期时间t (n-1)内计算得到的实时总网络流量数据与当前预设周期时间t n内获取的所有从服务器返回的网络流量数据相加,以得到当前预设周期时间t n所对应的实时总网络流量数据。
  11. 一种计算机设备,其特征在于,包括:
    存储器,用于存储实现网络流量测试的程序;以及
    处理器,用于运行所述存储器中存储的实现网络流量测试的程序,以执行以下操作:
    向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据;
    从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时间阀值T;
    若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作;
    根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。
  12. 如权利要求11所述的设备,其特征在于,每个启动测试指令均包括启动控制信号以及对应的并发任务数,所述向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据,包括:
    向多个从服务器发送启动控制信号以及对应的并发任务数,以启动相应的从服务器,每个从服务器对应的并发任务数均小于或等于该从服务器容纳的任务数;
    根据该从服务器对应的并发任务数以及预设规则,控制该从服务器调用数量与所述并发任务数相同的任务,并启动数量与所述并发任务数相对应的线程以分别执行被调用的任务;
    通过该从服务器执行所有被调用的任务,确定该从服务器相应的网络流量数据。
  13. 如权利要求12所述的设备,其特征在于,所述网络流量数据包括发送请求数以及发送数据量,每个被调用的任务均包括web登录行为、列表数据查询行为以及表单提交行为,所述通过该从服务器执行所有被调用的任务,确定该 服务器相应的网络流量数据包括:
    将该从服务器执行的所有被调用的任务的web登录行为的发送请求数、列表数据查询行为的发送请求数以及表单提交行为的发送请求数相加,以得到该从服务器的发送请求数;
    将该从服务器执行的所有被调用的任务的web登录行为的发送数据量、列表数据查询行为的发送数据量以及表单提交行为的发送数据量相加,以得到该从服务器的发送数据量;
    将该从服务器的发送请求数与该服务器的发送数据量相加,以得到该服务器相应的网络流量数据。
  14. 如权利要求11所述的设备,其特征在于,将预设时间阀值T分为至少一个预设周期时间t,所述根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据,包括:
    每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,直至所述测试时间达到所述预设时间阀值T,并将最后的实时总网络流量数据作为总网络流量数据。
  15. 如权利要求14所述的设备,其特征在于,所述每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,包括:
    获取当前预设周期时间t n内的所有从服务器返回的网络流量数据,n为大于或等于1的整数;
    获取前一预设周期时间t (n-1)内计算得到的实时总网络流量数据;
    将该前一预设周期时间t (n-1)内计算得到的实时总网络流量数据与当前预设周期时间t n内获取的所有从服务器返回的网络流量数据相加,以得到当前预设周期时间t n所对应的实时总网络流量数据。
  16. 一种计算机可读存储介质,其特征在于,计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行,以实现以下步骤:
    向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据;
    从所述从服务器启动开始计测试时间,判断所述测试时间是否达到预设时 间阀值T;
    若所述测试时间达到预设时间阀值T,向所有从服务器发送停止测试指令,以使所有从服务器停止工作;
    根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,每个启动测试指令均包括启动控制信号以及对应的并发任务数,所述向多个从服务器发送对应的启动测试指令,以在所有从服务器进行启动后获取每个从服务器相应的网络流量数据,包括:
    向多个从服务器发送启动控制信号以及对应的并发任务数,以启动相应的从服务器,每个从服务器对应的并发任务数均小于或等于该从服务器容纳的任务数;
    根据该从服务器对应的并发任务数以及预设规则,控制该从服务器调用数量与所述并发任务数相同的任务,并启动数量与所述并发任务数相对应的线程以分别执行被调用的任务;
    通过该从服务器执行所有被调用的任务,确定该从服务器相应的网络流量数据。
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述网络流量数据包括发送请求数以及发送数据量,每个被调用的任务均包括web登录行为、列表数据查询行为以及表单提交行为,所述通过该从服务器执行所有被调用的任务,确定该服务器相应的网络流量数据包括:
    将该从服务器执行的所有被调用的任务的web登录行为的发送请求数、列表数据查询行为的发送请求数以及表单提交行为的发送请求数相加,以得到该从服务器的发送请求数;
    将该从服务器执行的所有被调用的任务的web登录行为的发送数据量、列表数据查询行为的发送数据量以及表单提交行为的发送数据量相加,以得到该从服务器的发送数据量;
    将该从服务器的发送请求数与该服务器的发送数据量相加,以得到该服务器相应的网络流量数据。
  19. 如权利要求16所述的计算机可读存储介质,其特征在于,将预设时间阀 值T分为至少一个预设周期时间t,所述根据所述测试时间达到预设时间阀值T时所获取的所有从服务器相应的网络流量数据,计算得到总网络流量数据,包括:
    每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,直至所述测试时间达到所述预设时间阀值T,并将最后的实时总网络流量数据作为总网络流量数据。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述每隔预设周期时间t获取所有从服务器返回的相应的网络流量数据,以计算得到实时总网络流量数据,包括:
    获取当前预设周期时间t n内的所有从服务器返回的网络流量数据,n为大于或等于1的整数;
    获取前一预设周期时间t (n-1)内计算得到的实时总网络流量数据;
    将该前一预设周期时间t (n-1)内计算得到的实时总网络流量数据与当前预设周期时间t n内获取的所有从服务器返回的网络流量数据相加,以得到当前预设周期时间t n所对应的实时总网络流量数据。
PCT/CN2018/085271 2018-03-06 2018-05-02 网络流量测试方法、装置、设备以及计算机可读存储介质 WO2019169727A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810183220.0A CN108418730B (zh) 2018-03-06 2018-03-06 网络流量测试方法、装置、设备以及计算机可读存储介质
CN201810183220.0 2018-03-06

Publications (1)

Publication Number Publication Date
WO2019169727A1 true WO2019169727A1 (zh) 2019-09-12

Family

ID=63129916

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/085271 WO2019169727A1 (zh) 2018-03-06 2018-05-02 网络流量测试方法、装置、设备以及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108418730B (zh)
WO (1) WO2019169727A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924013B (zh) * 2018-09-06 2020-07-07 北京天元创新科技有限公司 网络流量精确采集方法及装置
CN115456217A (zh) * 2022-09-14 2022-12-09 中远海运科技股份有限公司 一种智能船物联网数据资产管理方法与系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7099351B2 (en) * 2001-01-26 2006-08-29 Telcordia Technologies, Inc. Method and system for remote measurement of network traffic
CN106357479A (zh) * 2016-11-15 2017-01-25 中国人民解放军防空兵学院 一种全网络流量监测方法
US9571370B2 (en) * 2014-10-25 2017-02-14 Adtran, Inc. Wireless mesh network usage reporting system and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051500B (zh) * 2013-01-04 2015-09-09 北京邮电大学 一种服务网络系统的测试方法及系统
CN106713484B (zh) * 2017-01-10 2020-09-01 微梦创科网络科技(中国)有限公司 一种性能压测实现方法、系统及服务器
CN107015892B (zh) * 2017-03-30 2020-11-03 腾讯科技(深圳)有限公司 一种压力测试方法、装置和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7099351B2 (en) * 2001-01-26 2006-08-29 Telcordia Technologies, Inc. Method and system for remote measurement of network traffic
US9571370B2 (en) * 2014-10-25 2017-02-14 Adtran, Inc. Wireless mesh network usage reporting system and method
CN106357479A (zh) * 2016-11-15 2017-01-25 中国人民解放军防空兵学院 一种全网络流量监测方法

Also Published As

Publication number Publication date
CN108418730A (zh) 2018-08-17
CN108418730B (zh) 2020-11-27

Similar Documents

Publication Publication Date Title
CN108776934B (zh) 分布式数据计算方法、装置、计算机设备及可读存储介质
US9384114B2 (en) Group server performance correction via actions to server subset
WO2020238345A1 (zh) 压力测试方法、装置、系统、设备及计算机可读存储介质
US11018965B1 (en) Serverless function scaling
CN109324962B (zh) 一种基于云物联技术的应用程序的测试方法及设备
CN108205469B (zh) 一种基于MapReduce的资源分配方法及服务器
WO2019169723A1 (zh) 测试用例选择方法、装置、设备以及计算机可读存储介质
CN109542718B (zh) 服务调用的监控方法、装置、存储介质及服务器
US20150089510A1 (en) Device, system, apparatus, method and program product for scheduling
WO2019169727A1 (zh) 网络流量测试方法、装置、设备以及计算机可读存储介质
CN115269108A (zh) 一种数据处理方法、装置及设备
CN110750498B (zh) 对象访问方法、装置及存储介质
CN109491702B (zh) 一种优化方案确定方法、装置、终端设备和存储介质
CN113191114B (zh) 用于验证系统的方法和装置
CN110784336A (zh) 基于物联网的多设备智能定时延时场景设置方法及系统
JP2015225574A (ja) 制御装置、制御方法及びプログラム
CN111612373B (zh) 公有云系统性能一致性调整方法
CN104462116B (zh) 数据选择的方法及装置
CN111078418B (zh) 操作同步方法、装置、电子设备及计算机可读存储介质
WO2023015869A1 (zh) 限流控制方法、装置、设备及存储介质
CN111494938A (zh) 测速方法、装置、存储介质及电子装置
CN114338386B (zh) 一种网络的配置方法、装置、电子设备及存储介质
CN114327918B (zh) 调整资源量的方法、装置、电子设备和存储介质
CN115865826A (zh) 资源传输控制方法、装置、计算机设备、存储介质和产品
CN114780228A (zh) 一种混合云资源创建方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18908882

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14/12/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18908882

Country of ref document: EP

Kind code of ref document: A1