Showing
1 changed file
with
15 additions
and
4 deletions
@@ -328,24 +328,35 @@ public class RedisTask extends Task { | @@ -328,24 +328,35 @@ public class RedisTask extends Task { | ||
328 | if (StringUtils.equals("master", info.getRole())) { | 328 | if (StringUtils.equals("master", info.getRole())) { |
329 | 329 | ||
330 | if (client.isConnected()) { | 330 | if (client.isConnected()) { |
331 | - DEBUG.info("Start to set key {} value {} time {}", testKey, testValue, System.currentTimeMillis()); | 331 | + |
332 | + long startSet = System.currentTimeMillis(); | ||
333 | + | ||
334 | + DEBUG.info("Start to set key {} value {} time {}", testKey, testValue, startSet); | ||
332 | //写主 读主 | 335 | //写主 读主 |
333 | client.set(testKey.getBytes(), testValue.getBytes()); | 336 | client.set(testKey.getBytes(), testValue.getBytes()); |
334 | 337 | ||
335 | - DEBUG.info("End to set key {} value {} time {}", testKey, testValue, System.currentTimeMillis()); | 338 | + long endSet = System.currentTimeMillis(); |
339 | + | ||
340 | + DEBUG.info("End to set key {} value {} time {}", testKey, testValue, endSet); | ||
336 | 341 | ||
337 | Thread.sleep(1000); | 342 | Thread.sleep(1000); |
338 | 343 | ||
339 | - DEBUG.info("Start to get key {} value {} time {}", testKey, testValue, System.currentTimeMillis()); | 344 | + long startGet = System.currentTimeMillis(); |
345 | + | ||
346 | + DEBUG.info("Start to get key {} value {} time {}", testKey, testValue, startGet); | ||
340 | 347 | ||
341 | String testResult = new String(client.get(testKey.getBytes())); | 348 | String testResult = new String(client.get(testKey.getBytes())); |
342 | 349 | ||
343 | - DEBUG.info("End to get key {} value {} time {}", testKey, testValue, System.currentTimeMillis()); | 350 | + long endGet = System.currentTimeMillis(); |
351 | + | ||
352 | + DEBUG.info("End to get key {} value {} time {}", testKey, testValue, endGet); | ||
344 | 353 | ||
345 | if (StringUtils.equals(testValue, testResult)) { | 354 | if (StringUtils.equals(testValue, testResult)) { |
346 | 355 | ||
347 | return true; | 356 | return true; |
348 | } | 357 | } |
358 | + | ||
359 | + DEBUG.info("test value {} is not equal result {} end set time {} ,end get time {}", testValue, testResult, endSet, endGet); | ||
349 | } | 360 | } |
350 | 361 | ||
351 | } else { | 362 | } else { |
-
Please register or login to post a comment