JMeter结果大小限制(JMeter results size limit)
我在Jmeter中运行稳定性测试(60小时)。 我在测试计划中有几个图表来捕获系统资源,如cpu,threads,heap。
24小时后
View_Results_Tree.xml
文件的大小为9GB。 我担心如果jmeter会维持60小时。
View_Results_Tree.xml
或结果文件夹大小是否有大小限制?- 在进行如此长时间的测试之前,Jmeter遵循的最佳实践是什么? 我正在寻找这种长时间测试的推荐配置/属性。
谢谢Veera。
I am running a stability test (60hrs) in Jmeter. I have several graphs in the test plan to capture system resources like cpu, threads, heap.
The size of
View_Results_Tree.xml
file is 9GB after 24hrs. I am afraid if jmeter will sustain for 60hrs.
- Is there size limit for
View_Results_Tree.xml
or results folder size in Jmeter?- What are the best practices to be followed in Jmeter before running such long tests? I am looking for recommended config/properties for such long tests.
Thanks Veera.
原文:https://stackoverflow.com/questions/39054961
最满意答案
问题在于你在测试用例中调用真正的boto,而不是你的模拟。
您需要使用它在测试模块中具有的相同符号名称来模拟对象。 而不是试图修补'boto.s3.connection.S3Connection',你想补丁'test_s3.S3Connection'。 它以'test_s3'开头,因为这是您要加载测试代码的模块的名称。 然后,在点之后,使用与该模块内部相同的符号可以访问S3Connection(即,没有boto.s3.connection)。
另外,补丁为你自动创建一个模拟,所以你不需要创建第一个模拟对象。 由于您已经修补了S3Connection,而不是修补其中的内容,您只需将创建的mock作为正确方法的返回值插入即可:
mock_bucket = mock.Mock() mock_key = mock.Mock() with mock.patch('test_s3.S3Connection') as mock_conn: mock_conn.get_bucket.return_value = mock_bucket mock_bucket.lookup.return_value = mock_key mock_key.size.return_value = 50000 self.assertEquals(fake.check_size(), 50)
The problem is that you are calling the real boto in your test case, not your mock.
You need to mock the object using the same symbol name it has inside your test module. Instead of trying to patch 'boto.s3.connection.S3Connection', you want to patch 'test_s3.S3Connection'. It starts with 'test_s3' because that is the name of the module from where you are loading the code under test. Then, after the dot, use the same symbol that inside that module gives you access to S3Connection (that is, without boto.s3.connection).
Also, patch creates a mock automatically for you, so you do not need to create the first mock object. And as you already patched S3Connection, instead of patching things inside it, you just need to plug your created mocks as return values for the proper methods:
mock_bucket = mock.Mock() mock_key = mock.Mock() with mock.patch('test_s3.S3Connection') as mock_conn: mock_conn.get_bucket.return_value = mock_bucket mock_bucket.lookup.return_value = mock_key mock_key.size.return_value = 50000 self.assertEquals(fake.check_size(), 50)
相关问答
更多-
哪种方法可能是更好的选择? 我打算假装你没有问过,因为没有“正确”的答案 - 这是主观的,而且有很多因素,其中一些是基于意见的。 但这两种解决方案都是可行的。 API网关,您将其用作将Lambda函数公开到Internet的前端,具有CORS支持,因此不需要关注您。 另一种选择是使用S3和Lambda(使用API网关),但将两个资源都配置为CloudFront分发背后的来源。 指定存储桶的默认缓存行为,然后使用路径模式(如/api/*将API请求路由到API网关。 这会将所有请求代理到适当的来源,但您的站点 ...
-
s3目录的s3fs权限(s3fs permissions for s3 directory)[2022-10-17]
老实说,我不知道发生了什么。 但是我重新启动了我的EC2实例并再次运行上面的程序,它运行得很好。 I honestly have no clue what happened. But I restarted my EC2 instance and ran the above again and it worked perfectly. -
S3与CloudFront上的缓存页面有什么区别(What is the difference between caching pages on S3 versus CloudFront)[2023-05-20]
最大的不同是CloudFront在全球50多个地方,因此它将为全球观众提供更快的内容。 实际上,您不必选择 - 您可以生成页面,将它们放入S3以获得最大的可缓存性,然后通过CloudFront提供以获得最佳的查看器体验。 The biggest difference is CloudFront is in more than 50 locations worldwide, so it will deliver content faster to viewers worldwide. Actually, yo ... -
所以事实证明,自从我正在调用我在课堂上创建的制作者对象时,我正在测试这些嘲笑正在被第二个嘲弄对象记录下来。 我得到了其中两个:测试类中的一个mock_producer和称为myproducer的第二个模拟生产者(我在测试中使用的名称)。 @mock.patch('mypackage.mycoordinator.producer.Producer') # This creates the first mocked object @mock.patch('mypackage.mycoordinator.cons ...
-
这些对象是否存储在Amazon Glacier中? “InvalidObjectState”是S3尝试从Amazon Glacier读取对象但尚未“恢复”对象时将获得的错误。 如果是这种情况,请注意从Amazon Glacier恢复对象可能需要数小时,并且取决于有多少因素和许多其他因素,可能非常昂贵。 Are these objects stored in Amazon Glacier? "InvalidObjectState" is the error that S3 would get if you t ...
-
你已经对php.ini文件做了一些调整。 下载这个文件http://curl.haxx.se/ca/cacert.pem并像这样在php.ini中设置路径,然后重新启动服务器。 ;;;;;;;;;;;;;;;;;;;; ; php.ini Options ; ;;;;;;;;;;;;;;;;;;;; curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem" 以上路径对于XAAMP来说很常见 这将解决您的问题。 You have do a tweak to t ...
-
什么是处理Amazon S3上传的最佳ios库?(What is the best ios library to handle Amazon S3 uploads? [closed])[2022-11-06]
虽然我无法确定它是否是“最好的”,但您可以尝试AFAmazonS3Manager的AFNetworking 。 我过去没有直接使用它,但知道有的人。 https://github.com/AFNetworking/AFAmazonS3Manager 它似乎是我能找到的唯一的非亚马逊AWS框架。 While I can't say for sure if it's "the best" you could try the AFAmazonS3Manager from AFNetworking. I haven ... -
你应该嘲笑你正在测试的地方。 根据提供的示例,这意味着您在settings.py模块中使用的Escli类需要针对settings.py模拟。 因此,更实际的情况是,您的patch调用在setUp看起来像是这样: self.patcher = patch('escli.settings.Escli') 有了这个,你现在正在根据你的测试运行情况,在正确的地方嘲笑你想要的东西。 此外,为了增加测试的稳健性,您可能需要考虑指定您正在创建的Elasticsearch实例,以验证您实际上调用的是与Elasticsea ...
-
嘲笑。(mocking in go. Is there an easy way?)[2023-12-05]
您可以使用界面来完成。 例如,假设您有一个名为Mailer的界面: type Mailer interface { Send() error } 现在,您可以将Mailer对象嵌入到调用Send方法的函数中。 type Processor struct { Mailer } func (p *Processor) Process() { _ = p.Mailer.Send() } 现在,在您的测试中,您可以创建一个模拟邮件程序。 type mockMailer struct{} ... -
是。 您可以为存储桶启用CORS,以便可以通过XMLHttpRequest加载对象。 http://aws.typepad.com/aws/2012/08/amazon-s3-cross-origin-resource-sharing.html http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html 特别是在使用PhoneGap / Cordova时,您可以通过在应用程序中将域列入白名单来绕过在服务器上启用CORS: http://docs.phon ...