Authored by Rong

commit by shell

  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<jmeterTestPlan version="1.2" properties="3.1" jmeter="3.1 r1770033">
  3 + <hashTree>
  4 + <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="test2121" enabled="true">
  5 + <stringProp name="TestPlan.comments">YohoPerformanceTest_ThisScriptIsGeneratedByYPT</stringProp>
  6 + <boolProp name="TestPlan.functional_mode">false</boolProp>
  7 + <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
  8 + <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
  9 + <collectionProp name="Arguments.arguments">
  10 + </collectionProp>
  11 + </elementProp>
  12 + <stringProp name="TestPlan.user_define_classpath"></stringProp>
  13 + </TestPlan>
  14 + <hashTree>
  15 + <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="arguments_&#24615;&#33021;&#27979;&#35797;&#29615;&#22659;" enabled="true">
  16 + <collectionProp name="Arguments.arguments">
  17 + <elementProp name="HOST_API" elementType="Argument">
  18 + <stringProp name="Argument.name">HOST_API</stringProp>
  19 + <stringProp name="Argument.value">api-pt.yohoops.org</stringProp>
  20 + <stringProp name="Argument.metadata">=</stringProp>
  21 + </elementProp>
  22 + <elementProp name="HOST_SERVICE" elementType="Argument">
  23 + <stringProp name="Argument.name">HOST_SERVICE</stringProp>
  24 + <stringProp name="Argument.value">service-pt.yohoops.org</stringProp>
  25 + <stringProp name="Argument.metadata">=</stringProp>
  26 + </elementProp>
  27 + <elementProp name="HOST_PC" elementType="Argument">
  28 + <stringProp name="Argument.name">HOST_PC</stringProp>
  29 + <stringProp name="Argument.value">www.yohobuy.com</stringProp>
  30 + <stringProp name="Argument.metadata">=</stringProp>
  31 + </elementProp>
  32 + <elementProp name="HOST_SEARCH" elementType="Argument">
  33 + <stringProp name="Argument.name">HOST_SEARCH</stringProp>
  34 + <stringProp name="Argument.value">searchyohoops.yohobuy.com</stringProp>
  35 + <stringProp name="Argument.metadata">=</stringProp>
  36 + </elementProp>
  37 + <elementProp name="HOST_ITEM" elementType="Argument">
  38 + <stringProp name="Argument.name">HOST_ITEM</stringProp>
  39 + <stringProp name="Argument.value">item.yohobuy.com</stringProp>
  40 + <stringProp name="Argument.metadata">=</stringProp>
  41 + </elementProp>
  42 + <elementProp name="HOST_LIST" elementType="Argument">
  43 + <stringProp name="Argument.name">HOST_LIST</stringProp>
  44 + <stringProp name="Argument.value">list.yohobuy.com</stringProp>
  45 + <stringProp name="Argument.metadata">=</stringProp>
  46 + </elementProp>
  47 + <elementProp name="HOST_SHOP" elementType="Argument">
  48 + <stringProp name="Argument.name">HOST_SHOP</stringProp>
  49 + <stringProp name="Argument.value">izzue.yohobuy.com</stringProp>
  50 + <stringProp name="Argument.metadata">=</stringProp>
  51 + </elementProp>
  52 + <elementProp name="ID_SHOP" elementType="Argument">
  53 + <stringProp name="Argument.name">ID_SHOP</stringProp>
  54 + <stringProp name="Argument.value">1486</stringProp>
  55 + <stringProp name="Argument.metadata">=</stringProp>
  56 + </elementProp>
  57 + <elementProp name="HOST_H5" elementType="Argument">
  58 + <stringProp name="Argument.name">HOST_H5</stringProp>
  59 + <stringProp name="Argument.value">m.yohobuy.com</stringProp>
  60 + <stringProp name="Argument.metadata">=</stringProp>
  61 + </elementProp>
  62 + <elementProp name="HOST_SEARCH_H5" elementType="Argument">
  63 + <stringProp name="Argument.name">HOST_SEARCH_H5</stringProp>
  64 + <stringProp name="Argument.value">search.m.yohobuy.com</stringProp>
  65 + <stringProp name="Argument.metadata">=</stringProp>
  66 + </elementProp>
  67 + <elementProp name="HOST_GUANG_H5" elementType="Argument">
  68 + <stringProp name="Argument.name">HOST_GUANG_H5</stringProp>
  69 + <stringProp name="Argument.value">guang.m.yohobuy.com</stringProp>
  70 + <stringProp name="Argument.metadata">=</stringProp>
  71 + </elementProp>
  72 + <elementProp name="HOST_LIST_H5" elementType="Argument">
  73 + <stringProp name="Argument.name">HOST_LIST_H5</stringProp>
  74 + <stringProp name="Argument.value">list.m.yohobuy.com</stringProp>
  75 + <stringProp name="Argument.metadata">=</stringProp>
  76 + </elementProp>
  77 + </collectionProp>
  78 + <stringProp name="TestPlan.comments"></stringProp> </Arguments>
  79 + <hashTree/>
  80 + <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="arguments_TMP" enabled="true">
  81 + <collectionProp name="Arguments.arguments">
  82 + <elementProp name="HOST_API" elementType="Argument">
  83 + <stringProp name="Argument.name">HOST_API</stringProp>
  84 + <stringProp name="Argument.value">api-test3.dev.yohocorp.com</stringProp>
  85 + <stringProp name="Argument.metadata">=</stringProp>
  86 + </elementProp>
  87 + <elementProp name="activityId" elementType="Argument">
  88 + <stringProp name="Argument.name">activityId</stringProp>
  89 + <stringProp name="Argument.value">414</stringProp>
  90 + <stringProp name="Argument.metadata">=</stringProp>
  91 + </elementProp>
  92 + <elementProp name="HOST_TMP" elementType="Argument">
  93 + <stringProp name="Argument.name">HOST_TMP</stringProp>
  94 + <stringProp name="Argument.value">api-test3.dev.yohocorp.com</stringProp>
  95 + <stringProp name="Argument.metadata">=</stringProp>
  96 + </elementProp>
  97 + <elementProp name="mobile_test" elementType="Argument">
  98 + <stringProp name="Argument.name">mobile_test</stringProp>
  99 + <stringProp name="Argument.value">13770338135</stringProp>
  100 + <stringProp name="Argument.metadata">=</stringProp>
  101 + </elementProp>
  102 + </collectionProp>
  103 + <stringProp name="TestPlan.comments"></stringProp> </Arguments>
  104 + <hashTree/>
  105 + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_mobile_openid_10w" enabled="true">
  106 + <stringProp name="TestPlan.comments"></stringProp>
  107 + <stringProp name="filename">/opt/jmeter/data/uid_mobile_openid.csv</stringProp>
  108 + <stringProp name="fileEncoding">utf-8</stringProp>
  109 + <stringProp name="variableNames">uid,mobile,open_id</stringProp>
  110 + <stringProp name="delimiter">,</stringProp>
  111 + <boolProp name="quotedData">false</boolProp>
  112 + <boolProp name="recycle">true</boolProp>
  113 + <boolProp name="stopThread">false</boolProp>
  114 + <stringProp name="shareMode">shareMode.all</stringProp>
  115 + </CSVDataSet>
  116 + <hashTree/>
  117 + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_&#25240;&#25187;&#27963;&#21160;&#25968;&#25454;" enabled="true">
  118 + <stringProp name="TestPlan.comments"></stringProp>
  119 + <stringProp name="filename">/opt/jmeter/data/activity.csv</stringProp>
  120 + <stringProp name="fileEncoding">utf-8</stringProp>
  121 + <stringProp name="variableNames">activity_id</stringProp>
  122 + <stringProp name="delimiter">,</stringProp>
  123 + <boolProp name="quotedData">false</boolProp>
  124 + <boolProp name="recycle">true</boolProp>
  125 + <boolProp name="stopThread">false</boolProp>
  126 + <stringProp name="shareMode">shareMode.all</stringProp>
  127 + </CSVDataSet>
  128 + <hashTree/>
  129 + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_couponId_20w" enabled="true">
  130 + <stringProp name="TestPlan.comments"></stringProp>
  131 + <stringProp name="filename">/opt/jmeter/data/uid_couponId.csv</stringProp>
  132 + <stringProp name="fileEncoding">utf-8</stringProp>
  133 + <stringProp name="variableNames">uid_coupon,couponId_coupon</stringProp>
  134 + <stringProp name="delimiter">,</stringProp>
  135 + <boolProp name="quotedData">false</boolProp>
  136 + <boolProp name="recycle">true</boolProp>
  137 + <boolProp name="stopThread">false</boolProp>
  138 + <stringProp name="shareMode">shareMode.all</stringProp>
  139 + </CSVDataSet>
  140 + <hashTree/>
  141 + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_/v5/resource/home" enabled="true">
  142 + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  143 + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
  144 + <boolProp name="LoopController.continue_forever">false</boolProp>
  145 + <intProp name="LoopController.loops">-1</intProp>
  146 + </elementProp>
  147 + <stringProp name="ThreadGroup.num_threads">1</stringProp>
  148 + <stringProp name="ThreadGroup.ramp_time">10</stringProp>
  149 + <longProp name="ThreadGroup.start_time">1488865571000</longProp>
  150 + <longProp name="ThreadGroup.end_time">1488865571000</longProp>
  151 + <boolProp name="ThreadGroup.scheduler">false</boolProp>
  152 + <stringProp name="ThreadGroup.duration"></stringProp>
  153 + <stringProp name="ThreadGroup.delay"></stringProp>
  154 + <stringProp name="TestPlan.comments">&#39318;&#39029;&#36164;&#28304;&#20301;</stringProp>
  155 + </ThreadGroup>
  156 + <hashTree>
  157 + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_/v5/resource/home" enabled="true">
  158 + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  159 + <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  160 + <collectionProp name="Arguments.arguments">
  161 + <elementProp name="" elementType="HTTPArgument">
  162 + <boolProp name="HTTPArgument.always_encode">false</boolProp>
  163 + <stringProp name="Argument.value"></stringProp>
  164 + <stringProp name="Argument.metadata">=</stringProp>
  165 + </elementProp>
  166 + </collectionProp>
  167 + </elementProp>
  168 + <stringProp name="HTTPSampler.domain"></stringProp>
  169 + <stringProp name="HTTPSampler.port"></stringProp>
  170 + <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  171 + <stringProp name="HTTPSampler.response_timeout"></stringProp>
  172 + <stringProp name="HTTPSampler.protocol"></stringProp>
  173 + <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  174 + <stringProp name="HTTPSampler.path">http://${HOST_SERVICE}/operations/api/v5/resource/home?${searchValue}</stringProp>
  175 + <stringProp name="HTTPSampler.method">GET</stringProp>
  176 + <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  177 + <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  178 + <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  179 + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  180 + <boolProp name="HTTPSampler.monitor">false</boolProp>
  181 + <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  182 + <stringProp name="TestPlan.comments">&#39318;&#39029;&#36164;&#28304;&#20301;</stringProp>
  183 + </HTTPSamplerProxy>
  184 + <hashTree>
  185 + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="&#21069;&#32622;BeanShell" enabled="true">
  186 + <stringProp name="TestPlan.comments"></stringProp>
  187 + <boolProp name="resetInterpreter">false</boolProp>
  188 + <stringProp name="parameters">${uid}</stringProp>
  189 + <stringProp name="filename"></stringProp>
  190 + <stringProp name="script">import java.security.MessageDigest;
  191 +import java.util.Random;
  192 +String[] clientTypes = {&quot;android&quot;,&quot;iphone&quot;};
  193 +String[] privateKeys = {&quot;fd4ad5fcfa0de589ef238c0e7331b585&quot;,&quot;a85bb0674e08986c6b115d5e3a4884fa&quot;};
  194 +int rd = new Random().nextInt(2);
  195 +String clientType = clientTypes[rd];
  196 +String privateKey = privateKeys[rd];
  197 +
  198 +String req = &quot;app_version=5.8.1&amp;client_type=&quot;+clientType+&quot;&amp;content_code=201504091403001&amp;fromPage=iFP_Home&amp;gender=1,3&amp;limit=100&amp;os_version=10.2.1&amp;page=1&amp;physical_channel=1&amp;private_key=&quot;+privateKey+&quot;&amp;screen_size=414x736&amp;session_key=8be620e2d951d49128232f8b4c392422&amp;udid=380aebe1da2c72def222c78249f99ef08c18260a&amp;uid=&quot;+bsh.args[0]+&quot;&amp;v=7&amp;yh_channel=1&quot;;
  199 +MessageDigest md = MessageDigest.getInstance(&quot;MD5&quot;);
  200 +byte[] btInput = req.getBytes();
  201 +md.update(btInput);
  202 +byte[] btResult = md.digest();
  203 +StringBuffer sb = new StringBuffer();
  204 +for(byte b : btResult){
  205 + int bt = b&amp;0xff;
  206 + if(bt&lt;16){
  207 + sb.append(0);
  208 + }
  209 + sb.append(Integer.toHexString(bt));
  210 +}
  211 +String md5 = sb.toString();
  212 +
  213 +
  214 +vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5);</stringProp>
  215 + </BeanShellPreProcessor>
  216 + <hashTree/>
  217 + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="&#21709;&#24212;&#26029;&#35328;" enabled="true">
  218 + <collectionProp name="Asserion.test_strings">
  219 + <stringProp name="1450572480">&quot;code&quot;:200</stringProp>
  220 + </collectionProp>
  221 + <stringProp name="TestPlan.comments"></stringProp>
  222 + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  223 + <boolProp name="Assertion.assume_success">false</boolProp>
  224 + <intProp name="Assertion.test_type">16</intProp>
  225 + </ResponseAssertion>
  226 + <hashTree/>
  227 + </hashTree>
  228 + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="&#22266;&#23450;TPM" enabled="true">
  229 + <stringProp name="TestPlan.comments"></stringProp>
  230 + <doubleProp>
  231 + <name>throughput</name>
  232 + <value>600</value>
  233 + <savedValue>0.0</savedValue>
  234 + </doubleProp>
  235 + <intProp name="calcMode">2</intProp>
  236 + </ConstantThroughputTimer>
  237 + <hashTree/>
  238 + </hashTree>
  239 + <BackendListener guiclass="BackendListenerGui" testclass="BackendListener" testname="influxdb_master" enabled="true">
  240 + <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
  241 + <collectionProp name="Arguments.arguments">
  242 + <elementProp name="graphiteMetricsSender" elementType="Argument">
  243 + <stringProp name="Argument.name">graphiteMetricsSender</stringProp>
  244 + <stringProp name="Argument.value">org.apache.jmeter.visualizers.backend.graphite.TextGraphiteMetricsSender</stringProp>
  245 + <stringProp name="Argument.metadata">=</stringProp>
  246 + </elementProp>
  247 + <elementProp name="graphiteHost" elementType="Argument">
  248 + <stringProp name="Argument.name">graphiteHost</stringProp>
  249 + <stringProp name="Argument.value">192.168.104.43</stringProp>
  250 + <stringProp name="Argument.metadata">=</stringProp>
  251 + </elementProp>
  252 + <elementProp name="graphitePort" elementType="Argument">
  253 + <stringProp name="Argument.name">graphitePort</stringProp>
  254 + <stringProp name="Argument.value">2003</stringProp>
  255 + <stringProp name="Argument.metadata">=</stringProp>
  256 + </elementProp>
  257 + <elementProp name="rootMetricsPrefix" elementType="Argument">
  258 + <stringProp name="Argument.name">rootMetricsPrefix</stringProp>
  259 + <stringProp name="Argument.value">${__machineIP()}.</stringProp>
  260 + <stringProp name="Argument.metadata">=</stringProp>
  261 + </elementProp>
  262 + <elementProp name="summaryOnly" elementType="Argument">
  263 + <stringProp name="Argument.name">summaryOnly</stringProp>
  264 + <stringProp name="Argument.value">false</stringProp>
  265 + <stringProp name="Argument.metadata">=</stringProp>
  266 + </elementProp>
  267 + <elementProp name="samplersList" elementType="Argument">
  268 + <stringProp name="Argument.name">samplersList</stringProp>
  269 + <stringProp name="Argument.value">tc_.*</stringProp>
  270 + <stringProp name="Argument.metadata">=</stringProp>
  271 + </elementProp>
  272 + <elementProp name="useRegexpForSamplersList" elementType="Argument">
  273 + <stringProp name="Argument.name">useRegexpForSamplersList</stringProp>
  274 + <stringProp name="Argument.value">true</stringProp>
  275 + <stringProp name="Argument.metadata">=</stringProp>
  276 + </elementProp>
  277 + <elementProp name="percentiles" elementType="Argument">
  278 + <stringProp name="Argument.name">percentiles</stringProp>
  279 + <stringProp name="Argument.value">90</stringProp>
  280 + <stringProp name="Argument.metadata">=</stringProp>
  281 + </elementProp>
  282 + </collectionProp>
  283 + </elementProp>
  284 + <stringProp name="classname">org.apache.jmeter.visualizers.backend.graphite.GraphiteBackendListenerClient</stringProp>
  285 + <stringProp name="TestPlan.comments"></stringProp>
  286 + </BackendListener>
  287 + <hashTree/> </hashTree>
  288 + </hashTree>
  289 +</jmeterTestPlan>