Java 如何在jmeter中创建用户定义的函数

Java 如何在jmeter中创建用户定义的函数,java,jmeter,Java,Jmeter,我想在jmeter中创建一个函数,需要使用函数帮助器对话框调用这个函数,当我在谷歌上搜索这个函数时,我发现了一个链接 但创建的函数仍不会出现在对话框中 有人会帮我吗 提前谢谢 我的Jmeter日志是: 2014/12/18 10:48:00 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US 2014/12/18 10:48:00 INFO - jmeter.JMeter: Loading user properties fro

我想在jmeter中创建一个函数,需要使用
函数帮助器对话框
调用这个函数,当我在谷歌上搜索这个函数时,我发现了一个链接

但创建的函数仍不会出现在对话框中

有人会帮我吗

提前谢谢

我的Jmeter日志是:

2014/12/18 10:48:00 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
2014/12/18 10:48:00 INFO  - jmeter.JMeter: Loading user properties from: E:\apache-jmeter-2.12\apache-jmeter-2.12\bin\user.properties 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Loading system properties from: E:\apache-jmeter-2.12\apache-jmeter-2.12\bin\system.properties 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Copyright (c) 1998-2014 The Apache Software Foundation 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Version 2.12 r1636949 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: java.version=1.7.0_51 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: os.name=Windows XP 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: os.arch=x86 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: os.version=5.1 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: file.encoding=Cp1252 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: JMeterHome=E:\apache-jmeter-2.12\apache-jmeter-2.12 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: user.dir  =E:\apache-jmeter-2.12\apache-jmeter-2.12\bin 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: PWD       =E:\apache-jmeter-2.12\apache-jmeter-2.12\bin 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: IP: 10.206.0.106 Name: himanshuj2 FullName: himanshuj2.newvisionsoftware.com 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties 
2014/12/18 10:48:03 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.' 
2014/12/18 10:48:03 INFO  - jmeter.gui.action.LookAndFeelCommand: Using look and feel: javax.swing.plaf.metal.MetalLookAndFeel [Metal, CrossPlatform] 
2014/12/18 10:48:04 INFO  - jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22 
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default 
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 
2014/12/18 10:48:05 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.http.control.gui.WebServiceSamplerGui 
2014/12/18 10:48:05 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.http.modifier.gui.ParamModifierGui 
2014/12/18 10:48:06 INFO  - jorphan.exec.KeyToolUtils: keytool found at 'keytool' 
2014/12/18 10:48:06 INFO  - jmeter.protocol.http.proxy.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file E:\apache-jmeter-2.12\apache-jmeter-2.12\bin\proxyserver.jks 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000 

您必须确保您的函数位于以其名称包含以下内容的包中:

  • .功能。并且不包含.gui
这与jmeter.properties中的此属性一致:

  • classfinder.functions.contain=.functions

  • classfinder.functions.notContain=.gui


以上两行已经在
jmeter.properties
中设置好了,但是我找不到它的任何优势……:(你的类的包是什么?Thx如果它的名称中没有包含函数,它将不会按照我的回答出现。这个包在我的代码中被调用:
包org.apache.jmeter.functions;