Changeset 870 for MDService2/trunk/MDService2/src/eu
- Timestamp:
- 11/10/10 12:58:33 (14 years ago)
- Location:
- MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Cache.java
r832 r870 158 158 }else{ 159 159 e.setAttribute("lang", ""); 160 } 161 if (key_array.length > 9){ 162 e.setAttribute("duration", key_array[9]); 163 }else{ 164 e.setAttribute("duration", ""); 160 165 } 161 166 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
r862 r870 59 59 //private Map<String,Object> session; 60 60 private HttpServletRequest request; 61 61 private long duration = 0; 62 62 63 public String getQ() { 63 64 return q; … … 314 315 315 316 if (getLang()!=null) { 316 key += getLang(); 317 } 317 key += getLang() + "//-"; 318 }else{ 319 key +="//-" ; 320 } 321 318 322 319 323 return key; … … 424 428 } 425 429 430 public String addDurationKey(){ 431 String req_key = getRequestKey(); 432 433 Double duration_d; 434 435 duration_d = (double)duration; 436 duration_d = duration_d/1000.0; 437 req_key += duration_d + "//-"; 438 return req_key; 439 } 440 426 441 public void prepare() throws Exception { 427 442 … … 445 460 if (sourceStream == null) { // either not in cache or cache_flag=refresh 446 461 //sourceStream = getTargetRequest().openStream(); 462 long startMillis = System.currentTimeMillis(); 447 463 sourceStream = getSourceStream(); 464 duration = System.currentTimeMillis() - startMillis; 465 req_key = addDurationKey(); 466 467 long now = System.currentTimeMillis(); 448 468 xcid = Cache.getCache().putInCache(req_key,sourceStream); 449 469 Admin.notifyUser("putting in cache: " + req_key); … … 478 498 //Admin.notifyUser(String.valueOf(getSession())); 479 499 500 long now = System.currentTimeMillis(); 501 480 502 prepare(); 503 long duration = (System.currentTimeMillis() - now); 504 //duration 505 481 506 if (resultStream == null) { 482 507 return ERROR;
Note: See TracChangeset
for help on using the changeset viewer.