Revision 57549
Added by Ioannis Diplas over 4 years ago
RepositoryServiceImpl.java | ||
---|---|---|
248 | 248 |
requestFilter.setRegisteredby(userEmail); |
249 | 249 |
|
250 | 250 |
try{ |
251 |
long start = System.currentTimeMillis(); |
|
251 | 252 |
String rs = restTemplate.postForObject(uriComponents.toUri(),requestFilter, String.class); |
253 |
long end = System.currentTimeMillis(); |
|
252 | 254 |
|
255 |
System.out.println("POST request finished in " + (end-start)+"ms"); |
|
256 |
start=System.currentTimeMillis(); |
|
253 | 257 |
List<Repository> repos = Converter.jsonToRepositoryList(new JSONObject(rs)); |
258 |
end=System.currentTimeMillis(); |
|
259 |
System.out.println("Converting json to repo list finished in " + (end-start)+"ms"); |
|
260 |
start=System.currentTimeMillis(); |
|
254 | 261 |
for (Repository r : repos) |
255 | 262 |
this.updateRepositoryInfo(r); |
256 |
|
|
263 |
end=System.currentTimeMillis(); |
|
264 |
System.out.println("Updating "+repos.size()+" repository infos in " + (end-start)+"ms"); |
|
257 | 265 |
return repos; |
258 | 266 |
}catch (Exception e){ |
259 | 267 |
LOGGER.debug("Exception on getRepositoriesOfUser" , e); |
... | ... | |
300 | 308 |
List<AggregationDetails> aggregationHistory = new ArrayList<>(); |
301 | 309 |
|
302 | 310 |
try { |
311 |
long start = System.currentTimeMillis(); |
|
303 | 312 |
String rs = restTemplate.postForObject(uriComponents.toUri(),requestFilter, String.class); |
313 |
long end = System.currentTimeMillis(); |
|
314 |
|
|
315 |
System.out.println("Aggregations request through rest template took " + (end-start)+"ms"); |
|
304 | 316 |
JSONObject repository = new JSONObject(rs); |
305 | 317 |
|
306 | 318 |
if(repository.getJSONArray("datasourceInfo").length() == 0) |
307 | 319 |
return aggregationHistory; |
320 |
|
|
321 |
start = System.currentTimeMillis(); |
|
308 | 322 |
aggregationHistory.addAll(Converter.getAggregationHistoryFromJson(repository.getJSONArray("datasourceInfo").getJSONObject(0))); |
323 |
end = System.currentTimeMillis(); |
|
324 |
|
|
325 |
System.out.println("Getting aggregations history from json " + (end-start)+"ms"); |
|
309 | 326 |
return aggregationHistory.size() == 0? aggregationHistory : aggregationHistory.stream() |
310 | 327 |
.sorted(Comparator.comparing(AggregationDetails::getDate).reversed()) |
311 | 328 |
.limit(size) |
Also available in: Unified diff
String comparison for NULL equity