laitimes

How to quickly clear file records when using the Zhixing Bridge EDI system for stress testing

author:Su Yuewei

After the implementation of the EDI project is completed, in order to ensure that the EDI system can operate stably in the case of large data concurrency, we need to do stress testing.

When doing stress testing, a large number of files will be generated in a short period of time, for example, the test will generate 10,000 EDI packets at the same time, and multiple ports may generate a large number of files and logs in a short period of time. If performance tuning is required, we need to test the speed of the workflow at different parameters, we need to do multiple tests, we need to check the records of file processing repeatedly, and the previous test records will make it less convenient for us to check. Or after doing the stress test, we need to clean up the unwanted files and records, if you open the input and output list of each port to delete manually, it is undoubtedly more troublesome, today's article to explain how to quickly clear the files and logs generated by the stress test.

First of all, let's understand the process of file and log storage in the Zhixing Bridge EDI system, after the port processes the message file, the transmission log and the file will be generated. Files processed by the port can choose whether to keep a copy of the message, if not checked, the message copy cannot be downloaded on the Output and Input tabs.

How to quickly clear file records when using the Zhixing Bridge EDI system for stress testing

By default, the transfer logs are stored in the file database that comes with The Bridge of Knowledge (SQLite for Windows and Derby for Linux).

Then, when processing logs and file records, you can refer to the following two methods:

1. If you only need to clear the log, you can create a Script port, call the following function to quickly clear all ports or specify the log file for the port

Function Name (ops) function parameter
portDeleteTransactionLogs Delete the transport log

Input: ConnectorId= Port ID

Direction=The folder that needs to be deleted can be set to send, receive

portListPorts Cycle through the list of ports Out of the reference: portid= the current port name

Screenplay reference:

Delete all transport logs

1

2

3

4

5

6

7

<rsb:call op="portListPorts" out="out">

<rsb:set attr="data.ConnectorId" value="[out.portid]"/>

<rsb:set attr="data.Direction" value="Send"/>

<rsb:call op="portDeleteTransactionLogs" in="data" />

<rsb:set attr="data.Direction" value="Receive"/>

<rsb:call op="portDeleteTransactionLogs" in="data" />

</rsb:call>

Deletes the specified port transfer log

1

2

3

4

5

6

<rsb:set attr="data.ConnectorId" value="端口名"/>

<rsb:set attr="data.Direction" value="Send"/>

<rsb:set attr="data.WorkspaceId" value="工作区ID"/>

<rsb:call op="portDeleteTransactionLogs" in="data" />

<rsb:set attr="data.Direction" value="Receive"/>

<rsb:call op="portDeleteTransactionLogs" in="data" />

How to quickly clear file records when using the Zhixing Bridge EDI system for stress testing

Write the above script to the Settings tab of the Script port as shown in the figure above.

On the Output tab of the Script port, manually click Receive, and the script written in the Script port will be executed, waiting for the execution to complete.

How to quickly clear file records when using the Zhixing Bridge EDI system for stress testing

2. Delete all logs as well as files

Zhixing Bridge EDI system files are stored in the data folder, logs are stored in the db file database, if you need to reset, you can delete these two folders, for example, in multiple rounds of stress testing, you need to save the complicated deletion of records, quickly enter the next round, after the end of the test and then clear the records uniformly, you can refer to the following operation steps:

1) Export the current workflow

2) Stop the Zhixing Bridge service

3) Rename the data and db folders, such as data_backup1, db_backup1

4) Restart the Bridge of Knowledge service, at this time, it can be found that the data and db folders are regenerated

5) Import the workflow

6) After all test tasks are completed, batch delete redundant folders such as rm -rf data_backup*

The above is a way to quickly clear the transfer log and files, in fact, this method is not only suitable for stress testing, if you need to manually delete file records, delete files to free up disk space, in addition to using the archiving/deletion function that comes with Zhixing Bridge, you can also use the method described in this article.

How to quickly clear file records when using the Zhixing Bridge EDI system for stress testing | EDI Communications Specialist