热门标签 | 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


推荐阅读
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文介绍了lua语言中闭包的特性及其在模式匹配、日期处理、编译和模块化等方面的应用。lua中的闭包是严格遵循词法定界的第一类值,函数可以作为变量自由传递,也可以作为参数传递给其他函数。这些特性使得lua语言具有极大的灵活性,为程序开发带来了便利。 ... [详细]
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文介绍了C#中数据集DataSet对象的使用及相关方法详解,包括DataSet对象的概述、与数据关系对象的互联、Rows集合和Columns集合的组成,以及DataSet对象常用的方法之一——Merge方法的使用。通过本文的阅读,读者可以了解到DataSet对象在C#中的重要性和使用方法。 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • 本文介绍了在SpringBoot中集成thymeleaf前端模版的配置步骤,包括在application.properties配置文件中添加thymeleaf的配置信息,引入thymeleaf的jar包,以及创建PageController并添加index方法。 ... [详细]
  • 本文介绍了如何使用PHP向系统日历中添加事件的方法,通过使用PHP技术可以实现自动添加事件的功能,从而实现全局通知系统和迅速记录工具的自动化。同时还提到了系统exchange自带的日历具有同步感的特点,以及使用web技术实现自动添加事件的优势。 ... [详细]
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • Webpack5内置处理图片资源的配置方法
    本文介绍了在Webpack5中处理图片资源的配置方法。在Webpack4中,我们需要使用file-loader和url-loader来处理图片资源,但是在Webpack5中,这两个Loader的功能已经被内置到Webpack中,我们只需要简单配置即可实现图片资源的处理。本文还介绍了一些常用的配置方法,如匹配不同类型的图片文件、设置输出路径等。通过本文的学习,读者可以快速掌握Webpack5处理图片资源的方法。 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
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社区 版权所有