graph_mix_rule.jmx 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 2022 EMQ Technologies Co., Ltd.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.3">
  18. <hashTree>
  19. <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
  20. <stringProp name="TestPlan.comments"></stringProp>
  21. <boolProp name="TestPlan.functional_mode">false</boolProp>
  22. <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
  23. <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
  24. <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  25. <collectionProp name="Arguments.arguments"/>
  26. </elementProp>
  27. <stringProp name="TestPlan.user_define_classpath"></stringProp>
  28. </TestPlan>
  29. <hashTree>
  30. <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  31. <collectionProp name="Arguments.arguments">
  32. <elementProp name="srv" elementType="Argument">
  33. <stringProp name="Argument.name">srv</stringProp>
  34. <stringProp name="Argument.value">127.0.0.1</stringProp>
  35. <stringProp name="Argument.metadata">=</stringProp>
  36. </elementProp>
  37. <elementProp name="rest_port" elementType="Argument">
  38. <stringProp name="Argument.name">rest_port</stringProp>
  39. <stringProp name="Argument.value">9081</stringProp>
  40. <stringProp name="Argument.metadata">=</stringProp>
  41. </elementProp>
  42. <elementProp name="mqtt_srv" elementType="Argument">
  43. <stringProp name="Argument.name">mqtt_srv</stringProp>
  44. <stringProp name="Argument.value">127.0.0.1</stringProp>
  45. <stringProp name="Argument.metadata">=</stringProp>
  46. </elementProp>
  47. </collectionProp>
  48. </Arguments>
  49. <hashTree/>
  50. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Rules" enabled="true">
  51. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  52. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  53. <boolProp name="LoopController.continue_forever">false</boolProp>
  54. <stringProp name="LoopController.loops">1</stringProp>
  55. </elementProp>
  56. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  57. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  58. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  59. <stringProp name="ThreadGroup.duration"></stringProp>
  60. <stringProp name="ThreadGroup.delay"></stringProp>
  61. <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
  62. </ThreadGroup>
  63. <hashTree>
  64. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  65. <boolProp name="ResultCollector.error_logging">false</boolProp>
  66. <objProp>
  67. <name>saveConfig</name>
  68. <value class="SampleSaveConfiguration">
  69. <time>true</time>
  70. <latency>true</latency>
  71. <timestamp>true</timestamp>
  72. <success>true</success>
  73. <label>true</label>
  74. <code>true</code>
  75. <message>true</message>
  76. <threadName>true</threadName>
  77. <dataType>true</dataType>
  78. <encoding>false</encoding>
  79. <assertions>true</assertions>
  80. <subresults>true</subresults>
  81. <responseData>false</responseData>
  82. <samplerData>false</samplerData>
  83. <xml>false</xml>
  84. <fieldNames>true</fieldNames>
  85. <responseHeaders>false</responseHeaders>
  86. <requestHeaders>false</requestHeaders>
  87. <responseDataOnError>false</responseDataOnError>
  88. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  89. <assertionsResultsToSave>0</assertionsResultsToSave>
  90. <bytes>true</bytes>
  91. <sentBytes>true</sentBytes>
  92. <threadCounts>true</threadCounts>
  93. <idleTime>true</idleTime>
  94. <connectTime>true</connectTime>
  95. </value>
  96. </objProp>
  97. <stringProp name="filename"></stringProp>
  98. </ResultCollector>
  99. <hashTree/>
  100. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="API" enabled="true">
  101. <boolProp name="TransactionController.includeTimers">false</boolProp>
  102. <boolProp name="TransactionController.parent">false</boolProp>
  103. </TransactionController>
  104. <hashTree>
  105. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  106. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  107. <stringProp name="mqtt.port">1883</stringProp>
  108. <stringProp name="mqtt.version">3.1</stringProp>
  109. <stringProp name="mqtt.conn_timeout">10</stringProp>
  110. <boolProp name="mqtt.private_protocol">false</boolProp>
  111. <stringProp name="mqtt.listener_timeout">10</stringProp>
  112. <stringProp name="mqtt.protocol">TCP</stringProp>
  113. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  114. <stringProp name="mqtt.keystore_file_path"></stringProp>
  115. <stringProp name="mqtt.keystore_password"></stringProp>
  116. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  117. <stringProp name="mqtt.clientcert_password"></stringProp>
  118. <stringProp name="mqtt.user_name"></stringProp>
  119. <stringProp name="mqtt.password"></stringProp>
  120. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  121. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  122. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  123. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  124. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  125. <boolProp name="mqtt.conn_clean_session">true</boolProp>
  126. </net.xmeter.samplers.ConnectSampler>
  127. <hashTree/>
  128. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateRule" enabled="true">
  129. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  130. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  131. <collectionProp name="Arguments.arguments">
  132. <elementProp name="" elementType="HTTPArgument">
  133. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  134. <stringProp name="Argument.value">{&#xd;
  135. &quot;id&quot;: &quot;rule1&quot;,&#xd;
  136. &quot;name&quot;: &quot;混合规则&quot;,&#xd;
  137. &quot;graph&quot;: {&#xd;
  138. &quot;nodes&quot;: {&#xd;
  139. &quot;demo&quot;: {&#xd;
  140. &quot;type&quot;: &quot;source&quot;,&#xd;
  141. &quot;nodeType&quot;: &quot;mqtt&quot;,&#xd;
  142. &quot;props&quot;: {&#xd;
  143. &quot;datasource&quot;: &quot;devices/+/messages&quot;,&#xd;
  144. &quot;timestamp&quot;: &quot;ts&quot;&#xd;
  145. }&#xd;
  146. },&#xd;
  147. &quot;myfilter&quot;: {&#xd;
  148. &quot;type&quot;: &quot;operator&quot;,&#xd;
  149. &quot;nodeType&quot;: &quot;filter&quot;,&#xd;
  150. &quot;props&quot;: {&#xd;
  151. &quot;expr&quot;: &quot;temperature &gt; 20&quot;&#xd;
  152. }&#xd;
  153. },&#xd;
  154. &quot;logfunc&quot;: {&#xd;
  155. &quot;type&quot;: &quot;operator&quot;,&#xd;
  156. &quot;nodeType&quot;: &quot;function&quot;,&#xd;
  157. &quot;props&quot;: {&#xd;
  158. &quot;expr&quot;: &quot;log(temperature) as log_temperature&quot;&#xd;
  159. }&#xd;
  160. },&#xd;
  161. &quot;sinfunc&quot;: {&#xd;
  162. &quot;type&quot;: &quot;operator&quot;,&#xd;
  163. &quot;nodeType&quot;: &quot;function&quot;,&#xd;
  164. &quot;props&quot;: {&#xd;
  165. &quot;expr&quot;: &quot;sin(temperature) as sin_temperature&quot;&#xd;
  166. }&#xd;
  167. },&#xd;
  168. &quot;window&quot;: {&#xd;
  169. &quot;type&quot;: &quot;operator&quot;,&#xd;
  170. &quot;nodeType&quot;: &quot;window&quot;,&#xd;
  171. &quot;props&quot;: {&#xd;
  172. &quot;type&quot;: &quot;slidingwindow&quot;,&#xd;
  173. &quot;unit&quot;: &quot;ss&quot;,&#xd;
  174. &quot;size&quot;: 1&#xd;
  175. }&#xd;
  176. },&#xd;
  177. &quot;winfilter&quot;: {&#xd;
  178. &quot;type&quot;: &quot;operator&quot;,&#xd;
  179. &quot;nodeType&quot;: &quot;filter&quot;,&#xd;
  180. &quot;props&quot;: {&#xd;
  181. &quot;expr&quot;: &quot;humidity &gt; 30&quot;&#xd;
  182. }&#xd;
  183. },&#xd;
  184. &quot;aggfunc&quot;: {&#xd;
  185. &quot;type&quot;: &quot;operator&quot;,&#xd;
  186. &quot;nodeType&quot;: &quot;aggFunc&quot;,&#xd;
  187. &quot;props&quot;: {&#xd;
  188. &quot;expr&quot;: &quot;avg(temperature) as avg_temperature&quot;&#xd;
  189. }&#xd;
  190. },&#xd;
  191. &quot;pick&quot;: {&#xd;
  192. &quot;type&quot;: &quot;operator&quot;,&#xd;
  193. &quot;nodeType&quot;: &quot;pick&quot;,&#xd;
  194. &quot;props&quot;: {&#xd;
  195. &quot;fields&quot;: [&quot;log_temperature&quot;, &quot;humidity&quot;]&#xd;
  196. }&#xd;
  197. },&#xd;
  198. &quot;mqtt1&quot;: {&#xd;
  199. &quot;type&quot;: &quot;sink&quot;,&#xd;
  200. &quot;nodeType&quot;: &quot;mqtt&quot;,&#xd;
  201. &quot;props&quot;: {&#xd;
  202. &quot;server&quot;: &quot;tcp://${mqtt_srv}:1883&quot;,&#xd;
  203. &quot;topic&quot;: &quot;result1&quot;,&#xd;
  204. &quot;sendSingle&quot;: true&#xd;
  205. }&#xd;
  206. },&#xd;
  207. &quot;mqtt2&quot;: {&#xd;
  208. &quot;type&quot;: &quot;sink&quot;,&#xd;
  209. &quot;nodeType&quot;: &quot;mqtt&quot;,&#xd;
  210. &quot;props&quot;: {&#xd;
  211. &quot;server&quot;: &quot;tcp://${mqtt_srv}:1883&quot;,&#xd;
  212. &quot;topic&quot;: &quot;result2&quot;,&#xd;
  213. &quot;sendSingle&quot;: true&#xd;
  214. }&#xd;
  215. }&#xd;
  216. },&#xd;
  217. &quot;topo&quot;: {&#xd;
  218. &quot;sources&quot;: [&quot;demo&quot;],&#xd;
  219. &quot;edges&quot;: {&#xd;
  220. &quot;demo&quot;: [&quot;myfilter&quot;, &quot;sinfunc&quot;],&#xd;
  221. &quot;myfilter&quot;: [&quot;logfunc&quot;],&#xd;
  222. &quot;logfunc&quot;: [&quot;pick&quot;],&#xd;
  223. &quot;pick&quot;: [&quot;mqtt1&quot;],&#xd;
  224. &quot;sinfunc&quot;: [&quot;window&quot;],&#xd;
  225. &quot;window&quot;: [&quot;winfilter&quot;],&#xd;
  226. &quot;winfilter&quot;: [&quot;aggfunc&quot;],&#xd;
  227. &quot;aggfunc&quot;: [&quot;mqtt2&quot;]&#xd;
  228. }&#xd;
  229. }&#xd;
  230. }&#xd;
  231. }</stringProp>
  232. <stringProp name="Argument.metadata">=</stringProp>
  233. </elementProp>
  234. </collectionProp>
  235. </elementProp>
  236. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  237. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  238. <stringProp name="HTTPSampler.protocol"></stringProp>
  239. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  240. <stringProp name="HTTPSampler.path">/rules</stringProp>
  241. <stringProp name="HTTPSampler.method">POST</stringProp>
  242. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  243. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  244. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  245. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  246. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  247. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  248. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  249. </HTTPSamplerProxy>
  250. <hashTree>
  251. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  252. <collectionProp name="Asserion.test_strings">
  253. <stringProp name="-2022196798">Rule rule1 was created</stringProp>
  254. </collectionProp>
  255. <stringProp name="Assertion.custom_message"></stringProp>
  256. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  257. <boolProp name="Assertion.assume_success">true</boolProp>
  258. <intProp name="Assertion.test_type">16</intProp>
  259. </ResponseAssertion>
  260. <hashTree/>
  261. </hashTree>
  262. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  263. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  264. <collectionProp name="Arguments.arguments"/>
  265. </elementProp>
  266. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  267. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  268. <stringProp name="HTTPSampler.protocol"></stringProp>
  269. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  270. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  271. <stringProp name="HTTPSampler.method">GET</stringProp>
  272. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  273. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  274. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  275. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  276. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  277. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  278. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  279. </HTTPSamplerProxy>
  280. <hashTree>
  281. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  282. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  283. <stringProp name="EXPECTED_VALUE">0</stringProp>
  284. <boolProp name="JSONVALIDATION">true</boolProp>
  285. <boolProp name="EXPECT_NULL">false</boolProp>
  286. <boolProp name="INVERT">false</boolProp>
  287. <boolProp name="ISREGEX">false</boolProp>
  288. </JSONPathAssertion>
  289. <hashTree/>
  290. </hashTree>
  291. <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="loop_controller" enabled="true">
  292. <boolProp name="LoopController.continue_forever">true</boolProp>
  293. <stringProp name="LoopController.loops">5</stringProp>
  294. </LoopController>
  295. <hashTree>
  296. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  297. <stringProp name="delimiter">,</stringProp>
  298. <stringProp name="fileEncoding"></stringProp>
  299. <stringProp name="filename">iot_data_ts.txt</stringProp>
  300. <boolProp name="ignoreFirstLine">false</boolProp>
  301. <boolProp name="quotedData">false</boolProp>
  302. <boolProp name="recycle">true</boolProp>
  303. <stringProp name="shareMode">shareMode.thread</stringProp>
  304. <boolProp name="stopThread">false</boolProp>
  305. <stringProp name="variableNames">device_id,ts,temperature,humidity</stringProp>
  306. </CSVDataSet>
  307. <hashTree/>
  308. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT Pub Sampler" enabled="true">
  309. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  310. <stringProp name="mqtt.qos_level">0</stringProp>
  311. <boolProp name="mqtt.add_timestamp">false</boolProp>
  312. <stringProp name="mqtt.message_type">String</stringProp>
  313. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  314. <stringProp name="mqtt.message_to_sent">{&quot;device_id&quot;:${device_id},&quot;ts&quot;:${ts},&quot;temperature&quot;: ${temperature}, &quot;humidity&quot; : ${humidity}}</stringProp>
  315. <boolProp name="mqtt.retained_message">false</boolProp>
  316. </net.xmeter.samplers.PubSampler>
  317. <hashTree/>
  318. </hashTree>
  319. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  320. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  321. <collectionProp name="Arguments.arguments"/>
  322. </elementProp>
  323. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  324. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  325. <stringProp name="HTTPSampler.protocol"></stringProp>
  326. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  327. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  328. <stringProp name="HTTPSampler.method">GET</stringProp>
  329. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  330. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  331. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  332. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  333. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  334. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  335. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  336. </HTTPSamplerProxy>
  337. <hashTree>
  338. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  339. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  340. <stringProp name="EXPECTED_VALUE">5</stringProp>
  341. <boolProp name="JSONVALIDATION">true</boolProp>
  342. <boolProp name="EXPECT_NULL">false</boolProp>
  343. <boolProp name="INVERT">false</boolProp>
  344. <boolProp name="ISREGEX">false</boolProp>
  345. </JSONPathAssertion>
  346. <hashTree/>
  347. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  348. <stringProp name="JSON_PATH">$.sink_mqtt1_0_records_out_total</stringProp>
  349. <stringProp name="EXPECTED_VALUE">5</stringProp>
  350. <boolProp name="JSONVALIDATION">true</boolProp>
  351. <boolProp name="EXPECT_NULL">false</boolProp>
  352. <boolProp name="INVERT">false</boolProp>
  353. <boolProp name="ISREGEX">false</boolProp>
  354. </JSONPathAssertion>
  355. <hashTree/>
  356. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  357. <stringProp name="JSON_PATH">$.sink_mqtt2_0_records_out_total</stringProp>
  358. <stringProp name="EXPECTED_VALUE">4</stringProp>
  359. <boolProp name="JSONVALIDATION">true</boolProp>
  360. <boolProp name="EXPECT_NULL">false</boolProp>
  361. <boolProp name="INVERT">false</boolProp>
  362. <boolProp name="ISREGEX">false</boolProp>
  363. </JSONPathAssertion>
  364. <hashTree/>
  365. </hashTree>
  366. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_DropRule" enabled="true">
  367. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  368. <collectionProp name="Arguments.arguments"/>
  369. </elementProp>
  370. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  371. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  372. <stringProp name="HTTPSampler.protocol"></stringProp>
  373. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  374. <stringProp name="HTTPSampler.path">/rules/rule1</stringProp>
  375. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  376. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  377. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  378. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  379. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  380. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  381. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  382. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  383. </HTTPSamplerProxy>
  384. <hashTree>
  385. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  386. <collectionProp name="Asserion.test_strings">
  387. <stringProp name="717250485">Rule rule1 is dropped.</stringProp>
  388. </collectionProp>
  389. <stringProp name="Assertion.custom_message"></stringProp>
  390. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  391. <boolProp name="Assertion.assume_success">false</boolProp>
  392. <intProp name="Assertion.test_type">16</intProp>
  393. </ResponseAssertion>
  394. <hashTree/>
  395. </hashTree>
  396. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  397. <stringProp name="ConstantTimer.delay">500</stringProp>
  398. </ConstantTimer>
  399. <hashTree/>
  400. </hashTree>
  401. </hashTree>
  402. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Result" enabled="true">
  403. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  404. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  405. <boolProp name="LoopController.continue_forever">false</boolProp>
  406. <stringProp name="LoopController.loops">5</stringProp>
  407. </elementProp>
  408. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  409. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  410. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  411. <stringProp name="ThreadGroup.duration"></stringProp>
  412. <stringProp name="ThreadGroup.delay"></stringProp>
  413. <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
  414. </ThreadGroup>
  415. <hashTree>
  416. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  417. <boolProp name="ResultCollector.error_logging">false</boolProp>
  418. <objProp>
  419. <name>saveConfig</name>
  420. <value class="SampleSaveConfiguration">
  421. <time>true</time>
  422. <latency>true</latency>
  423. <timestamp>true</timestamp>
  424. <success>true</success>
  425. <label>true</label>
  426. <code>true</code>
  427. <message>true</message>
  428. <threadName>true</threadName>
  429. <dataType>true</dataType>
  430. <encoding>false</encoding>
  431. <assertions>true</assertions>
  432. <subresults>true</subresults>
  433. <responseData>false</responseData>
  434. <samplerData>false</samplerData>
  435. <xml>false</xml>
  436. <fieldNames>true</fieldNames>
  437. <responseHeaders>false</responseHeaders>
  438. <requestHeaders>false</requestHeaders>
  439. <responseDataOnError>false</responseDataOnError>
  440. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  441. <assertionsResultsToSave>0</assertionsResultsToSave>
  442. <bytes>true</bytes>
  443. <sentBytes>true</sentBytes>
  444. <threadCounts>true</threadCounts>
  445. <idleTime>true</idleTime>
  446. <connectTime>true</connectTime>
  447. </value>
  448. </objProp>
  449. <stringProp name="filename"></stringProp>
  450. </ResultCollector>
  451. <hashTree/>
  452. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  453. <stringProp name="delimiter">,</stringProp>
  454. <stringProp name="fileEncoding"></stringProp>
  455. <stringProp name="filename">graph_mix_rule_result1.txt</stringProp>
  456. <boolProp name="ignoreFirstLine">false</boolProp>
  457. <boolProp name="quotedData">false</boolProp>
  458. <boolProp name="recycle">true</boolProp>
  459. <stringProp name="shareMode">shareMode.group</stringProp>
  460. <boolProp name="stopThread">false</boolProp>
  461. <stringProp name="variableNames">humidity,log</stringProp>
  462. </CSVDataSet>
  463. <hashTree/>
  464. <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"/>
  465. <hashTree>
  466. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  467. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  468. <stringProp name="mqtt.port">1883</stringProp>
  469. <stringProp name="mqtt.version">3.1</stringProp>
  470. <stringProp name="mqtt.conn_timeout">10</stringProp>
  471. <boolProp name="mqtt.private_protocol">false</boolProp>
  472. <stringProp name="mqtt.listener_timeout">10</stringProp>
  473. <stringProp name="mqtt.protocol">TCP</stringProp>
  474. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  475. <stringProp name="mqtt.keystore_file_path"></stringProp>
  476. <stringProp name="mqtt.keystore_password"></stringProp>
  477. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  478. <stringProp name="mqtt.clientcert_password"></stringProp>
  479. <stringProp name="mqtt.user_name"></stringProp>
  480. <stringProp name="mqtt.password"></stringProp>
  481. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  482. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  483. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  484. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  485. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  486. <boolProp name="mqtt.conn_clean_session">true</boolProp>
  487. </net.xmeter.samplers.ConnectSampler>
  488. <hashTree/>
  489. </hashTree>
  490. <net.xmeter.samplers.SubSampler guiclass="net.xmeter.gui.SubSamplerUI" testclass="net.xmeter.samplers.SubSampler" testname="AnalysisResult" enabled="true">
  491. <stringProp name="mqtt.topic_name">result1</stringProp>
  492. <stringProp name="mqtt.qos_level">0</stringProp>
  493. <boolProp name="mqtt.add_timestamp">false</boolProp>
  494. <boolProp name="mqtt.debug_response">true</boolProp>
  495. <stringProp name="mqtt.sample_condition">number of received messages</stringProp>
  496. <stringProp name="mqtt.sample_condition_value">1</stringProp>
  497. </net.xmeter.samplers.SubSampler>
  498. <hashTree>
  499. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="humidity Assertion" enabled="true">
  500. <stringProp name="JSON_PATH">$.humidity</stringProp>
  501. <stringProp name="EXPECTED_VALUE">${humidity}</stringProp>
  502. <boolProp name="JSONVALIDATION">true</boolProp>
  503. <boolProp name="EXPECT_NULL">false</boolProp>
  504. <boolProp name="INVERT">false</boolProp>
  505. <boolProp name="ISREGEX">false</boolProp>
  506. </JSONPathAssertion>
  507. <hashTree/>
  508. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="log Assertion" enabled="true">
  509. <stringProp name="JSON_PATH">$.log_temperature</stringProp>
  510. <stringProp name="EXPECTED_VALUE">${log}</stringProp>
  511. <boolProp name="JSONVALIDATION">true</boolProp>
  512. <boolProp name="EXPECT_NULL">false</boolProp>
  513. <boolProp name="INVERT">false</boolProp>
  514. <boolProp name="ISREGEX">false</boolProp>
  515. </JSONPathAssertion>
  516. <hashTree/>
  517. </hashTree>
  518. </hashTree>
  519. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Result" enabled="true">
  520. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  521. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  522. <boolProp name="LoopController.continue_forever">false</boolProp>
  523. <stringProp name="LoopController.loops">4</stringProp>
  524. </elementProp>
  525. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  526. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  527. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  528. <stringProp name="ThreadGroup.duration"></stringProp>
  529. <stringProp name="ThreadGroup.delay"></stringProp>
  530. <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
  531. </ThreadGroup>
  532. <hashTree>
  533. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  534. <boolProp name="ResultCollector.error_logging">false</boolProp>
  535. <objProp>
  536. <name>saveConfig</name>
  537. <value class="SampleSaveConfiguration">
  538. <time>true</time>
  539. <latency>true</latency>
  540. <timestamp>true</timestamp>
  541. <success>true</success>
  542. <label>true</label>
  543. <code>true</code>
  544. <message>true</message>
  545. <threadName>true</threadName>
  546. <dataType>true</dataType>
  547. <encoding>false</encoding>
  548. <assertions>true</assertions>
  549. <subresults>true</subresults>
  550. <responseData>false</responseData>
  551. <samplerData>false</samplerData>
  552. <xml>false</xml>
  553. <fieldNames>true</fieldNames>
  554. <responseHeaders>false</responseHeaders>
  555. <requestHeaders>false</requestHeaders>
  556. <responseDataOnError>false</responseDataOnError>
  557. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  558. <assertionsResultsToSave>0</assertionsResultsToSave>
  559. <bytes>true</bytes>
  560. <sentBytes>true</sentBytes>
  561. <threadCounts>true</threadCounts>
  562. <idleTime>true</idleTime>
  563. <connectTime>true</connectTime>
  564. </value>
  565. </objProp>
  566. <stringProp name="filename"></stringProp>
  567. </ResultCollector>
  568. <hashTree/>
  569. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  570. <stringProp name="delimiter">,</stringProp>
  571. <stringProp name="fileEncoding"></stringProp>
  572. <stringProp name="filename">graph_mix_rule_result2.txt</stringProp>
  573. <boolProp name="ignoreFirstLine">false</boolProp>
  574. <boolProp name="quotedData">false</boolProp>
  575. <boolProp name="recycle">true</boolProp>
  576. <stringProp name="shareMode">shareMode.group</stringProp>
  577. <boolProp name="stopThread">false</boolProp>
  578. <stringProp name="variableNames">avg,sin</stringProp>
  579. </CSVDataSet>
  580. <hashTree/>
  581. <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"/>
  582. <hashTree>
  583. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  584. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  585. <stringProp name="mqtt.port">1883</stringProp>
  586. <stringProp name="mqtt.version">3.1</stringProp>
  587. <stringProp name="mqtt.conn_timeout">10</stringProp>
  588. <boolProp name="mqtt.private_protocol">false</boolProp>
  589. <stringProp name="mqtt.listener_timeout">10</stringProp>
  590. <stringProp name="mqtt.protocol">TCP</stringProp>
  591. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  592. <stringProp name="mqtt.keystore_file_path"></stringProp>
  593. <stringProp name="mqtt.keystore_password"></stringProp>
  594. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  595. <stringProp name="mqtt.clientcert_password"></stringProp>
  596. <stringProp name="mqtt.user_name"></stringProp>
  597. <stringProp name="mqtt.password"></stringProp>
  598. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  599. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  600. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  601. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  602. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  603. <boolProp name="mqtt.conn_clean_session">true</boolProp>
  604. </net.xmeter.samplers.ConnectSampler>
  605. <hashTree/>
  606. </hashTree>
  607. <net.xmeter.samplers.SubSampler guiclass="net.xmeter.gui.SubSamplerUI" testclass="net.xmeter.samplers.SubSampler" testname="AnalysisResult" enabled="true">
  608. <stringProp name="mqtt.topic_name">result2</stringProp>
  609. <stringProp name="mqtt.qos_level">0</stringProp>
  610. <boolProp name="mqtt.add_timestamp">false</boolProp>
  611. <boolProp name="mqtt.debug_response">true</boolProp>
  612. <stringProp name="mqtt.sample_condition">number of received messages</stringProp>
  613. <stringProp name="mqtt.sample_condition_value">1</stringProp>
  614. </net.xmeter.samplers.SubSampler>
  615. <hashTree>
  616. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="avg Assertion" enabled="true">
  617. <stringProp name="JSON_PATH">$.avg_temperature</stringProp>
  618. <stringProp name="EXPECTED_VALUE">${avg}</stringProp>
  619. <boolProp name="JSONVALIDATION">true</boolProp>
  620. <boolProp name="EXPECT_NULL">false</boolProp>
  621. <boolProp name="INVERT">false</boolProp>
  622. <boolProp name="ISREGEX">false</boolProp>
  623. </JSONPathAssertion>
  624. <hashTree/>
  625. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="sin Assertion" enabled="true">
  626. <stringProp name="JSON_PATH">$.sin_temperature</stringProp>
  627. <stringProp name="EXPECTED_VALUE">${sin}</stringProp>
  628. <boolProp name="JSONVALIDATION">true</boolProp>
  629. <boolProp name="EXPECT_NULL">false</boolProp>
  630. <boolProp name="INVERT">false</boolProp>
  631. <boolProp name="ISREGEX">false</boolProp>
  632. </JSONPathAssertion>
  633. <hashTree/>
  634. </hashTree>
  635. </hashTree>
  636. </hashTree>
  637. </hashTree>
  638. </jmeterTestPlan>