WO2020164263A1 - librgw的性能测试方法、装置和计算机设备 - Google Patents
librgw的性能测试方法、装置和计算机设备 Download PDFInfo
- Publication number
- WO2020164263A1 WO2020164263A1 PCT/CN2019/116336 CN2019116336W WO2020164263A1 WO 2020164263 A1 WO2020164263 A1 WO 2020164263A1 CN 2019116336 W CN2019116336 W CN 2019116336W WO 2020164263 A1 WO2020164263 A1 WO 2020164263A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- test
- file
- threads
- librgw
- read
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2294—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by remote test
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
Definitions
- This application relates to the technical field of performance testing, in particular to a method, device and computer equipment for performance testing of librgw.
- Ceph is a unified, distributed file system designed for excellent performance, reliability and scalability. It provides three types of storage: block storage, file storage, and object storage. Among them, object storage (cloud storage) is an object-oriented/file-oriented, massive Internet storage.
- object storage cloud storage
- ceph provides object storage services for Internet cloud service providers through rgw (Rados Gateway). The client first needs to request rgw via http, and then access Ceph via rgw. And our company has developed a new way to access Ceph.
- Librgw is set in the client. When data needs to be read, the client needs to call librgw through a JAVA program to directly access the ceph cluster, thereby reading the data in the ceph cluster .
- librgw is an application. Since librgw is a new access method to ceph, there is currently no performance test method for librgw, and developers cannot understand the relevant performance data of librgw when reading and writing data in ceph.
- the main purpose of this application is to provide a librgw performance test method, device and computer equipment, aiming to solve the drawbacks of the prior art that there is no test method for librgw performance.
- this application provides a performance test method of librgw, which is used for multiple reading and writing tests of test files, and the method includes:
- test instruction includes a test file size and test parameters
- librgw to read the test file corresponding to the size of the test file from the preset server according to the test parameters, write the test file into the storage space, and record each time the librgw performs the test file Reading and writing test data generated during the process of reading and writing, and respectively acquiring the read and write status of each time the librgw reads and writes the test file;
- test data and the read/write status are output to the display interface as test information.
- This application also provides a performance test device of librgw, which is used for reading and writing test files for multiple times, and the test device includes:
- the read-write module calls librgw to read the test file corresponding to the size of the test file from the preset server according to the test parameters, write the test file into the storage space, and record every time the librgw performs the test
- the output module is used to output each of the test data and the read/write status as test information to the display interface.
- the present application also provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the above methods when the computer program is executed by the processor.
- the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above methods are implemented.
- the performance test method, device and computer equipment of librgw provided in this application, according to the test file size and test parameters input by the user, read and write the corresponding test file from the preset server through librgw, thereby testing that librgw performs the test file Read and write all test information, and output all test information graphically, so that developers can quickly get the relevant data of librgw in the process of reading and writing data, and complete the performance test for librgw.
- FIG. 1 is a schematic diagram of the steps of a performance test method of librgw in an embodiment of the present application
- FIG. 2 is a block diagram of the overall structure of the performance testing device of librgw in an embodiment of the present application
- FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the present application.
- an embodiment of the present application provides a performance test method of librgw, which is used for multiple read and write tests of test files, and the method includes:
- S1 Receive a test instruction, where the test instruction includes a test file size and test parameters;
- S3 Output each of the test data and the read/write status as test information to the display interface.
- the client after the client creates the data, it needs to upload the data to the ceph cluster, that is, the preset server for storage.
- the client is provided with librgw.
- the client When data needs to be read, the client needs to call librgw to access the ceph cluster through a JAVA program, thereby reading the data in the ceph cluster and writing the read data to the client's hard disk.
- librgw is the access application.
- the client When the client is doing librgw performance testing, it needs to take corresponding actions according to the test instructions entered by the user.
- the test instruction entered by the user includes the size of the test file and test parameters; the size of the test file is the storage size of the test file, such as 4KB, 1MB, etc.; the test parameters include the specified number of threads, test time or test request volume , The designated number of threads is the total number of threads that simultaneously initiate calls to librgw during the read and write process, the test time is the total time of the entire read and write process, and the test request volume is the total number of read and write requests during the entire read and write process.
- the client After the client receives the test instruction input by the user, it calls librgw through a pre-built JAVA program, and filters the test file corresponding to the size of the test file according to the prefix of the file name of the test file. Among them, when the test file is generated, the file name will carry a file prefix consistent with the file size of the test file. For example, if the file size of test file A is 4KB, the file name of test file A is 4KB_test file A.
- Librgw initiates a number of threads that call librgw at the same time, reads the test files from the preset server, and writes the test files to the client's hard disk, until the entire read and write time reaches the test time. .
- test time and test request amount can only be selected during the test process, and cannot be selected at the same time; one read request is one request amount, and one write request is one request amount, so one read and write request is two requests amount . For example, if the number of test requests is 80, there are a total of 40 read requests and 40 write requests in this test.
- the client calculates the MD5 value of the test file read by librgw from the preset server according to the MD5 algorithm, obtains the read MD5 value, and obtains the upload MD5 value of the test file from the preset server.
- the uploaded MD5 value is the MD5 value calculated after the test file is generated, and the test file is uploaded to the preset server for storage together with the test file.
- the client compares the read MD5 value of the test file with the uploaded MD5 value to determine whether the two are the same. If they are not the same, it is determined that the test file read and write errors, and the current read and write status of the test file through librgw is recorded as a read and write error.
- test data includes request time, response time, and file name.
- test parameters include a designated number of threads, a test time, and/or a test request amount
- the designated number of threads is the total number of threads that call librgw simultaneously initiated during the read and write process
- the test time is the entire read and write process
- the total time of the test request is the total number of read and write requests in the entire read and write process
- the call librgw reads the test file corresponding to the test file size from the preset server according to the test parameters
- test parameter includes the test request amount and/or the test time
- test request amount and the test time are included, select one parameter from the test request amount and the test time as the current test parameter; or, if the test request amount or the test time is included Test time, the included test request amount or the test time is used as the current test parameter;
- test condition is the specified number of threads and the test time
- test condition is the specified number of threads and the test time
- librgw a number of separate threads for calling librgw corresponding to the specified number of threads
- the test file corresponding to the test file size is repeatedly read from the preset server, And write the test file into the storage space; or, when the test condition is the specified number of threads and the amount of test requests, simultaneously initiate a number of separate calls for librgw corresponding to the specified number of threads Thread, repeat the action of reading the test file corresponding to the size of the test file from the preset server and writing the test file into the storage space for a number corresponding to the test request amount, where all The test file carries a file prefix corresponding to the size of the test file.
- a smart test function is provided inside the client, and the user can independently choose whether to turn on the smart test function.
- the client receives the test instruction input by the user, it needs to first check whether the smart test function is currently enabled. If the client does not currently enable the smart test function, it needs to parse out all the parameter types in the current test parameters, and filter the parameter types in the test parameters. The client first judges whether the test parameter includes the test request amount. If the test request amount is included, the test request amount is selected as the parameter that needs to be used for this read and write test. No matter whether the test parameter has a test time or not, it will not use. If the test request volume is not included, it is necessary to determine whether the test parameter includes the test time.
- test time is not included, the test parameters of this read-write test are incomplete, the test cannot be performed, and this test fails. If the test time is included, select the test time to be a parameter that needs to be used for this read and write test, and further determine whether the test parameter includes the specified number of threads. Among them, the screening steps of test request amount and test time are in no particular order, but in a read and write test, only one test request amount or test time can be used, and cannot be selected at the same time.
- librgw filters out the test files corresponding to the size of the test file according to the file prefix of the file name of the test file. For example, in the test parameters, the test time is 10 minutes, the specified number of threads is 80, and the test file size is 4KB, then 80 threads that call librgw will be initiated at the same time, and 40 read requests and 40 write requests will be sent concurrently.
- the read rate is 4KB_ The test file at the beginning of the file prefix.
- librgw will automatically read the test files beginning with any prefix. For example, if the test instruction specifies the test time as 10 minutes, the number of threads is 80, and the test file size is not specified, the client will initiate 80 threads that call librgw at the same time, and concurrently send 40 read requests and 40 write requests.
- the preset server reads test files beginning with any number prefix, that is, mixed reading and writing tests of files of any size.
- step of judging whether the smart test function has been turned on it includes:
- S207 Simultaneously initiate a number of separate threads for calling librgw corresponding to the first preset number of threads, and read the test file corresponding to the test file size from the preset server within the preset unit time , And write the test file into the storage space to obtain a reference response time, where the reference response time is an average response time for librgw to read and write the test file within the preset unit time;
- a second preset number of threads is calculated according to the first preset rule and the first preset number of threads, so as to complete the action of calculating the second preset number of threads, where the second preset number of threads is The total number of threads that call librgw initiated simultaneously during the reading and writing process during the second smart test;
- S209 Simultaneously initiate a number of separate threads for calling librgw corresponding to the second preset number of threads, and read the test file corresponding to the size of the test file from the preset server within the preset unit time , And write the test file into the storage space to obtain the secondary response time to complete the action of reading and writing the test file;
- S2010 Determine whether the secondary response time is greater than the reference response time of a preset multiple, so as to complete the action of determining the response time;
- the client detects that the user has activated the smart test function, it will automatically call the first preset number of threads and the preset unit time.
- the first preset number of threads and the preset unit time can be set by the user to set specific values.
- the client simultaneously initiates the first preset thread several calls to librgw to read the test file corresponding to the size of the test file from the preset server, and write the test file to the client's hard disk, to get librgw to read and write the test within the preset unit time
- the average response time of the file which is the baseline response time.
- the second preset number of threads is calculated according to the first preset rule and the first preset number of threads, so as to complete the action of calculating the second preset number of threads.
- the average response time that is, the second response time, to complete the action of reading and writing test files.
- the first preset rule is specifically: setting the number of incrementing threads, and taking the sum of the number of incrementing threads and the number of first preset threads as the second preset number of threads; or setting the number of increments, setting the number of increments and the first preset Let the product of the number of threads be the second preset number of threads.
- the client compares the second response time with the reference response time of a preset multiple, and judges the magnitude relationship between the two to complete the action of judging the response time. If the secondary response time is greater than the reference time of the preset multiple, it is determined that this reading and writing test is over.
- the actions of calculating the second preset number of threads, reading and writing test files, and judging the response time are executed cyclically, until the current response time is greater than the reference multiple of the preset Response time.
- the current second preset thread number is used as the next first preset thread number.
- the method includes:
- S2013 Simultaneously initiate a number of threads for invoking librgw corresponding to the number of system threads, repeatedly read the test file corresponding to the size of the test file from the preset server within the test time, and combine the The test file is written to the storage space.
- the client when the client judges whether the test parameter includes the specified number of threads, if the test parameter does not include the specified number of threads, the client will automatically call the number of system threads preset by the user in order for the read and write test to proceed smoothly. Then, a number of system threads are initiated at the same time to call librgw, read the test file corresponding to the test file size from the preset server, and write the test file to the client's hard disk until the entire read and write time reaches the test time. stop. Further, if the client cannot detect the preset number of system threads, it will automatically output a reminder message to remind the user to enter the number of threads for this read and write test in time, so that the read and write test can proceed smoothly.
- the reminder information includes at least one thread number customized by the system for the user to choose, and after the user selects it, the read and write test is directly performed according to the selected thread number.
- the step of separately acquiring the read and write status of each time the librgw reads and writes the test file includes:
- S2014 Calculate the read MD5 value of the test file read and written by the librgw respectively, and obtain the uploaded MD5 value of the test file pre-stored in the preset service terminal;
- S2015 Determine whether the read MD5 value is the same as the uploaded MD5 value
- MD5 is a general data verification method.
- a character string that is, the MD5 value
- the MD5 value is generated, such as ajk280aidjfoiquporwej. If the data in the file changes, even if one character is changed, the MD5 value generated is not the same. Therefore, it is a reliable way to verify the downloaded file and the uploaded file based on the MD5 value.
- the client When the client generates the test file, it will generate the corresponding MD5 value, and when uploading the test file to the preset server, the MD5 value will be stored in the preset server along with the test file.
- the client calculates the MD5 value of the test file read by librgw from the preset server according to the MD5 algorithm, and obtains the read MD5 value. Then get the uploaded MD5 value of the test file from the preset server. Among them, the uploaded MD5 value is the MD5 value calculated after the test file is generated, and the test file is uploaded to the preset server for storage together with the test file.
- the client compares the read MD5 value of the test file with the uploaded MD5 value to determine whether the two are the same. If they are not the same, it is determined that the test file read and write errors, and the current read and write status of the test file through librgw is recorded as a read and write error. If they are the same, it is determined that the test file is read and written correctly, and the current read and write status of the test file through librgw is recorded as read and write correct.
- test information is composed of a plurality of groups of the test data and the read and write status, and each group of the test data and the read and write status is grouped with one read and write request, and the test data is divided into groups.
- step of outputting the read and write status as test information to the display interface includes:
- the test information obtained by the client after completing the read and write test is composed of multiple sets of test data and read and write status, and each read and write request is a set of data.
- the client uses the different parameter types and read and write status in each read and write request as the horizontal axis, and the test result in each read and write request as the vertical axis, and graphs each group of data to generate each read and write The requested bar chart.
- the graphed groups of test data are output to the client's display page, so that users/testers can intuitively compare the differences between the test data of each read and write test based on the bar graph of each group of data.
- step of receiving the test instruction it includes:
- S4 Acquire a new file instruction input by the user, where the new file instruction includes a specified file size and file type, and the file type is text, picture or audio;
- S5 Generate a random file according to the new file instruction, and note the file prefix corresponding to the specified file size in the file name of the random file, where the random file is a file composed of random data;
- the new file instruction includes specifying the file size and file type, and the file type is text, picture or audio.
- the client According to the new file instruction, the client generates a random file corresponding to the specified file size and file type.
- the specific generation steps are: when the file type is text, if the text is a random sequence text, the client will create the number 0-9, uppercase and lowercase letters of aZ, and "*", "& Interface (Document Interface) Specify the type of file and write random sequence text into it at the same time to generate a random text file of the specified file size.
- the client uses the jpg format and the configuration of the three primary colors RGB to randomly generate a set of points Color mark, such as (0,0,100,90,80), this point describes, the color of the point at (0,0) is (100,90,80), so fill the whole picture repeatedly, you get A picture with all random colors, because the size of the drawing board can be specified, so the size is also controllable.
- the file type is audio, because in computer analysis, the audio is a set of numbers, such as 123456 for do, ro, mi Etc., so the client can randomly generate a set of digital sequences, combine them, and output them into a binary file according to the format of Mp3, then you can get a random audio file of the specified file size.
- the client can remark in the file name of the random file with Specify a prefix with the same file size, and upload the random file after the remarks as a test file to the preset server, which completes the process of creating a new file.
- Preset delimiters such as " and " ⁇ ", a total of 93 characters, each Generate a set of random sequences at a time, for example, generate 0123abc for the first time... and generate iu8kh122 for the second time. In this way, it is spliced into a completely disordered string and generated as a random sequence text with a specified file size. The text generated in this way is completely disordered, and each file is different. If this article is a word and excel format file, use the Document published by Microsoft
- the performance test method of librgw provided in this embodiment, according to the test file size and test parameters input by the user, reads and writes the corresponding test file from the preset server through librgw, thereby testing all the tests that librgw reads and writes to the test file Information and output all test information graphically, so that developers can quickly get the relevant data of librgw in the process of reading and writing data, and complete the performance test for librgw.
- an embodiment of the present application also provides a librgw performance test device, which is used for multiple reading and writing tests of test files, and the test device includes:
- the receiving module 1 is configured to receive a test instruction, where the test instruction includes a test file size and test parameters;
- Read and write module 2 call librgw to read the test file corresponding to the size of the test file from the preset server according to the test parameters, write the test file into the storage space, and record each librgw pair The test data generated during the reading and writing of the test file, and the read and write status of each reading and writing of the test file by the librgw;
- the output module 3 is used to output each of the test data and the read/write status as test information to the display interface.
- the performance test device for librgw provided in this embodiment, according to the size of the test file and test parameters input by the user, reads and writes the corresponding test file from the preset server through librgw, thereby testing all the tests that librgw reads and writes to the test file Information and output all test information graphically, so that developers can quickly get the relevant data of librgw in the process of reading and writing data, and complete the performance test for librgw.
- an embodiment of the present application also provides a computer device.
- the computer device may be a server, and its internal structure may be as shown in FIG. 3.
- the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the computer designed processor is used to provide calculation and control capabilities.
- the memory of the computer device includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
- the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
- the database of the computer equipment is used to store test files and other data.
- the network interface of the computer device is used to communicate with an external terminal through a network connection.
- FIG. 3 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
- An embodiment of the present application further provides a computer-readable storage medium.
- the readable storage medium may be a volatile readable storage medium or a non-volatile readable storage medium on which computer-readable instructions are stored.
- the processes of the above-mentioned method embodiments are executed.
- the above are only the preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of this application description and drawings, or directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of this application.
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
本申请提供了一种librgw的性能测试方法、装置、计算机设备和计算机可读存储介质,涉及性能测试技术领域,方法包括:接收测试指令;调用librgw按照测试参数,分别从预设服务器读取与测试文件大小对应的测试文件,并将测试文件写入存储空间,记录测试数据和读写状态;将各测试数据和读写状态作为测试信息输出到显示界面。本申请根据用户输入的测试文件大小和测试参数,通过librgw从预设服务器读写对应的测试文件,从而测试出librgw对测试文件进行读写的所有测试信息,并将所有测试信息图形化后输出,从而使得开发人员可以快速得到librgw在读写数据过程中的相关数据,完成针对librgw的性能测试。
Description
本申请要求于2019年2月11日提交中国专利局、申请号为201910110284.2,发明名称为“librgw的性能测试方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及性能测试技术领域,特别涉及一种librgw的性能测试方法、装置和计算机设备。
Ceph是一种为优秀的性能、可靠性和可扩展性而设计的统一的、分布式文件系统,它提供了三种存储类型:块存储、文件存储和对象储存。其中,对象存储(云存储)是面向对象/文件的、海量的互联网存储,现有技术中ceph通过rgw(Rados Gateway)为互联网云服务提供商提供对象存储服务。客户端首先需要通过http请求rgw,再通过rgw访问Ceph。而我司开发了一种新的访问Ceph方式,在客户端中设置有librgw,在需要读取数据时,客户端需要通过JAVA程序来调用librgw直接访问ceph集群,从而读取ceph集群中的数据。其中,librgw为一个应用程序。由于librgw是一种对ceph的新访问方式,目前并没有针对librgw的性能测试方法,开发人员无法了解librgw在对ceph中的数据进行读写时的相关性能数据。
本申请的主要目的为提供一种librgw的性能测试方法、装置和计算机设备,旨在解决现有技术中没有针对librgw性能的测试方法的弊端。
为实现上述目的,本申请提供了一种librgw的性能测试方法,用于多次对测试文件的读取和写入测试,所述方法包括:
接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;
调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;
将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
本申请还提供了一种librgw的性能测试装置,用于多次对测试文件的读取和写入测试,所述测试装置包括:
接收模块,用于接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;
读写模块,调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;
输出模块,用于将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
本申请还提供一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器执行所述计算机程序时实现上述任一项所述方法的步骤。
本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法的步骤。
本申请中提供的一种librgw的性能测试方法、装置和计算机设备,根据用户输入的测试文件大小和测试参数,通过librgw从预设服务器读写对应的测试文件,从而测试出librgw对测试文件进行读写的所有测试信息,并将所有测试信息图形化后输出,从而使得开发人员可以快速得到librgw在读写数据过程中的相关数据,完成针对librgw的性能测试。
图1是本申请一实施例中librgw的性能测试方法步骤示意图;
图2是本申请一实施例中librgw的性能测试装置整体结构框图;
图3是本申请一实施例的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,本申请一实施例中提供了一种librgw的性能测试方法,用于多次对测试文件的读取和写入测试,所述方法包括:
S1:接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;
S2:调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;
S3:将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
本实施例中,客户端在创建数据后,需要将数据上传到ceph集群,即预设服务器中进行存储。客户端中设置有librgw,在需要读取数据时,客户端需要通过JAVA程序来调用librgw访问ceph集群,从而读取ceph集群中的数据,并将读取的数据写入客户端的硬盘中。其中,librgw为访问应用程序。客户端在做librgw的性能测试时,需要根据用户输入的测试指令进行相应的动作。其中,用户输入的测试指令中包括测试文件大小以及测试参数;测试文件大小为用于测试文件的存储占量大小,比如4KB、1MB等等;测试参数包括指定线程数、测试时间或测试请求量,指定线程数为读写过程中同时发起调用librgw的线程的总数量,测试时间为整个读写过程的总时间,测试请求量为整个读写过程中读写请求的总次数。客户端在接收到用户输入的测试指令后,通过预先构造的JAVA程序调用librgw,根据测试文件的文件名的前缀,筛选到与测试文件大小对应的测试文件。其中,测试文件在生成时,会在文件名中携带有与测试文件的文件大小一致的文件前缀。比如,测试文件A的文件大小为4KB,则测试文件A的文件名为4KB_测试文件A。Librgw在筛选到测试文件后,同时发起指定线程数个调用librgw的线程,从预设服务器中读取测试文件,并将测试文件写入客户端的硬盘中,直至整个读写用时达到测试时间则停止。或者,同时发起指定线程数个调用librgw的线程,从预设服务器中读取测试文件,并将测试文件写入客户端的硬盘中,直至整个读写请求的总数量达到测试请求量则停止。其中,测试时间和测试请求量在测试过程中只能任选其一进行,不能同时选中;一个读请求为一个请求量,一个写请求为一个请求量,因此一个读写请求为两个请求量。比如,测试请求量为80个,则在本次测试中总共有40个读请求和40个写请求。在librgw完成一个读写测试后,客户端根据MD5的算法计算librgw从预设服务器读取的测试文件的MD5值,得到读取MD5值,并从预设服务端获取测试文件的上传MD5值。其中,上传MD5值为测试文件生成后计算得到的MD5值,与将测试文件一起上传到预设服务器进行存储。客户端将测试文件的读取MD5值与上传MD5值进行比对,判断两者是否相同。若不相同,则判定测试文件读写错误,并记录当前次通过librgw读写测试文件的读写状态为读写错误。若相同,则判定测试文件读写正确,并记录当前次通过librgw读写测试文件的读写状态为读写正确。客户端将每一次librgw对测试文件的读取和写入过程中产生的测试数据和读写状态作为测试信息输出到客户端的显示界面。其中,测试数据包括请求时间,响应时间,文件名。
进一步的,所述测试参数包括指定线程数、测试时间和/或测试请求量,所述指定线程数为读写过程中同时发起的调用librgw的线程总数量,所述测试时间为整个读写过程的总时间,所述测试请求量为整个读写过程中读写请求的总次数,所述调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间的步骤,包括:
S201:判断是否已经开启智能测试功能;
S202:若没有开启智能测试功能,则判断所述测试参数中是否包含所述测试请求量和/或所述测试时间;
S203:若包含所述测试请求量和所述测试时间,则从所述测试请求量和所述测试时间中择一选择一个参数作为当前测试参数;或者,若包含所述测试请求量或所述测试时间,则将包含的所述测试请求量或所述测试时间作为所述当前测试参数;
S204:判断所述测试参数中是否包含所述指定线程数;
S205:若包含所述指定线程数,则将所述指定线程数和所述当前测试参数组合在一起作为测试条件进行测试,其中,当所述测试条件为所述指定线程数和所述测试时间的时候,在所述测试时间内,同时发起与所述指定线程数对应数量的用于调用librgw的单独线程,重复从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间;或者,当所述测试条件为所述指定线程数和所述测试请求量时,同时发起与所述指定线程对应数量的用于调用librgw的单独线程,重复与所述测试请求量对应数量的从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间的动作,其中,所述测试文件携带有与所述测试文件大小对应的文件前缀。
本实施例中,客户端内部设置有智能测试功能,该智能测试功能由用户自主选择是否开启。在客户端接收到用户输入的测试指令后,需要先检测当前是否已经开启智能测试功能。若客户端当前没有开启智能测试功能,则需要解析出当前的测试参数中的所有参数类型,并对测试参数中的参数类型进行筛选。客户端首先判断测试参数中是否包含有测试请求量,若包含有测试请求量,则选定测试请求量为本次读写测试需要使用的参数,不管测试参数中是否具有测试时间,都不再采用。若不包含有测试请求量,则需要判断测试参数中是否包含有测试时间。若不包含有测试时间,则本次读写测试的测试参数不完整,无法进行测试,本次测试失败。如果包含有测试时间,则选定测试时间为本次读写测试需要使用的参数,并进一步判断测试参数中是否包含有指定线程数。其中,测试请求量和测试时间的筛选步骤不分先后顺序,只是在一次读写测试中,测试请求量或测试时间只能使用一个,不能同时选中。如果包含有指定线程数,则同时发起指定线程数个调用librgw的线程,从预设服务器中读取与测试文件大小对应的测试文件,并将该测试文件写入客户端的硬盘中,直至整个读写用时达到测试时间则停止。其中,librgw根据测试文件的文件名的文件前缀,筛选到与测试文件大小对应的测试文件。比如,测试参数中测试时间为10分钟,指定线程数为80,测试文件大小为4KB,那么会同时发起80个调用librgw的线程,并发40个读请求和40个写请求,读取以4KB_文件前缀开头的测试文件。
进一步的,若测试指令中不包括指定文件大小,则librgw会自动读取以任意前缀开头的测试文件。比如,测试指令中指定了测试时间为10分钟,指定线程数为80,不指定测试文件大小,那么客户端会同时发起80个调用librgw的线程,并发40个读请求和40个写请求,从预设服务器读取以任意数字前缀开头的测试文件,也就是混合读写任意大小文件的测试。
进一步的,所述判断是否已经开启智能测试功能的步骤之后,包括:
S206:若已经开启智能测试功能,则调用第一预设线程数和预设单位时间,其中,所述第一预设线程数为初次智能测试时读写过程中同时发起的调用librgw的线程总数量,所述预设单位时间为智能测试时整个读写过程的总时间;
S207:同时发起与所述第一预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从所述预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到基准响应时间,其中,所述基准响应时间为librgw在所述预设单位时间内读写所述测试文件的平均响应时间;
S208:根据第一预设规则和所述第一预设线程数计算得到第二预设线程数,以完成计算所述第二预设线程数动作,其中,所述第二预设线程数为二次智能测试时读写过程中同时发起的调用librgw的线程总数量;
S209:同时发起与所述第二预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从所述预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到二次响应时间,以完成读写所述测试文件动作;
S2010:判断所述二次响应时间是否大于预设倍数的所述基准响应时间,以完成判断响应时间动作;
S2011:若小于预设倍数的所述基准响应时间,则循环执行所述计算所述第二预设线程数动作、所述读写所述测试文件动作和所述判断响应时间动作,直至当前次得到的响应时间大于预设倍数的所述基准响应时间,其中,在循环过程中,当前次的第二预设线程数作为下一次的第一预设线程数。
本实施例中,用户如果在客户端开启了智能测试功能,则在输入测试指令时,只需要设定测试时间和测试文件大小。客户端如果检测到用户开启了智能测试功能,则自动调取第一预设线程数和预设单位时间。其中,第一预设线程数和预设单位时间可以由用户自己设置具体的数值。客户端同时发起第一预设线程数个调用librgw从预设服务器读取与测试文件大小对应的测试文件,并将测试文件写入客户端的硬盘中,得到librgw在预设单位时间内读写测试文件的平均响应时间,即基准响应时间。然后,根据第一预设规则和第一预设线程数计算得到第二预设线程数,以完成计算第二预设线程数动作。并发起第二预设线程数个调用librgw从预设服务器读取与测试文件大小对应的测试文件,并将测试文件写入客户端的硬盘中,得到librgw在预设单位时间内读写测试文件的平均响应时间,即二次响应时间,以完成读写测试文件动作。其中,第一预设规则具体为:设置有递增线程数,将递增线程数和第一预设线程数的和作为第二预设线程数;或者设置有递增倍数,将递增倍数和第一预设线程数的积作为第二预设线程数。客户端将二次响应时间与预设倍数的基准响应时间进行比对,判断两者之间的大小关系,以完成判断响应时间动作。若二次响应时间大于预设倍数的基准时间,则判定此次的读写测试结束。若二次响应时间小于预设倍数的基准响应时间,则循环执行计算第二预设线程数动作、读写测试文件动作和判断响应时间动作,直至当前次得到的响应时间大于预设倍数的基准响应时间。其中,在循环过程中,当前次的第二预设线程数作为下一次的第一预设线程数。
进一步的,所述判断所述测试参数中是否包含所述指定线程数的步骤之后,包括:
S2012:若不包含所述指定线程数,则调取预先设置的系统线程数;
S2013:同时发起与所述系统线程数对应数量的用于调用librgw的线程,在所述测试时间内重复从所述预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间。
本实施例中,客户端在判断测试参数是否包含指定线程数时,如果测试参数中没有包含指定线程数,为了读写测试能够顺利进行,客户端会自动调取用户预先设置的系统线程数。然后,同时发起系统线程数个调用librgw的线程,从预设服务器中读取与测试文件大小对应的测试文件,并将该测试文件写入客户端的硬盘中,直至整个读写用时达到测试时间则停止。进一步的,客户端如果检测不到预先设置的系统线程数,会自动输出提醒信息,提醒用户及时输入本次读写测试的线程数,以使读写测试可以顺利进行。其中,提醒信息包含系统自定义的至少一个线程数,以供用户选择,并在用户选中后直接根据该选择的线程数进行读写测试。
进一步的,所述分别获取每一次所述librgw读取和写入所述测试文件的读写状态的步骤,包括:
S2014:分别计算所述librgw读取和写入的所述测试文件的读取MD5值,并获取预先存储在所述预设服务终端的所述测试文件的上传MD5值;
S2015:判断所述读取MD5值与所述上传MD5值是否相同;
S2016:若相同,则判定所述librgw读取和写入所述测试文件的读写状态为读写正确;
S2017:若不相同,则判定所述librgw读取和写入所述测试文件的读写状态为读写错误。
本实施例中,MD5是一种通用的数据校验方法,根据MD5的算法,会生成一个字符串,即MD5值,比如:ajk280aidjfoiquporwej。如果文件中的数据有变化,哪怕变了一个字符,那么生成的MD5值也是不相同的,所以根据MD5值来验证下载的文件和上传的文件是种可靠的方式。客户端在生成测试文件时,会生成相应的MD5值,并在将测试文件上传到预设服务器时,将MD5值随同测试文件一起存储在预设服务器中。在完成读写测试后,客户端根据MD5的算法计算librgw从预设服务器读取的测试文件的MD5值,得到读取MD5值。然后从预设服务端获取测试文件的上传MD5值。其中,上传MD5值为测试文件生成后计算得到的MD5值,与将测试文件一起上传到预设服务器进行存储。客户端将测试文件的读取MD5值与上传MD5值进行比对,判断两者是否相同。若不相同,则判定测试文件读写错误,并记录当前次通过librgw读写测试文件的读写状态为读写错误。若相同,则判定测试文件读写正确,并记录当前次通过librgw读写测试文件的读写状态为读写正确。
进一步的,所述测试信息由多组所述测试数据和所述读写状态组成,各组所述测试数据和所述读写状态以一次读写请求进行分组,所述将各所述测试数据和所述读写状态作为测试信息输出到显示界面的步骤,包括:
S301:分别将各所述测试数据和所述读写状态按照数据类型进行图表化,生成所述测试信息;
S302:将所述测试信息输出到显示界面。
本实施例中,客户端在完成读写测试后得到的测试信息是由多组测试数据和读写状态组成的,以每一次读写请求为一组数据。客户端以每次读写请求中不同的参数类型和读写状态为坐标横轴,以每次读写请求中的测试结果为坐标竖轴,将各组数据进行图表化,生成每次读写请求的柱形图。最后,将图表化后的各组测试数据输出到客户端的显示页面,以便用户/测试人员可以直观根据各组数据的柱形图比对出各次读写测试的测试数据之间的差别。
进一步的,所述接收测试指令的步骤之前,包括:
S4:获取用户输入的新建文件指令,其中,所述新建文件指令包括指定文件大小和文件类型,所述文件类型为文本、图片或音频;
S5:根据所述新建文件指令生成随机文件,并在所述随机文件的文件名备注与所述指定文件大小对应的文件前缀,其中,所述随机文件为由随机数据组成的文件;
S6:将备注后的所述随机文件作为测试文件上传到所述预设服务器。
本实施例中,用户在需要创建新文件时,需要输入新建文件指令到客户端中。其中,新建文件指令包括指定文件大小和文件类型,文件类型为文本、图片或音频。客户端根据新建文件指令,生成与指定文件大小和文件类型均对应的随机文件。其中,具体生成步骤为:当文件类型为文本时,如果文本为随机序列文本,客户端则将0-9的数字和a-Z的大小写字母以及“*”、“&接口(Document Interface),创建指定类型的文件,同时向其中写入随机序列文字,即可生成指定文件大小的随机文本文件。如果文件类型为图片时,客户端采用按照jpg格式,按照三原色RGB的配置,随机生成一组点颜色标,例如(0,0,100,90,80),这个点就描述,(0,0)这个位置上的点颜色为(100,90,80),如此反复填充整张图片,则得到一张全部是随机色的图片,因为可以指定画板的大小,所以大小也是可控的。如果文件类型为音频,因为在电脑解析中,音频是一组数字序列,比如123456代表do,ro,mi等,所以客户端可以随机生成一组数字序列,并将其组合起来,按照Mp3的格式输出成二进制文件,即可得到指定文件大小的随机音频文件。客户端在随机文件的文件名中备注与指定文件大小相同的前缀,并将备注后的随机文件作为测试文件上传到预设服务器,即完成整个创建新文件的过程。 ”、“^”等预置分隔符号,共计93种字符,采用每次生成一组随机序列,例如,第一次生成0123abc....第二次生成iu8kh122,这种方式拼接成完全无序的字符串,生成为指定文件大小的随机序列文本。这种方式生成的文本完全无序,并且每个文件均不相同。如果本文为word和excel格式文件,则采用微软公布的Document
本实施例提供的一种librgw的性能测试方法,根据用户输入的测试文件大小和测试参数,通过librgw从预设服务器读写对应的测试文件,从而测试出librgw对测试文件进行读写的所有测试信息,并将所有测试信息图形化后输出,从而使得开发人员可以快速得到librgw在读写数据过程中的相关数据,完成针对librgw的性能测试。
参照图2,本申请一实施例中还提供了一种librgw的性能测试装置,用于多次对测试文件的读取和写入测试,所述测试装置包括:
接收模块1,用于接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;
读写模块2,调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;
输出模块3,用于将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
本实施例中,测试装置各模块、单元的实施例与上述对应的方法步骤一致,在此不作详述。
本实施例提供的一种librgw的性能测试装置,根据用户输入的测试文件大小和测试参数,通过librgw从预设服务器读写对应的测试文件,从而测试出librgw对测试文件进行读写的所有测试信息,并将所有测试信息图形化后输出,从而使得开发人员可以快速得到librgw在读写数据过程中的相关数据,完成针对librgw的性能测试。
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储测试文件等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时执行如上述各方法的实施例的流程。本领域技术人员可以理解,图3中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。
本申请一实施例还提供一种计算机可读存储介质,该可读存储介质可以是易失性可读存储介质,也可以是非易失性可读存储介质,其上存储有计算机可读指令,计算机可读指令被处理器执行时,执行如上述各方法的实施例的流程。以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
Claims (20)
- 一种librgw的性能测试方法,用于多次对测试文件的读取和写入测试,其特征在于,所述librgw为访问应用程序,所述方法包括:接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
- 根据权利要求1所述的librgw的性能测试方法,其特征在于,所述测试参数包括指定线程数、测试时间和/或测试请求量,所述指定线程数为读写过程中同时发起的调用librgw的线程总数量,所述测试时间为整个读写过程的总时间,所述测试请求量为整个读写过程中读写请求的总次数,所述调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间的步骤,包括:判断是否已经开启智能测试功能;若没有开启智能测试功能,则判断所述测试参数中是否包含所述测试请求量和/或所述测试时间;若包含所述测试请求量和所述测试时间,则从所述测试请求量和所述测试时间中择一选择一个参数作为当前测试参数;或者,若包含所述测试请求量或所述测试时间,则将包含的所述测试请求量或所述测试时间作为所述当前测试参数;判断所述测试参数中是否包含所述指定线程数;若包含所述指定线程数,则将所述指定线程数和所述当前测试参数组合在一起作为测试条件进行测试,其中,当所述测试条件为所述指定线程数和所述测试时间的时候,在所述测试时间内,同时发起与所述指定线程数对应数量的用于调用librgw的单独线程,重复从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间;或者,当所述测试条件为所述指定线程数和所述测试请求量时,同时发起与所述指定线程对应数量的用于调用librgw的单独线程,重复与所述测试请求量对应数量的从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间的动作,其中,所述测试文件携带有与所述测试文件大小对应的文件前缀。
- 根据权利要求2所述的librgw的性能测试方法,其特征在于,所述判断是否已经开启智能测试功能的步骤之后,包括:若已经开启智能测试功能,则调用第一预设线程数和预设单位时间,其中,所述第一预设线程数为初次智能测试时读写过程中同时发起的调用librgw的线程总数量,所述预设单位时间为智能测试时整个读写过程的总时间;同时发起与所述第一预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到基准响应时间,其中,所述基准响应时间为librgw在所述预设单位时间内读写所述测试文件的平均响应时间;根据第一预设规则和所述第一预设线程数计算得到第二预设线程数,以完成计算所述第二预设线程数动作,其中,所述第二预设线程数为二次智能测试时读写过程中同时发起的调用librgw的线程总数量;同时发起与所述第二预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到二次响应时间,以完成读写所述测试文件动作;判断所述二次响应时间是否大于预设倍数的所述基准响应时间,以完成判断响应时间动作;若小于预设倍数的所述基准响应时间,则循环执行所述计算所述第二预设线程数动作、所述读写所述测试文件动作和所述判断响应时间动作,直至当前次得到的响应时间大于预设倍数的所述基准响应时间,其中,在循环过程中,当前次的第二预设线程数作为下一次的第一预设线程数。
- 根据权利要求2所述的librgw的性能测试方法,其特征在于,所述判断所述测试参数中是否包含所述指定线程数的步骤之后,包括:若不包含所述指定线程数,则调取预先设置的系统线程数;同时发起与所述系统线程数对应数量的用于调用librgw的线程,在所述测试时间内重复从所述预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间。
- 根据权利要求1所述的librgw的性能测试方法,其特征在于,所述分别获取每一次所述librgw读取和写入所述测试文件的读写状态的步骤,包括:分别计算所述librgw读取和写入的所述测试文件的读取MD5值,并获取预先存储在所述预设服务终端的所述测试文件的上传MD5值;判断所述读取MD5值与所述上传MD5值是否相同;若相同,则判定所述librgw读取和写入所述测试文件的读写状态为读写正确;若不相同,则判定所述librgw读取和写入所述测试文件的读写状态为读写错误。
- 根据权利要求1所述的librgw的性能测试方法,其特征在于,所述测试信息由多组所述测试数据和所述读写状态组成,各组所述测试数据和所述读写状态以一次读写请求进行分组,所述将各所述测试数据和所述读写状态作为测试信息输出到显示界面的步骤,包括:分别将各所述测试数据和各所述读写状态按照数据类型进行图表化,生成所述测试信息;将所述测试信息输出到显示界面。
- 根据权利要求1所述的librgw的性能测试方法,其特征在于,所述接收测试指令的步骤之前,包括:获取用户输入的新建文件指令,其中,所述新建文件指令包括指定文件大小和文件类型,所述文件类型为文本、图片或音频;根据所述新建文件指令生成随机文件,并在所述随机文件的文件名备注与所述指定文件大小对应的文件前缀,其中,所述随机文件为由随机数据组成的文件;将备注后的所述随机文件作为测试文件上传到所述预设服务器。
- 一种librgw的性能测试装置,用于多次对测试文件的读取和写入测试,其特征在于,包括:接收模块,用于接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;读写模块,调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;输出模块,用于将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
- 根据权利要求8所述的librgw的性能测试装置,其特征在于,所述测试参数包括指定线程数、测试时间和/或测试请求量,所述指定线程数为读写过程中同时发起的调用librgw的线程总数量,所述测试时间为整个读写过程的总时间,所述测试请求量为整个读写过程中读写请求的总次数,所述读写模块,包括:第一判断单元,用于判断是否已经开启智能测试功能;第二判断单元,用于判断所述测试参数中是否包含所述测试请求量和/或所述测试时间;选择单元,用于从所述测试请求量和所述测试时间中择一选择一个参数作为当前测试参数;或者,若包含所述测试请求量或所述测试时间,则将包含的所述测试请求量或所述测试时间作为所述当前测试参数;第三判断单元,用于判断所述测试参数中是否包含所述指定线程数;第一读写单元,用于将所述指定线程数和所述当前测试参数组合在一起作为测试条件进行测试,其中,当所述测试条件为所述指定线程数和所述测试时间的时候,在所述测试时间内,同时发起与所述指定线程数对应数量的用于调用librgw的单独线程,重复从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间;或者,当所述测试条件为所述指定线程数和所述测试请求量时,同时发起与所述指定线程对应数量的用于调用librgw的单独线程,重复与所述测试请求量对应数量的从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间的动作,其中,所述测试文件携带有与所述测试文件大小对应的文件前缀。
- 根据权利要求9所述的librgw的性能测试装置,其特征在于,所述读写模块,还包括:调用单元,用于调用第一预设线程数和预设单位时间,其中,所述第一预设线程数为初次智能测试时读写过程中同时发起的调用librgw的线程总数量,所述预设单位时间为智能测试时整个读写过程的总时间;第二读写单元,用于同时发起与所述第一预设线程数对应数量的用于调用librgw的单独线程,从所述预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到基准响应时间,其中,所述基准响应时间为librgw在所述预设单位时间内读写所述测试文件的平均响应时间;第一计算单元,用于根据第一预设规则和所述第一预设线程数计算得到第二预设线程数,以完成计算所述第二预设线程数动作,其中,所述第二预设线程数为二次智能测试时读写过程中同时发起的调用librgw的线程总数量;第三读写单元,用于同时发起与所述第二预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从所述预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到二次响应时间,以完成读写所述测试文件动作;第四判断单元,用于判断所述二次响应时间是否大于预设倍数的所述基准响应时间,以完成判断响应时间动作;循环单元,用于循环执行所述计算所述第二预设线程数动作、所述读写所述测试文件动作和所述判断响应时间动作,直至当前次得到的响应时间大于预设倍数的所述基准响应时间,其中,在循环过程中,当前次的第二预设线程数作为下一次的第一预设线程数。
- 根据权利要求9所述的librgw的性能测试装置,其特征在于,所述读写模块,还包括:调取单元,用于调取预先设置的系统线程数;发起单元,用于同时发起与所述系统线程数对应数量的用于调用librgw的线程,在所述测试时间内重复从所述预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间。
- 根据权利要求8所述的librgw的性能测试装置,其特征在于,所述读写模块,还包括:第二计算单元,用于分别计算所述librgw读取和写入的所述测试文件的读取MD5值,并获取预先存储在所述预设服务终端的所述测试文件的上传MD5值;第五判断单元,用于判断所述读取MD5值与所述上传MD5值是否相同;第一判定单元,用于判定所述librgw读取和写入所述测试文件的读写状态为读写正确;第二判定单元,用于判定所述librgw读取和写入所述测试文件的读写状态为读写错误。
- 根据权利要求8所述的,librgw的性能测试装置,其特征在于,所述测试信息由多组所述测试数据和所述读写状态组成,各组所述测试数据和所述读写状态以一次读写请求进行分组,所述输出模块,包括:生成单元,用于分别将各所述测试数据和各所述读写状态按照数据类型进行图表化,生成所述测试信息;输出单元,用于将所述测试信息输出到显示界面。
- 根据权利要求8所述的librgw的性能测试装置,其特征在于,所述测试装置,还包括:获取模块,用于获取用户输入的新建文件指令,其中,所述新建文件指令包括指定文件大小和文件类型,所述文件类型为文本、图片或音频;生成模块,用于根据所述新建文件指令生成随机文件,并在所述随机文件的文件名备注与所述指定文件大小对应的文件前缀,其中,所述随机文件为由随机数据组成的文件;上传模块,用于将备注后的所述随机文件作为测试文件上传到所述预设服务器。
- 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,其特征在于,所述处理器执行时实现librgw的性能测试方法,所述librgw为访问应用程序,该性能测试方法包括:接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
- 根据权利要求15所述的计算机设备,其特征在于,所述测试参数包括指定线程数、测试时间和/或测试请求量,所述指定线程数为读写过程中同时发起的调用librgw的线程总数量,所述测试时间为整个读写过程的总时间,所述测试请求量为整个读写过程中读写请求的总次数;所述处理器执行所述调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间的步骤,包括:判断是否已经开启智能测试功能;若没有开启智能测试功能,则判断所述测试参数中是否包含所述测试请求量和/或所述测试时间;若包含所述测试请求量和所述测试时间,则从所述测试请求量和所述测试时间中择一选择一个参数作为当前测试参数;或者,若包含所述测试请求量或所述测试时间,则将包含的所述测试请求量或所述测试时间作为所述当前测试参数;判断所述测试参数中是否包含所述指定线程数;若包含所述指定线程数,则将所述指定线程数和所述当前测试参数组合在一起作为测试条件进行测试,其中,当所述测试条件为所述指定线程数和所述测试时间的时候,在所述测试时间内,同时发起与所述指定线程数对应数量的用于调用librgw的单独线程,重复从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间;或者,当所述测试条件为所述指定线程数和所述测试请求量时,同时发起与所述指定线程对应数量的用于调用librgw的单独线程,重复与所述测试请求量对应数量的从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间的动作,其中,所述测试文件携带有与所述测试文件大小对应的文件前缀。
- 根据权利要求16所述的计算机设备,其特征在于,所述处理器执行所述判断是否已经开启智能测试功能的步骤之后,包括:若已经开启智能测试功能,则调用第一预设线程数和预设单位时间,其中,所述第一预设线程数为初次智能测试时读写过程中同时发起的调用librgw的线程总数量,所述预设单位时间为智能测试时整个读写过程的总时间;同时发起与所述第一预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到基准响应时间,其中,所述基准响应时间为librgw在所述预设单位时间内读写所述测试文件的平均响应时间;根据第一预设规则和所述第一预设线程数计算得到第二预设线程数,以完成计算所述第二预设线程数动作,其中,所述第二预设线程数为二次智能测试时读写过程中同时发起的调用librgw的线程总数量;同时发起与所述第二预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到二次响应时间,以完成读写所述测试文件动作;判断所述二次响应时间是否大于预设倍数的所述基准响应时间,以完成判断响应时间动作;若小于预设倍数的所述基准响应时间,则循环执行所述计算所述第二预设线程数动作、所述读写所述测试文件动作和所述判断响应时间动作,直至当前次得到的响应时间大于预设倍数的所述基准响应时间,其中,在循环过程中,当前次的第二预设线程数作为下一次的第一预设线程数。
- 一种计算机可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现librgw的性能测试方法,所述librgw为访问应用程序,该性能测试方法包括:接收测试指令,其中,所述测试指令包括测试文件大小和测试参数;调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,并记录每一次所述librgw对所述测试文件的读取和写入过程中产生的测试数据,以及分别获取每一次所述librgw读取和写入所述测试文件的读写状态;将各所述测试数据和所述读写状态作为测试信息输出到显示界面。
- 根据权利要求18所述的计算机可读存储介质,其特征在于,所述测试参数包括指定线程数、测试时间和/或测试请求量,所述指定线程数为读写过程中同时发起的调用librgw的线程总数量,所述测试时间为整个读写过程的总时间,所述测试请求量为整个读写过程中读写请求的总次数;所述处理器执行所述调用librgw按照所述测试参数,分别从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间的步骤,包括:判断是否已经开启智能测试功能;若没有开启智能测试功能,则判断所述测试参数中是否包含所述测试请求量和/或所述测试时间;若包含所述测试请求量和所述测试时间,则从所述测试请求量和所述测试时间中择一选择一个参数作为当前测试参数;或者,若包含所述测试请求量或所述测试时间,则将包含的所述测试请求量或所述测试时间作为所述当前测试参数;判断所述测试参数中是否包含所述指定线程数;若包含所述指定线程数,则将所述指定线程数和所述当前测试参数组合在一起作为测试条件进行测试,其中,当所述测试条件为所述指定线程数和所述测试时间的时候,在所述测试时间内,同时发起与所述指定线程数对应数量的用于调用librgw的单独线程,重复从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间;或者,当所述测试条件为所述指定线程数和所述测试请求量时,同时发起与所述指定线程对应数量的用于调用librgw的单独线程,重复与所述测试请求量对应数量的从所述预设服务器读取所述测试文件大小对应的所述测试文件,并将所述测试文件写入所述存储空间的动作,其中,所述测试文件携带有与所述测试文件大小对应的文件前缀。
- 根据权利要求19所述的计算机可读存储介质,其特征在于,所述处理器执行所述判断是否已经开启智能测试功能的步骤之后,包括:若已经开启智能测试功能,则调用第一预设线程数和预设单位时间,其中,所述第一预设线程数为初次智能测试时读写过程中同时发起的调用librgw的线程总数量,所述预设单位时间为智能测试时整个读写过程的总时间;同时发起与所述第一预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到基准响应时间,其中,所述基准响应时间为librgw在所述预设单位时间内读写所述测试文件的平均响应时间;根据第一预设规则和所述第一预设线程数计算得到第二预设线程数,以完成计算所述第二预设线程数动作,其中,所述第二预设线程数为二次智能测试时读写过程中同时发起的调用librgw的线程总数量;同时发起与所述第二预设线程数对应数量的用于调用librgw的单独线程,在所述预设单位时间内从预设服务器读取与所述测试文件大小对应的测试文件,并将所述测试文件写入存储空间,得到二次响应时间,以完成读写所述测试文件动作;判断所述二次响应时间是否大于预设倍数的所述基准响应时间,以完成判断响应时间动作;若小于预设倍数的所述基准响应时间,则循环执行所述计算所述第二预设线程数动作、所述读写所述测试文件动作和所述判断响应时间动作,直至当前次得到的响应时间大于预设倍数的所述基准响应时间,其中,在循环过程中,当前次的第二预设线程数作为下一次的第一预设线程数。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910110284.2A CN109976957B (zh) | 2019-02-11 | 2019-02-11 | librgw的性能测试方法、装置和计算机设备 |
| CN201910110284.2 | 2019-02-11 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020164263A1 true WO2020164263A1 (zh) | 2020-08-20 |
Family
ID=67076908
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/116336 Ceased WO2020164263A1 (zh) | 2019-02-11 | 2019-11-07 | librgw的性能测试方法、装置和计算机设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109976957B (zh) |
| WO (1) | WO2020164263A1 (zh) |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113094278A (zh) * | 2021-04-23 | 2021-07-09 | Tcl通讯(宁波)有限公司 | 移动终端的调试方法、装置、设备和计算机可读存储介质 |
| CN113312255A (zh) * | 2021-04-21 | 2021-08-27 | 深圳市沃特沃德信息有限公司 | 移动设备外设部件的参数测试方法和装置 |
| CN113806192A (zh) * | 2021-08-19 | 2021-12-17 | 济南浪潮数据技术有限公司 | 一种图片云存储性能测试方法、装置、终端及存储介质 |
| CN114297009A (zh) * | 2021-12-28 | 2022-04-08 | 苏州浪潮智能科技有限公司 | 一种服务器测试的方法及装置、电子设备 |
| CN114741293A (zh) * | 2022-04-02 | 2022-07-12 | 浙江中控技术股份有限公司 | 一种工业控制系统的Modbus通信自动化测试方法 |
| CN115407385A (zh) * | 2022-07-21 | 2022-11-29 | 上海轩田工业设备有限公司 | 一种电推进束流的多点自动测试方法及系统 |
| CN115966247A (zh) * | 2022-12-14 | 2023-04-14 | 武汉麓谷科技有限公司 | 一种zns固态硬盘性能测试方法 |
| CN116684913A (zh) * | 2023-06-25 | 2023-09-01 | 上海移柯通信技术股份有限公司 | 4g通信模组的测试方法、系统、电子设备及存储介质 |
| CN118612095A (zh) * | 2024-07-31 | 2024-09-06 | 浙江中控研究院有限公司 | 基于can总线的io模块量程可视化配置方法及系统 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109976957B (zh) * | 2019-02-11 | 2022-04-15 | 平安科技(深圳)有限公司 | librgw的性能测试方法、装置和计算机设备 |
| CN115658450B (zh) * | 2022-10-20 | 2023-05-16 | 广州思智时代科技有限公司 | 一种软件测试系统 |
| CN116521465B (zh) * | 2023-06-26 | 2023-10-13 | 深圳市晶存科技有限公司 | 硬盘测试数据处理方法、装置及介质 |
| CN120196529B (zh) * | 2025-05-26 | 2025-07-29 | 西安热工研究院有限公司 | 一种静态可信保护文件的性能测试方法及相关装置 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8732343B1 (en) * | 2009-12-16 | 2014-05-20 | Symantec Corporation | Systems and methods for creating dataless storage systems for testing software systems |
| CN106685747A (zh) * | 2015-11-05 | 2017-05-17 | 北京出入境检验检疫局检验检疫技术中心 | 一种云存储均衡性能测试系统 |
| CN107480039A (zh) * | 2017-09-22 | 2017-12-15 | 郑州云海信息技术有限公司 | 一种分布式存储系统的小文件读写性能测试方法及装置 |
| US20180165323A1 (en) * | 2016-12-09 | 2018-06-14 | EMC IP Holding Company LLC | Data set verification |
| CN108733525A (zh) * | 2018-06-07 | 2018-11-02 | 郑州云海信息技术有限公司 | 一种存储模块自动测试并校验正确性的方法及系统 |
| CN109976957A (zh) * | 2019-02-11 | 2019-07-05 | 平安科技(深圳)有限公司 | librgw的性能测试方法、装置和计算机设备 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101211294A (zh) * | 2006-12-26 | 2008-07-02 | 环达电脑(上海)有限公司 | 显示内存测试系统及方法 |
| TW201232253A (en) * | 2011-01-24 | 2012-08-01 | Hon Hai Prec Ind Co Ltd | System and method for arranging test data |
| CN108009071B (zh) * | 2017-12-05 | 2020-10-20 | 苏州浪潮智能科技有限公司 | Hadoop集群测试的方法 |
-
2019
- 2019-02-11 CN CN201910110284.2A patent/CN109976957B/zh active Active
- 2019-11-07 WO PCT/CN2019/116336 patent/WO2020164263A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8732343B1 (en) * | 2009-12-16 | 2014-05-20 | Symantec Corporation | Systems and methods for creating dataless storage systems for testing software systems |
| CN106685747A (zh) * | 2015-11-05 | 2017-05-17 | 北京出入境检验检疫局检验检疫技术中心 | 一种云存储均衡性能测试系统 |
| US20180165323A1 (en) * | 2016-12-09 | 2018-06-14 | EMC IP Holding Company LLC | Data set verification |
| CN107480039A (zh) * | 2017-09-22 | 2017-12-15 | 郑州云海信息技术有限公司 | 一种分布式存储系统的小文件读写性能测试方法及装置 |
| CN108733525A (zh) * | 2018-06-07 | 2018-11-02 | 郑州云海信息技术有限公司 | 一种存储模块自动测试并校验正确性的方法及系统 |
| CN109976957A (zh) * | 2019-02-11 | 2019-07-05 | 平安科技(深圳)有限公司 | librgw的性能测试方法、装置和计算机设备 |
Cited By (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113312255A (zh) * | 2021-04-21 | 2021-08-27 | 深圳市沃特沃德信息有限公司 | 移动设备外设部件的参数测试方法和装置 |
| CN113312255B (zh) * | 2021-04-21 | 2024-08-06 | 深圳市沃特沃德信息有限公司 | 移动设备外设部件的参数测试方法和装置 |
| CN113094278B (zh) * | 2021-04-23 | 2024-01-02 | 光环云数据有限公司 | 移动终端的调试方法、装置、设备和计算机可读存储介质 |
| CN113094278A (zh) * | 2021-04-23 | 2021-07-09 | Tcl通讯(宁波)有限公司 | 移动终端的调试方法、装置、设备和计算机可读存储介质 |
| CN113806192A (zh) * | 2021-08-19 | 2021-12-17 | 济南浪潮数据技术有限公司 | 一种图片云存储性能测试方法、装置、终端及存储介质 |
| CN114297009A (zh) * | 2021-12-28 | 2022-04-08 | 苏州浪潮智能科技有限公司 | 一种服务器测试的方法及装置、电子设备 |
| CN114297009B (zh) * | 2021-12-28 | 2024-01-16 | 苏州浪潮智能科技有限公司 | 一种服务器测试的方法及装置、电子设备 |
| CN114741293A (zh) * | 2022-04-02 | 2022-07-12 | 浙江中控技术股份有限公司 | 一种工业控制系统的Modbus通信自动化测试方法 |
| CN114741293B (zh) * | 2022-04-02 | 2024-07-23 | 浙江中控技术股份有限公司 | 一种工业控制系统的Modbus通信自动化测试方法 |
| CN115407385B (zh) * | 2022-07-21 | 2024-03-08 | 上海轩田智能科技股份有限公司 | 一种电推进束流的多点自动测试方法及系统 |
| CN115407385A (zh) * | 2022-07-21 | 2022-11-29 | 上海轩田工业设备有限公司 | 一种电推进束流的多点自动测试方法及系统 |
| CN115966247B (zh) * | 2022-12-14 | 2023-08-22 | 武汉麓谷科技有限公司 | 一种zns固态硬盘性能测试方法 |
| CN115966247A (zh) * | 2022-12-14 | 2023-04-14 | 武汉麓谷科技有限公司 | 一种zns固态硬盘性能测试方法 |
| CN116684913A (zh) * | 2023-06-25 | 2023-09-01 | 上海移柯通信技术股份有限公司 | 4g通信模组的测试方法、系统、电子设备及存储介质 |
| CN116684913B (zh) * | 2023-06-25 | 2024-02-13 | 上海移柯通信技术股份有限公司 | 4g通信模组的测试方法、系统、电子设备及存储介质 |
| CN118612095A (zh) * | 2024-07-31 | 2024-09-06 | 浙江中控研究院有限公司 | 基于can总线的io模块量程可视化配置方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109976957B (zh) | 2022-04-15 |
| CN109976957A (zh) | 2019-07-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020164263A1 (zh) | librgw的性能测试方法、装置和计算机设备 | |
| CN108595597A (zh) | 数据导入方法、装置、计算机设备和存储介质 | |
| CN110022315B (zh) | 一种块链式账本中的权重管理方法、装置及设备 | |
| CN109033150A (zh) | 敏感词验证方法、装置、计算机设备及存储介质 | |
| US11706164B2 (en) | Graph-based natural language generation for conversational systems | |
| CN110209569A (zh) | 接口测试方法、接口测试装置及存储介质 | |
| CN105740057A (zh) | 一种信息处理方法与设备 | |
| CN110147685A (zh) | 数据验证方法、系统、装置及设备 | |
| TWI762851B (zh) | 塊鏈式帳本中的資料驗證方法、系統、裝置及設備 | |
| CN108073429A (zh) | 一种支付方式配置方法、装置、设备及存储介质 | |
| CN113986747A (zh) | 一种数据生成方法、装置、电子设备及存储介质 | |
| CN115270196A (zh) | 接口数据过滤方法、装置、计算机设备及可读存储介质 | |
| CN109614271A (zh) | 多个集群数据一致性的控制方法、装置、设备及存储介质 | |
| CN109324958A (zh) | 一种rest统一校验方法、装置、设备及可读存储介质 | |
| CN108776665A (zh) | 一种数据处理方法及装置 | |
| CN112242177A (zh) | 存储器测试方法、装置、计算机可读存储介质及电子设备 | |
| CN112817858B (zh) | 基于Jmeter批量生成测试数据的方法及计算机设备 | |
| US10866711B1 (en) | Providing account information to applications | |
| CN109857735A (zh) | 一种通过excel进行规则描述的数据构造方法及系统 | |
| CN108628872A (zh) | 基因分析数据库批量数据导入方法和系统 | |
| CN112463042B (zh) | 一种数据卷导入数据校验方法、装置、终端及存储介质 | |
| CN115757165A (zh) | 自动化测试方法、装置、设备及存储介质 | |
| CN107688948A (zh) | 理赔数据处理方法、装置、计算机设备和存储介质 | |
| CN115081235B (zh) | 特征处理方法、装置、存储介质以及电子设备 | |
| CN112307011B (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: 19915277 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 03.12.2021) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19915277 Country of ref document: EP Kind code of ref document: A1 |