2017-02-11 57 views
2

我嘗試使用Jmeter中的Redis數據集插件從Redis獲取價值。如果Redis鍵很簡單(如示例https://www.youtube.com/watch?v=u0vu3tfrdKc),則可以提取其值,而不會有任何問題。在我的情況下,該值存儲在複雜的密鑰中,例如 - user.confirmation.6869427a27e784f7e7cbb0746714c27d,當我在Redis數據集中將它用作「Redis Key:」的值時,屏幕上彈出以下消息腳本不執行,並且jmeter鍵值不會返回:使用Jmeter Redis數據集從Redis獲取價值

2017/02/11 12:57:57 INFO - jmeter.engine.StandardJMeterEngine: Running the test! 
2017/02/11 12:57:57 INFO - jmeter.samplers.SampleEvent: List of sample_variables: [] 
2017/02/11 12:57:57 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*) 
2017/02/11 12:57:58 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group User Service 
2017/02/11 12:57:58 INFO - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Thread Group User Service. 
2017/02/11 12:57:58 INFO - jmeter.engine.StandardJMeterEngine: Thread will start next loop on error 
2017/02/11 12:57:58 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false 
2017/02/11 12:57:58 INFO - jmeter.threads.ThreadGroup: Started thread group number 1 
2017/02/11 12:57:58 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started 
2017/02/11 12:57:58 INFO - jmeter.threads.JMeterThread: Thread started: Thread Group User Service 1-1 
2017/02/11 12:57:58 INFO - jmeter.threads.JMeterThread: Stop Thread seen: org.apache.jorphan.util.JMeterStopThreadException: End of redis data detected, thread will exit 
2017/02/11 12:57:58 INFO - jmeter.threads.JMeterThread: Thread finished: Thread Group User Service 1-1 
2017/02/11 12:57:58 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test 
2017/02/11 12:57:58 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*) 

此外,在Redis控制檯本身接收值時沒有問題。 嘗試在關鍵點中篩選點也無濟於事。 我期待您的回覆,並提出任何意見。

回答

1

爲了測試,我創建了設置這樣的Redis的(鍵,值):

key: user.confirmation.6869427a27e784f7e7cbb0746714c27d 
row1: user.confirmation.6869427a27e784f7e7cbb0746714c27d 
row2: test 

而且我可以檢索與Redis的數據集兩行數據,所以它接縫的問題是不相關的名字很長,但是這個名字在你的Redis數據存儲和JMeter中可能不一樣。這就是爲什麼JMeter抱怨:「檢測到redis數據結束,線程將退出

+0

當Redis值存儲在List或Set數據類型中時,此解決方案工作正常。但以我的方式使用String。 – user2298869