热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

JmeterMavenPlugin高级应用:ModifyingProperties

ModifyingPropertiesModifyingPropertiesModifyingPropertiesPages 12HomeAddingadditionallibra

Modifying Properties

 Pages 12

  • Home
  • Adding additional libraries to the classpath
  • Advanced Configuration
  • Basic Configuration
  • Configuring the jvm that the jmeter process runs in
  • FAQ
  • Log Levels
  • Modifying Properties
  • Proxy Configuration
  • Remote Server Configuration
  • Selecting Tests To Run
  • Test Results File Format

Modifying Properties

  • Using Your Own Properties Files
  • Adding Additional Properties To
  • Adding Additional Properties To
  • Adding Additional Properties To
  • Adding Additional Properties To
  • Adding Additional Properties To
  • Adding Additional Properties To
  • Setting
  • Specifying A
  • Specifying The

Using Your Own Properties Files

The easiest way to configure JMeter with this plugin is to supply your own properties files. When it starts up the plugin will scan the ${project.base.directory}/src/test/jmeter directory for the following files:

  • jmeter.properties
  • saveservice.properties
  • upgrade.properties
  • system.properties
  • user.properties
  • global.properties

Adding Additional Properties To

It is possible to set properties that configure the main JMeter library. To set those properties you will need to specify each property in your pom.xml in the config element (The example below shows a property called log_level.jmeter being set).

Each property specified is merged into the JMeter properties file jmeter.properties, it will overwrite any identical properties within the file.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesJMeter>
                            <log_level.jmeter>DEBUGlog_level.jmeter>
                        propertiesJMeter>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Adding Additional Properties To

It is possible to set properties that configure the Saveservice of the main JMeter library. To set those properties you will need to specify each property in your pom.xml in the config element (The example below shows a property called HTTPSampler2 being set).

Each property specified is merged into the JMeter properties file saveservice.properties, it will overwrite any identical properties within the file.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesSaveService>
                            <HTTPSampler2>org.apache.jmeter.protocol.http.sampler.HTTPSampler2HTTPSampler2>
                        propertiesSaveService>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Adding Additional Properties To

It is possible to set properties that are used in the oldValue to newValue upgrade mapping of the main JMeter library. To set those properties you will need to specify each property in yourpom.xml in the config element . (The example below shows a property called my.old.ClassName being set).

Each property specified is merged into the JMeter properties file upgrade.properties, it will overwrite any identical properties within the file.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesUpgrade>
                            <my.old.ClassName>my.new.ClassNamemy.old.ClassName>
                        propertiesUpgrade>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Adding Additional Properties To

JMeter user properties are properties supplied to JMeter that can be used in JMeter tests. To set user properties you will need to specify each property in your pom.xml in the config element (The example below shows a property called threads and a propery calledtestIterations being set).

Each property specified is merged into the JMeter properties file user.properties, it will overwrite any identical properties within the file.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesUser>
                            <threads>10threads>
                            <testIterations>5testIterations>
                        propertiesUser>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Adding Additional Properties To

Global properties are properties that are sent to the remote machines. To set those properties you will need to specify each property in your pom.xml in the config element (The example below shows a property called threads and a property calledtestIterations being set).

Each property specified is merged into the JMeter properties file global.properties, it will overwrite any identical properties within the file.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesGlobal>
                            <threads>10threads>
                            <testIterations>5testIterations>
                        propertiesGlobal>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Adding Additional Properties To

JMeter can set system properties, these are global environment properties accessible by all applications running in the same JVM (They are not accessible outside the JVM). To set system properties you will need to specify each property in your pom.xml in the config element (The example below shows a property called my.system.property being set).

Each property specified is merged into the JMeter properties file system.properties, it will overwrite any identical properties within the file.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesSystem>
                            <my.system.property>my.system.property.valuemy.system.property>
                        propertiesSystem>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Setting

By default all properties specified in the settings above will be merged with any existing properties. If you want them to be replaced instead you can do this by setting to true (it is false by default). Please think very carefullybefore doing this, the reason we merge properties by default is to ensure that all properties are merged into the latest valid versions of the properties files supplied with JMeter. If you overwrite the properties files but are missing a property that is required by JMeter things will most likely break.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesReplacedByCustomFiles>${basedir}truepropertiesReplacedByCustomFiles>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Specifying A

This will allow you to set an absolute path to JMeter custom (test dependent) properties file. This is the equivalent of setting " --addprop my.properties" on the command line.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <customPropertiesFiles>
                            <file>/user/home/myuser/myCustom.propertiesfile>
                        customPropertiesFiles>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Specifying The

You can specify the directory where the .properties files are located in your file system (by default the plugin will assume they are in ${project.base.directory}/src/test/jmeter)

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmetergroupId>
                    <artifactId>jmeter-maven-pluginartifactId>
                    <version>2.0.3version>
                    <executions>
                        <execution>
                            <id>jmeter-testsid>
                            <goals>
                                <goal>jmetergoal>
                            goals>
                        execution>
                    executions>
                    <configuration>
                        <propertiesFilesDirectory>/user/home/myuser/propertiespropertiesFilesDirectory>
                    configuration>
                plugin>
            plugins>
        build>
    [...]
project>
+---+

Jmeter-Maven-Plugin高级应用:Modifying Properties


推荐阅读
  • 本文探讨了如何在PHP与MySQL环境中实现高效的分页查询,包括基本的分页实现、性能优化技巧以及高级的分页策略。 ... [详细]
  • 探索OpenWrt中的LuCI框架
    本文深入探讨了OpenWrt系统中轻量级HTTP服务器uhttpd的工作原理及其配置,重点介绍了LuCI界面的实现机制。 ... [详细]
  • 本文探讨了Android系统中联系人数据库的设计,特别是AbstractContactsProvider类的作用与实现。文章提供了对源代码的详细分析,并解释了该类如何支持跨数据库操作及事务处理。源代码可从官方Android网站下载。 ... [详细]
  • 本文详细介绍了PHP中的几种超全局变量,包括$GLOBAL、$_SERVER、$_POST、$_GET等,并探讨了AJAX的工作原理及其优缺点。通过具体示例,帮助读者更好地理解和应用这些技术。 ... [详细]
  • 本文详细介绍了如何使用Rufus工具制作一个兼容UEFI启动模式的Windows Server 2008 R2安装U盘,包括必要的软件和步骤。 ... [详细]
  • 使用 ModelAttribute 实现页面数据自动填充
    本文介绍了如何利用 Spring MVC 中的 ModelAttribute 注解,在页面跳转后自动填充表单数据。主要探讨了两种实现方法及其背后的原理。 ... [详细]
  • 本文详细介绍了如何使用Linux下的mysqlshow命令来查询MySQL数据库的相关信息,包括数据库、表以及字段的详情。通过本文的学习,读者可以掌握mysqlshow命令的基本语法及其常用选项。 ... [详细]
  • selenium通过JS语法操作页面元素
    做过web测试的小伙伴们都知道,web元素现在很多是JS写的,那么既然是JS写的,可以通过JS语言去操作页面,来帮助我们操作一些selenium不能覆盖的功能。问题来了我们能否通过 ... [详细]
  • 汇总了2023年7月7日最新的网络安全新闻和技术更新,包括最新的漏洞披露、工具发布及安全事件。 ... [详细]
  • 本文提供了一个详尽的前端开发资源列表,涵盖了从基础入门到高级应用的各个方面,包括HTML5、CSS3、JavaScript框架及库、移动开发、API接口、工具与插件等。 ... [详细]
  • 本文详细介绍如何在SSM(Spring + Spring MVC + MyBatis)框架中实现分页功能。包括分页的基本概念、数据准备、前端分页栏的设计与实现、后端分页逻辑的编写以及最终的测试步骤。 ... [详细]
  • 使用 Babylon.js 实现地球模型与切片地图交互(第三部分)
    本文继续探讨在上一章节中构建的地球模型基础上,如何通过自定义的 `CameraEarthWheelControl` 类来实现更精细的地图缩放控制。我们将深入解析该类的实现细节,并展示其在实际项目中的应用。 ... [详细]
  • SQL查询与事务管理:深入解析
    本文详细介绍了SQL查询的基本结构和高级特性,包括选择、分组查询以及权限控制等内容,并探讨了事务管理中的并发控制策略,旨在为数据库管理员和开发人员提供实用指导。 ... [详细]
  • 本文详细对比了HashMap和HashTable在多线程环境下的安全性、对null值的支持、性能表现以及方法同步等方面的特点,帮助开发者根据具体需求选择合适的数据结构。 ... [详细]
  • 神策数据分析基础
    本文介绍了基于用户行为的数据分析方法,包括业务问题的提出与定义、具体行为的识别及统计分析流程。同时,详细阐述了如何利用事件模型(Event Model)来描述用户行为,以及在实际应用中的案例分析。 ... [详细]
author-avatar
手机用户2502892757
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有