如何在JMeter中创建插件 [英] How to create a plugin in JMeter

查看:131
本文介绍了如何在JMeter中创建插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个JMeter插件.我想了解如何编写和打包我的代码以通过我的Sample扩展JMeter.更详细地讲,我正在寻找一种实现我的协议的临时" TCPSampler. 我尝试遵循JMeter网站上的旧pdf文档,但是它不起作用.错误在哪里? 你能帮我举一些例子吗?

i would like to create a JMeter plugin. I would like to understand how to write and pack my code to extend JMeter with my Sample. More in detail i'm looking for an "adhoc" TCPSampler that implement my protocol. I tried following an old pdf document from JMeter site but it doesn't work. Where is the mistake? Can you help me with some examples?

谢谢 RM

推荐答案

有几个扩展JMeter的选项.

There are several options to extend JMeter.

  1. 使用JSR223 Sampler(建议使用Groovy语言,因为它可以编译成Java代码,但是您需要d Beanshell采样器-基本相同,但是内置的.性能低于JSR223 + Groovy
  2. 创建您自己的Java请求. JMeter随附2个Java Request采样器- ExampleSampler 源代码,以获取详细信息以及如何实现它,甚至将其用作插件的基础.
  1. Use JSR223 Sampler (groovy language is recommended to use as it can be compiled into Java code, however you'll need to download groovy-all.jar and drop it to /lib folder of your JMeter installation)
  2. Use Beanshell Sampler - basically the same, but it's built-in. Have lower performance than JSR223 + Groovy
  3. Create your own Java Request. 2 Java Request samplers are shipped with JMeter - JavaTest and SleepTest. You can inspect their source to see how they're implemented.
  4. Create your own Sampler. See ExampleSampler source code for details and how to implement it or even use it as a base for your plugin.

所有JMeter扩展都应打包为.jar并位于JMeter安装的/lib/ext文件夹下.

All JMeter Extensions should be packaged as .jar and live under /lib/ext folder of your JMeter installation.

这篇关于如何在JMeter中创建插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆