Front-end page performance optimization, performance testing algorithm optimization, MeterSphere open source continuous testing platform v2.10.5 LTS release

insert image description here
On August 7, 2023, MeterSphere's one-stop open source continuous testing platform officially released v2.10.5 LTS version. Since the release of the v2.10 LTS version in May 2023, the MeterSphere open source project team has insisted on releasing small versions every two weeks, continuously repairing and updating problems, and optimizing some functions.

The MeterSphere v2.10.5 LTS version released this time has carried out key upgrades and optimizations in terms of front-end page performance, performance test algorithms, back-end interface permissions, and high-frequency operation experience, bringing users a better experience. Welcome community users to upgrade and use.

Front-end page performance optimization

Previously, some community users reported that some pages of the MeterSphere platform, especially the homepage of each module, were loaded slowly. The main reason is that the front-end resource package is relatively large in size, the home page fully loads more than 30MB of resources, and the size of individual JavaScript resources is close to 3MB. In response to user feedback, the MeterSphere V2 version has concentratedly optimized the front-end performance in the following ways, and released it in the v2.10.2 LTS version update. The optimized content includes:

■ Bundle splitting: use webpack-bundle-analyzer to build the product for analysis, and disassemble the package;

■Public library extraction: extract shared resources into public libraries to reduce repeated packaging when packaging application modules;

■Cache sharing: Place the resources of the public library in a unified directory, and each module application uses an external link to import the same resource, making full use of the HTTP cache strategy to reduce repeated loading;

■ Package body simplification: some npm resources are modified to import on demand, reducing the introduction of useless code;

■Dynamic loading: Some third-party plug-ins are relatively large, such as PDF and ECharts, which are used on some pages, not all pages. This part has been split, not directly introduced in main.js, but dynamically loaded when used.

After these front-end optimization measures, the performance optimization effect of the MeterSphere platform is obvious. After optimization, the largest package file size is also within 330KB, the overall loading resource size is reduced by more than 60%, and the full loading time is reduced from 20s to about 7.5s.

Comparison before and after optimization:
insert image description here
insert image description here

Performance testing algorithm optimization

The performance test module of the MeterSphere open source version is processed in the same way as JMeter, but in the case of high concurrency, especially distributed multi-node testing, the pressure test data is different from that of JMeter running locally. In response to this situation, MeterSphere Enterprise Edition has carried out special algorithm optimization, which has reached the same level as native JMeter in terms of test data accuracy and real-time performance. Compared with the test scenario of dual test nodes accessing Nginx, the test results of MeterSphere Enterprise Edition and JMeter native are almost the same.

The JMeter test results are compared with the MeterSphere Enterprise Edition test results as follows:
insert image description here

In addition to algorithm optimization, MeterSphere Enterprise Edition also supports Kubernetes resource pools. When performing a performance test task, the platform calls the Kubernetes API to quickly create a corresponding performance test job. After the test is executed, the corresponding resources are automatically recovered, and the resource pools used by different teams are distinguished to avoid mutual influence. At the same time, MeterSphere Enterprise Edition provides original factory professional services, providing customers with performance test pressure test demand analysis, traffic model design, and performance test expert services such as construction, execution, analysis and optimization of distributed pressure test environments.

Increased backend API calls

Requires Permissions

The product design team of MeterSphere open source continuous testing platform attaches great importance to product security, flexibility and maintainability.

Since MeterSphere v2.10.2 LTS, all backend API calls have been added with "Requires Permissions" verification. By adding the "Requires Permissions" verification step in the API call, it can be ensured that only users or roles with corresponding permissions can access and execute the API, effectively protecting the sensitive data and functions of the system and preventing unauthorized access and operations.

This design also improves the maintainability of the system. When the system needs to adjust or update the permissions, only the corresponding permissions need to be modified without changing the API code itself, thus reducing the complexity of system maintenance and upgrades.

Users can customize whether access to MeterSphere's Swagger URL requires authorization authentication, that is, modify the following configuration in docker-compose-gateway.yml to control whether authentication is required.

■SWAGGER_ENABLED: false

High-frequency operation function experience optimization

■ Test tracking: test plan execution function test case experience optimization (simplified operation steps);

■ Interface test: new interface case optimization (simplified operation steps);

■ Interface test: The interface assertion method supports XPath assertion of the response body in HTML format;

■ UI testing: UI scene automation step loading performance optimization;

■ General functions: each functional module of the system cancels the 8-level restriction of the module tree;

■ Common features: Advanced Search supports searching through custom fields.

Guess you like

Origin blog.csdn.net/FIT2CLOUD/article/details/132149029