Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
remove time measurement from code
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Oct 23, 2012
1 parent 99f8c1b commit 863a918
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Expand Up @@ -100,10 +100,7 @@ public GetTransUnitListResult execute(GetTransUnitList action, ExecutionContext
else if (action.isAcceptAllStatus())
{
log.debug("Fetch TransUnits:*");
long startTime = System.nanoTime();
GetTransUnitListResult result = getTransUnitsWithPage(action, hLocale);
log.info("********** duration :{} second", (System.nanoTime() - startTime) / 1000000000.0);
return result;
return getTransUnitsWithPage(action, hLocale);
}
else
{
Expand Down
Expand Up @@ -89,14 +89,13 @@ public GetTransUnitsNavigationResult execute(GetTransUnitsNavigation action, Exe

List<HTextFlow> textFlows;
TextFlowResultTransformer resultTransformer = new TextFlowResultTransformer(hLocale);
long startTime = System.nanoTime();

textFlows = textFlowDAO.getNavigationByDocumentId(action.getId(), hLocale, resultTransformer, filterConstraints);
for (HTextFlow textFlow : textFlows)
{
idIndexList.add(textFlow.getId());
transIdStateMap.put(textFlow.getId(), textFlow.getTargets().get(hLocale.getId()).getState());
}
log.info("********** duration :{} second", (System.nanoTime() - startTime) / 1000000000.0);
log.debug("for action {} returned size: ", action, idIndexList.size());
return new GetTransUnitsNavigationResult(new DocumentId(action.getId()), idIndexList, transIdStateMap);

Expand Down Expand Up @@ -156,6 +155,7 @@ public SimpleHTextFlow transformTuple(Object[] tuple, String[] aliases)
}

@Override
@SuppressWarnings("unchecked")
public List<HTextFlow> transformList(List collection)
{
return collection;
Expand Down
Expand Up @@ -88,7 +88,9 @@ public void testExecuteToGetAll() throws Exception
GetTransUnitList action = GetTransUnitList.newAction(new GetTransUnitActionContext(documentId));
prepareActionAndMockLocaleService(action);

long startTime = System.nanoTime();
GetTransUnitListResult result = handler.execute(action, null);
log.info("********** duration :{} second", (System.nanoTime() - startTime) / 1000000000.0);

log.info("result: {}", result);
assertThat(result.getDocumentId(), Matchers.equalTo(documentId));
Expand Down
Expand Up @@ -78,7 +78,9 @@ public void testExecuteWithNoFilterOptions() throws Exception
GetTransUnitsNavigation action = GetTransUnitsNavigation.newAction(new GetTransUnitActionContext(documentId));
prepareActionAndMockLocaleService(action);

long startTime = System.nanoTime();
GetTransUnitsNavigationResult result = handler.execute(action, null);
log.info("********** duration :{} second", (System.nanoTime() - startTime) / 1000000000.0);

assertThat(result.getTransIdStateList().size(), Matchers.equalTo(10));
assertThat(result.getTransIdStateList(), Matchers.hasEntry(1L, ContentState.Approved));
Expand Down

0 comments on commit 863a918

Please sign in to comment.