首页 \ 问答 \ 用于ant任务的具有Not Gui模式的JMeter不在从属节点上运行(JMeter with Not Gui mode for ant task doesn't run on slave node)

用于ant任务的具有Not Gui模式的JMeter不在从属节点上运行(JMeter with Not Gui mode for ant task doesn't run on slave node)

我根据本手册配置了JMeter集群测试 - JMeter Distributed Testing循序渐进

这两台机器都是带有禁用防火墙的CentOS 6 ,并且具有相同版本的JMeter。

Project已使用JMeter的Java Samples构建:

在此处输入图像描述

所有电话都将结束。 通过RMI调用,如果准确的话。

主节点配置

使用从IP更新了jmeter.properties

运行Jenkins作业 - > ant调用JMeter ant任务 - >在Jmeter上启动测试(它使用java的采样器构建了jar)。

JDK 1.7.25 / ant 1.9.4 / JMeter 2.11;

从节点配置:

JDK 1.7.90 / ant 1.7.1 / JMeter 2.11;

启动jmeter-server

启动测试工作后。 它仅在主节点上执行。 发送到从节点的请求没有发生。
我无法理解为什么会这样。

这是ant任务的片段:

<target name="jmeter-test" depends="jmeter-init, is_run_remote">
    <jmeter jmeterhome="${jmeter.home}"
            testplan="${basedir.unix}/${test.testplan.path}"
            resultlog="${basedir.unix}/${results.report.jmeter.generated.path}"
            failureproperty="test_failed"
            runremote="${is_remote}">
        <!-- jvm settings -->
        <jvmarg value="-Xms${jvm.xms}"/>
        <jvmarg value="-Xmx${jvm.xmx}"/>
        <!-- jmeter remoting properties -->
        <property name="remote_hosts" value="${remote_hosts}" />
        <property name="client.rmi.localport" value="${client.rmi.localport}" />
        <property name="java.rmi.server.hostname" value="${java.rmi.server.hostname}" />
        <property name="server.exitaftertest" value="${server.exitaftertest}" />
        <property name="client.rmi.localport" value="${client.rmi.localport}" remote="true" />
        <property name="server.rmi.localport" value="${server.rmi.localport}" remote="true" />
        <property name="sample_sender_client_configured" value="${sample_sender_client_configured}" remote="true" />
        <property name="mode" value="${remote.results.sending.mode}" remote="true" />
        <property name="asynch.batch.queue.size" value="${asynch.batch.queue.size}" remote="true" />

jmeter.log的主要区别在于通常的测试通过编译采样器:

jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.PostFreightSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.PostVehicleSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.region.PostFreightRegionalSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.region.PostVehicleRegionalSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.country.PostFreightCountrySearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.country.PostVehicleCountrySearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteFreightSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteVehicleSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteFreightSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteVehicleSearch. Uses tearDownTest: false 

在远程运行的情况下,它有不同的行为:

jmeter.engine.ClientJMeterEngine: sent test to 127.0.0.1 basedir='.'
... set the run props
jmeter.engine.ClientJMeterEngine: sent run command to 127.0.0.1 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Remote engines have been started 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Started remote host:  127.0.0.1 (1469447953598) 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000 
2016/07/25 14:59:13 INFO  - jmeter.reporters.Summariser: summary =      1 in     0s = ******/s Avg:     0 Min:     0 Max:     0 Err:     1 (100.00%) 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Finished remote host: 127.0.0.1 (1469447953740) 

如何进行分布式测试?


I have configured JMeter cluster testing according to this manual - JMeter Distributed Testing Step-by-step

Both machines are CentOS 6 with disabled firewalls and have the same version of JMeter.

Project has built with JMeter's Java Samples:

enter image description here

All calls are going to back end. Through RMI calls, if to be accurate.

Master node configuration:

Updated jmeter.properties with slave IP

Run Jenkins job -> ant calls JMeter ant task -> launches test on Jmeter (it has built jar with java's sampler).

JDK 1.7.25 / ant 1.9.4 / JMeter 2.11;

Slave node configuration:

JDK 1.7.90 / ant 1.7.1 / JMeter 2.11;

Started jmeter-server.

After launching test job. It executes only on the master node. Request sending to slave node didn't happen.
I couldn't get a klue why this happenning.

Here is snippet from ant task:

<target name="jmeter-test" depends="jmeter-init, is_run_remote">
    <jmeter jmeterhome="${jmeter.home}"
            testplan="${basedir.unix}/${test.testplan.path}"
            resultlog="${basedir.unix}/${results.report.jmeter.generated.path}"
            failureproperty="test_failed"
            runremote="${is_remote}">
        <!-- jvm settings -->
        <jvmarg value="-Xms${jvm.xms}"/>
        <jvmarg value="-Xmx${jvm.xmx}"/>
        <!-- jmeter remoting properties -->
        <property name="remote_hosts" value="${remote_hosts}" />
        <property name="client.rmi.localport" value="${client.rmi.localport}" />
        <property name="java.rmi.server.hostname" value="${java.rmi.server.hostname}" />
        <property name="server.exitaftertest" value="${server.exitaftertest}" />
        <property name="client.rmi.localport" value="${client.rmi.localport}" remote="true" />
        <property name="server.rmi.localport" value="${server.rmi.localport}" remote="true" />
        <property name="sample_sender_client_configured" value="${sample_sender_client_configured}" remote="true" />
        <property name="mode" value="${remote.results.sending.mode}" remote="true" />
        <property name="asynch.batch.queue.size" value="${asynch.batch.queue.size}" remote="true" />

The main difference from jmeter.log is that usual test goes through compiling Samplers:

jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.PostFreightSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.PostVehicleSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.region.PostFreightRegionalSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.region.PostVehicleRegionalSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.country.PostFreightCountrySearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.country.PostVehicleCountrySearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteFreightSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteVehicleSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteFreightSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteVehicleSearch. Uses tearDownTest: false 

At case of remoting run it has different behavior:

jmeter.engine.ClientJMeterEngine: sent test to 127.0.0.1 basedir='.'
... set the run props
jmeter.engine.ClientJMeterEngine: sent run command to 127.0.0.1 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Remote engines have been started 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Started remote host:  127.0.0.1 (1469447953598) 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000 
2016/07/25 14:59:13 INFO  - jmeter.reporters.Summariser: summary =      1 in     0s = ******/s Avg:     0 Min:     0 Max:     0 Err:     1 (100.00%) 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Finished remote host: 127.0.0.1 (1469447953740) 

How to make distributed testing?


原文:https://stackoverflow.com/questions/38535103
更新时间:2024-01-28 14:01

最满意答案

Angular中的所有$http调用都会返回一个承诺。

$q服务没有Q库中的所有功能,但是如果您查看文档 ,它确实有一个可以用来为您提供所需功能的all方法。

以下是您可以如何使用它的方法:

app.controller('HttpController', function($http, $q) {

  // A hypothetical submit function
  $scope.submit = function() {
    // Set a loading variable for use in the view (to show the spinner)
    $scope.loading = true;

    var call1 = $http.get(/* ... */);
    var call2 = $http.get(/* ... */);
    var call3 = $http.get(/* ... */);

    $q.all([call1, call2, call3]).then(function(responses) {
      // responses will be an array of values the individual
      // promises were resolved to. For this case, we don't 
      // need it, since we only care that they all resolved
      // successfully.

      $scope.loading = false;
    }, function(errorValue) {
      // If any of the promises is rejected, the error callback 
      // will be resolved with that rejection value, kind of like
      // an early exit. We want to mark the loading variable
      // as false here too, and do something with the error.

      $scope.loading = false;
    });
  };
});

All $http calls in Angular return a promise.

The $q service doesn't have all the bells and whistles of the Q library, which it is based, but if you look at the docs, it does have an all method that can be used to give you the functionality you want.

Here's how you could use it:

app.controller('HttpController', function($http, $q) {

  // A hypothetical submit function
  $scope.submit = function() {
    // Set a loading variable for use in the view (to show the spinner)
    $scope.loading = true;

    var call1 = $http.get(/* ... */);
    var call2 = $http.get(/* ... */);
    var call3 = $http.get(/* ... */);

    $q.all([call1, call2, call3]).then(function(responses) {
      // responses will be an array of values the individual
      // promises were resolved to. For this case, we don't 
      // need it, since we only care that they all resolved
      // successfully.

      $scope.loading = false;
    }, function(errorValue) {
      // If any of the promises is rejected, the error callback 
      // will be resolved with that rejection value, kind of like
      // an early exit. We want to mark the loading variable
      // as false here too, and do something with the error.

      $scope.loading = false;
    });
  };
});

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。