【问题标题】:tsung not sending or receiving any datatsung 没有发送或接收任何数据
【发布时间】:2021-10-03 04:47:06
【问题描述】:

我有一个 api,我正在使用 tsung 进行负载测试。一切正常。现在,我在负载测试中使用文件中的变量数据没有得到任何结果。

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.7.0/share/tsung/tsung-1.0.dtd">
<tsung loglevel="warning">

  <clients>
    <client host="localhost" use_controller_vm="true"/>
  </clients>

  <servers>
    <server host="127.0.0.1" port="8030" type="tcp"/>
  </servers>

  <load>
    <arrivalphase phase="1" duration="1" unit="minute">
      <users arrivalrate="100" unit="second"/>
    </arrivalphase>
  </load>
  <options>
    <option name="file_server" id="ids" value="id.csv" ></option>
  </options>
  <sessions>
    <session name="dummy" weight="1" type="ts_http">
        <setdynvars sourcetype="file" fileid="ids" order="iter">
            <var name="uid" />
        </setdynvars>
        <request subst="true">
            <http url="/api/v1/locations?user_ids=%%_uid" method="GET"  version="1.1" >
                <http_header name="Content-Type" value="application/json"/>
                <http_header name="RLS-Referrer" value="vivasoftltd.com"/>
            </http>
        </request>
    </session>
  </sessions>
</tsung>

这个配置文件。 而 id.csv 是

1
2
3
4
5
6
7

现在生成报告显示

size_rcv is equal to 0 !
size_sent is equal to 0 !

report.html 显示所有为空和所有错误。 我该如何解决这个问题

【问题讨论】:

    标签: load-testing tsung


    【解决方案1】:

    您的请求中的动态变量替换不正确。

    &lt;http url="/api/v1/locations?user_ids=***%%_uid%%***" method="GET" version="1.1" &gt;

    请查看此link 以获取有关动态变量的 Tsung 文档。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-28
      • 1970-01-01
      • 2014-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多