用jmeter没有图形结果

时间:2017-09-11 08:18:03

标签: jmeter jmeter-3.2

我已根据#include <vector> #include <cstddef> #include <iostream> #include <chrono> const int MAX = 100000000; void setup(std::vector<int> & v){ for (int i = 0 ; i< MAX; i++) { v.push_back(i); } } void checkResult(std::vector<int> & v) { int half_length; if (MAX%2==0) half_length = MAX/2; else half_length = MAX-1/2; for (int i = 0 ; i< half_length; i++) { if (v[i] != i*2) std::cout << "Error: v[i]=" << v[i] << " but should be " << 2*i << "\n"; } for (int i = half_length+1; i< MAX; i++) { if (v[i] != 0) std::cout << "Error: v[i]=" << v[i] << " but should be 0 \n"; } } void down_sample(){ std::vector<int> v; setup(v); auto start_time = std::chrono::steady_clock::now(); int * begin = &v[0]; int * stop = begin + v.size(); int * position = begin + 2; int * half_position = begin +1; while( position < stop){ *half_position = *position; ++half_position; position += 2; } size_t size = v.size()/2; int * a = new (half_position) int[size](); auto duration = std::chrono::steady_clock::now() - start_time; std::cout << "Orig: Time difference [micro s] = " << std::chrono::duration_cast<std::chrono::microseconds>(duration).count() <<std::endl; checkResult(v); } void down_sample_JohnZwinck () { std::vector<int> v; setup(v); auto start_time = std::chrono::steady_clock::now(); size_t slow = 1, fast = 2; // read the first half, write the first quarter size_t stop = (v.size()+1)/2; while (fast < stop) { v[slow++] = v[fast]; fast += 2; } // read and clear the second half, write the second quarter stop = v.size(); while (fast < stop) { v[slow++] = v[fast]; v[fast++] = 0; v[fast++] = 0; } // clean up (only really needed when length is even) v[slow] = 0; auto duration = std::chrono::steady_clock::now() - start_time; std::cout << "JohnZwinck: Time difference [micro s] = " << std::chrono::duration_cast<std::chrono::microseconds>(duration).count() <<std::endl; checkResult(v); } void down_sample_Schorsch312(){ std::vector<int> v; setup(v); auto start_time = std::chrono::steady_clock::now(); int half_length; if (v.size()%2==0) half_length = MAX/2; else half_length = MAX-1/2; for (int i=0; i < half_length; i++) v[i] = v[2*i]; for (int i=half_length+1; i< MAX; i++) v[i]=0; auto duration = std::chrono::steady_clock::now() - start_time; std::cout << "Schorsch312: Time difference [micro s] = " << std::chrono::duration_cast<std::chrono::microseconds>(duration).count() <<std::endl; } void down_sample_Hatatister(){ std::vector<int> v; setup(v); auto start_time = std::chrono::steady_clock::now(); int * begin = &v[0]; int * stop = begin + v.size(); int * position = begin + 2; int * half_position = begin +1; while( position < stop){ *half_position = *position; ++half_position; position += 2; } size_t size = v.size()/2; int * a = new (half_position) int[size](); auto duration = std::chrono::steady_clock::now() - start_time; std::cout << "Hatatister: Time difference [micro s] = " << std::chrono::duration_cast<std::chrono::microseconds>(duration).count() <<std::endl; checkResult(v); } void down_sample_user2807083 () { std::vector<int> v; setup(v); auto start_time = std::chrono::steady_clock::now(); const std::size_t sz = v.size(); const std::size_t half = sz / 2; bool size_even = ((sz % 2) == 0); std::size_t index = 2; for (; index < half; index += 2) { v[index/2] = v[index]; } for (; index < sz; ++index) { v[(index+1)/2] = v[index]; v[index] = 0; } if (size_even && (half < sz)) { v[half] = 0; } auto duration = std::chrono::steady_clock::now() - start_time; std::cout << "user2807083: Time difference [micro s] = " << std::chrono::duration_cast<std::chrono::microseconds>(duration).count() <<std::endl; checkResult(v); } int main () { down_sample(); down_sample_JohnZwinck (); down_sample_Schorsch312(); down_sample_Hatatister(); down_sample_user2807083(); } 中的教程安装了jmeter,现在完全遵循https://www.guru99.com/jmeter-performance-testing.html页面中的步骤,但未获得图表结果graph results。 我在gui模式下打开jmeter导致在命令行模式下我收到错误guru99.com

3 个答案:

答案 0 :(得分:3)

您忘记添加将发送请求的HTTP请求

  

右键单击“线程组”并选择:添加 - &gt;采样器 - &gt; HTTP   请求。

答案 1 :(得分:0)

我遵循相同的教程,我使用的是jmeter4,最初,我遇到了相同的问题,然后尝试导入以下套件,做了以下操作,

Check whether you are connecting to the internet via a proxy. If yes, remove the proxy.
    Open a new instance of Jmeter
    Open the PerformanceTestPlan.jmx in Jmeter
    Double Click on Thread Group -> Graph Result
    Run the Test

URL:https://www.guru99.com/jmeter-performance-testing.html

答案 2 :(得分:0)

您应该设置足以在图形上可见的用户数量,并且在图片上没有HTTP请求。就我而言,我在线程组中将用户数设置为20,且加速期为60。

我也有:

  • 在我的测试计划的根目录中添加了HTTP请求默认值,HTTP标头管理器和图形结果
  • 在我的测试计划的根目录中添加了两个线程组
  • 在两个线程组中添加了20个不同的HTTP请求
  • 在两个线程组中添加了“查看结果”侦听器

graph picture

thread group configuration picture