Authored by jack

更新命中率展示

@@ -235,7 +235,7 @@ public class OneJob implements Callable { @@ -235,7 +235,7 @@ public class OneJob implements Callable {
235 235
236 String cmdSetRate = "0.00"; 236 String cmdSetRate = "0.00";
237 237
238 - String hitRate = "0.00"; 238 + String hitRate = "100";
239 239
240 if (memcacheModel.getUpTime() > lastMemcachModel.getUpTime()) { 240 if (memcacheModel.getUpTime() > lastMemcachModel.getUpTime()) {
241 241
@@ -249,10 +249,11 @@ public class OneJob implements Callable { @@ -249,10 +249,11 @@ public class OneJob implements Callable {
249 249
250 memcacheView.setCmdSet(cmdSetRate); 250 memcacheView.setCmdSet(cmdSetRate);
251 251
  252 + if (memcacheModel.getCmdGetHitCount() != memcacheModel.getCmdGetCount() && 0 != memcacheModel.getCmdGetCount()) {
  253 + hitRate = String.valueOf(memcacheModel.getCmdGetHitCount() * 100 / memcacheModel.getCmdGetCount());
  254 + }
252 255
253 - hitRate = decimalFormat.format(memcacheModel.getCmdGetHitCount() * 1.00d / memcacheModel.getCmdGetCount());  
254 -  
255 - memcacheView.setHitRate(hitRate); 256 + memcacheView.setHitRate(hitRate + "%");
256 257
257 memcacheView.setUrl(this.url); 258 memcacheView.setUrl(this.url);
258 259