首页 \ 问答 \ 使用JMeter测试套接字(Using JMeter to test a socket)

使用JMeter测试套接字(Using JMeter to test a socket)

我想使用JMeter来测试通过套接字进行通信的应用程序。 它是用java完成的。 在服务器上,我有典型的

myServerSocket = new ServerSocket(1025);

对于每个连接,线程都会读取并理解一条线。 而在客户中,我有典型的

clientSocket = new Socket(hostCM, 1025);
out = new PrintWriter(clientSocket.getOutputStream(), true);
out.println("some bit string here");

我想用JMeter或任何其他负载测试工具同时发送大量请求,并进行压力和负载测试。 但我不知道如何准备测试。 在JMeter中可以做到这一点吗?


I would like to use JMeter to test an application that communicates over sockets. It is done in java. In the server I have the typical

myServerSocket = new ServerSocket(1025);

For every connection a thread reads and understands a line. And in clients I have the typical

clientSocket = new Socket(hostCM, 1025);
out = new PrintWriter(clientSocket.getOutputStream(), true);
out.println("some bit string here");

I would like to use JMeter or any other load testing tool to send lots of requests at the same time and make my stress and load testing. But I dont know how to prepare a test. Is is possible to do this in JMeter at all?


原文:https://stackoverflow.com/questions/15732630
更新时间:2021-12-02 20:12

最满意答案

两件事情:

1)Doxygen解析器在doNothing中不会“看到”“IN”(因为它在预处理阶段被移除),因此\ fn不应包含它: const char* doNothing(const char* s) 。 顺便说一句,这不是必要的:如果紧靠记录在案的实体之前,Doxygen会自动将评论关联起来。

2)我不知道__SXC_FUNCTION_ATTRIBUTE扩展到什么,但如果它类似于__MYLIB_FUNCTION_ATTRIBUTE,它可能会混淆Doxygen。 作为一种解决方法,您可以在Doxygen的配置文件的PREDEFINED部分中将这些宏定义为无,或者有条件地在源中定义它们,如下所示:

#ifdef DOXYGEN
// Doxygen does not grok the normal definition of this
#define  __MYLIB_FUNCTION_ATTRIBUTE(...)
#else
#define __MYLIB_FUNCTION_ATTRIBUTE(...)    __attribute__(__VA_ARGS__)
#endif

并将PREDEFINED = DOXYGEN放入配置文件中。


Two things:

1) The Doxygen parser does not "see" the "IN" in doNothing (since it is removed in the preprocessing phase), so the \fn should not include it: const char* doNothing(const char* s). BTW, this \fn is not necessary: Doxygen automatically associates the comment if it is immediately before the documented entity.

2) I don't know what __SXC_FUNCTION_ATTRIBUTE expands into but, if it is something similar to __MYLIB_FUNCTION_ATTRIBUTE, it probably confuses Doxygen. As a workaround, you could either define these macros to nothing in the PREDEFINED section of Doxygen's config file, or conditionally define them in the sources, like this:

#ifdef DOXYGEN
// Doxygen does not grok the normal definition of this
#define  __MYLIB_FUNCTION_ATTRIBUTE(...)
#else
#define __MYLIB_FUNCTION_ATTRIBUTE(...)    __attribute__(__VA_ARGS__)
#endif

and put PREDEFINED = DOXYGEN in your config file.

相关问答

更多
  • 两件事情: 1)Doxygen解析器在doNothing中不会“看到”“IN”(因为它在预处理阶段被移除),因此\ fn不应包含它: const char* doNothing(const char* s) 。 顺便说一句,这不是必要的:如果紧靠记录在案的实体之前,Doxygen会自动将评论关联起来。 2)我不知道__SXC_FUNCTION_ATTRIBUTE扩展到什么,但如果它类似于__MYLIB_FUNCTION_ATTRIBUTE,它可能会混淆Doxygen。 作为一种解决方法,您可以在Doxyge ...
  • Doxygen也有没有记录的功能(或错误):它解析文档字符串中的Doxygen语法,如果您用感叹号开始文档字符串: class Hello: def __init__(self, name): """!@brief Creates a new Hello object. This Hello Object is being used to... @param name The name of the user. """ self.name = name ...
  • Doxygen具有JavaDoc不提供的许多功能,例如层次结构和合作上下文的类图,更多的摘要页面,可选的源代码浏览(与文档交叉链接),附加的标签支持,如@todo on一个单独的页面,它可以生成TeX和PDF格式的输出。它还允许大量的视觉定制。 由于Doxygen支持标准的JavaDoc标签,您可以在任何源代码上使用JavaDoc注释来运行Doxygen。 没有JavaDoc,通常甚至可以在源代码上运行,因为图表和源代码浏览可以帮助您了解代码,即使没有文档。 而且由于JavaDoc工具忽略了未知标签,所以甚 ...
  • 可能是在配置文件中设置正确的输入编码,即 INPUT_ENCODING = ISO-8859-1 默认编码为UTF-8。 It is probably a matter of setting the right input encoding in the configuration file, i.e. INPUT_ENCODING = ISO-8859-1 Default encoding is UTF-8.
  • 因为color乳胶包随着时间的推移而改变,并且在使用的EXTRA_PACKAGES由EXTRA_PACKAGES doxygen指令加载,如下所示: EXTRA_PACKAGES = bytefield ccaption color relsize 。 Because the color latex package changed over time and is loaded by the EXTRA_PACKAGES doxygen directive in the used Doxyfile like ...
  • 如果您使用的是Java 1.4或更低版本,则必须拥有一个package.html ,它是一个完整形成的html文件。 在1.4之后,您可以使用带有格式的package-info.java文件 /** * com.foo is a group of bar utils for operating on foo things. */ package com.foo; If you're using Java 1.4 or lower you have to have a package.html whic ...
  • 如果它包含空格或其他shell特殊字符,则可能需要$doxyFile使用escapeshellarg()转义$doxyFile 。 编辑记录,这是一个权限问题。 详情请参阅评论。 If it contains spaces or other shell special characters, you may need to escape $doxyFile with escapeshellarg() first. Edit for the record, it was a permission proble ...
  • 这似乎是因为Doxygen使用文件扩展来计算出用于分析文本的解析器,并且因为*.qml是新的,它猜错了(虽然我不知道它试图使用哪个) 。 解决方法是告诉Doxygen哪个解析器用于QML文件,所以我只需要将qml=c++添加到EXTENSION_MAPPING ,然后一切按预期工作。 It seems to be because Doxygen uses the file extension to work out what parser to use to analyse the text, and be ...
  • Doxygen接受与JavaDoc类似的语法,但不完全相同。 除了@ret命令之外,您的示例注释将被识别。 doxygen中的正确命令是@return 。 以下是doxygen网站上的示例: http://www.stack.nl/~dimitri/doxygen/docblocks.html Doxygen accepts similar syntax to JavaDoc, but not exactly the same. Your example comment would be recognize ...
  • 从文档(自动链接生成) :一个需要改变 ///< The data. Indexed by Tick_Column_Type. 至 ///< The data. Indexed by ::Tick_Column_Type. From the docs (Automatic Link Generation): One needs to change from ///< The data. Indexed by Tick_Column_Type. to ///< The data. Indexed ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)