Authored by jack

增加redis test日志

... ... @@ -328,24 +328,35 @@ public class RedisTask extends Task {
if (StringUtils.equals("master", info.getRole())) {
if (client.isConnected()) {
DEBUG.info("Start to set key {} value {} time {}", testKey, testValue, System.currentTimeMillis());
long startSet = System.currentTimeMillis();
DEBUG.info("Start to set key {} value {} time {}", testKey, testValue, startSet);
//写主 读主
client.set(testKey.getBytes(), testValue.getBytes());
DEBUG.info("End to set key {} value {} time {}", testKey, testValue, System.currentTimeMillis());
long endSet = System.currentTimeMillis();
DEBUG.info("End to set key {} value {} time {}", testKey, testValue, endSet);
Thread.sleep(1000);
DEBUG.info("Start to get key {} value {} time {}", testKey, testValue, System.currentTimeMillis());
long startGet = System.currentTimeMillis();
DEBUG.info("Start to get key {} value {} time {}", testKey, testValue, startGet);
String testResult = new String(client.get(testKey.getBytes()));
DEBUG.info("End to get key {} value {} time {}", testKey, testValue, System.currentTimeMillis());
long endGet = System.currentTimeMillis();
DEBUG.info("End to get key {} value {} time {}", testKey, testValue, endGet);
if (StringUtils.equals(testValue, testResult)) {
return true;
}
DEBUG.info("test value {} is not equal result {} end set time {} ,end get time {}", testValue, testResult, endSet, endGet);
}
} else {
... ...