本文整理匯總了Java中org.apache.commons.lang3.time.StopWatch.split方法的典型用法代碼示例。如果您正苦於以下問題:Java StopWatch.split方法的具體用法?Java StopWatch.split怎麽用?Java StopWatch.split使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.lang3.time.StopWatch
的用法示例。
在下文中一共展示了StopWatch.split方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findAllLinksInLinkMappingWithoutParent
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Link> findAllLinksInLinkMappingWithoutParent() {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<LinkMapping> allLinkMappingsWithoutParent = LinkMappingSqlService.getDefault().findAllLinksInLinkMappingWithoutParent();
final ObservableList<Link> links = FXCollections.observableArrayList();
allLinkMappingsWithoutParent.stream()
.forEach(linkMapping -> {
final Optional<Link> optional = this.findById(Link.class, linkMapping.getChildId());
if (optional.isPresent()) {
links.add(optional.get());
}
});
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), allLinkMappingsWithoutParent.size(), "findAllLinksInLinkMappingWithoutParent()"); // NOI18N
stopWatch.stop();
return links;
}
示例2: findAllLinksInLinkMappingWithParent
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Link> findAllLinksInLinkMappingWithParent(final long parentId, final LinkMappingType parentType) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<LinkMapping> allLinkMappingsWithParent = LinkMappingSqlService.getDefault().findAllLinksInLinkMappingWithParent(parentId, parentType);
final ObservableList<Link> links = FXCollections.observableArrayList();
allLinkMappingsWithParent.stream()
.forEach(linkMapping -> {
final Optional<Link> optional = this.findById(Link.class, linkMapping.getChildId());
if (optional.isPresent()) {
links.add(optional.get());
}
});
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), allLinkMappingsWithParent.size(), "findAllLinksInLinkMappingWithPrimary(long, LinkMappingType)"); // NOI18N
stopWatch.stop();
return links;
}
示例3: deleteAllExerciseTermsWithExerciseId
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
void deleteAllExerciseTermsWithExerciseId(long exerciseId) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<ExerciseTerm> exerciseTerms = SqlProvider.getDefault().findAllExerciseTermsWithExerciseId(exerciseId);
DatabaseFacade.getDefault().getCrudService().beginTransaction();
exerciseTerms.stream()
.forEach(exerciseTerm -> {
DatabaseFacade.getDefault().getCrudService().getEntityManager().remove(exerciseTerm);
});
DatabaseFacade.getDefault().getCrudService().commitTransaction();
stopWatch.split();
LoggerFacade.getDefault().debug(this.getClass(), " + Need " + stopWatch.toSplitString() + " for executing [deleteAllExerciseTermsWithExerciseId(long)]"); // NOI18N
this.printToLog(stopWatch.toSplitString(), exerciseTerms.size(), "deleteAllExerciseTermsWithExerciseId(long exerciseId)"); // NOI18N
stopWatch.stop();
}
示例4: doAfterConcurrentHandlingStarted
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
@Override
public void doAfterConcurrentHandlingStarted(HttpServletRequest request,HttpServletResponse response,Object handler){
if (!monitorMessageEntity.getIsShowAfterConcurrentHandlingStartedLog()){
return;
}
//---------------------------------------------------------------
StopWatch stopWatch = getStopWatch(request);
stopWatch.split();
long splitTime = stopWatch.getSplitTime();
if (LOGGER.isDebugEnabled()){
HandlerMethod handlerMethod = (HandlerMethod) handler;
LOGGER.debug(
"afterConcurrentHandlingStarted [{}.{}()], use time:[{}]",
HandlerMethodUtil.getDeclaringClassSimpleName(handlerMethod),
HandlerMethodUtil.getHandlerMethodName(handlerMethod),
formatDuration(splitTime));
}
}
示例5: createExercise
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public void createExercise(final Exercise exercise) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
ExerciseSqlService.getDefault().create(exercise);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), 1, "createExercise(Exercise exercise)"); // NOI18N
stopWatch.stop();
}
示例6: createExerciseTerm
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public void createExerciseTerm(final ExerciseTerm exerciseTerm) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
ExerciseTermSqlService.getDefault().create(exerciseTerm);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), 1, "createExerciseTerm(ExerciseTerm exerciseTerm)"); // NOI18N
stopWatch.stop();
}
示例7: createTerm
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public void createTerm(final Term term) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
TermSqlService.getDefault().create(term);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), 1, "createTerm(Term term)"); // NOI18N
stopWatch.stop();
}
示例8: createTopic
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public void createTopic(final Topic topic) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
TopicSqlService.getDefault().create(topic);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), 1, "createTopic(Topic topic)"); // NOI18N
stopWatch.stop();
}
示例9: findAllExerciseTermsWithExerciseId
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<ExerciseTerm> findAllExerciseTermsWithExerciseId(final long exerciseId) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<ExerciseTerm> exerciseTerms = ExerciseTermSqlService.getDefault().findAllExerciseTermsWithExerciseId(exerciseId);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), exerciseTerms.size(), "findAllExerciseTermsWithExerciseId(long exerciseId)"); // NOI18N
stopWatch.stop();
return exerciseTerms;
}
示例10: findAllExercisesWithTopicId
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Exercise> findAllExercisesWithTopicId(final long topicId) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<Exercise> exercises = ExerciseSqlService.getDefault().findAllExercisesWithTopicId(topicId);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), exercises.size(), "findAllExercisesWithTopicId(long topicId)"); // NOI18N
stopWatch.stop();
return exercises;
}
示例11: findAllLinks
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Link> findAllLinks() {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<Link> links = LinkSqlService.getDefault().findAllLinks();
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), links.size(), "findAllLinks()"); // NOI18N
stopWatch.stop();
return links;
}
示例12: findAllTerms
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Term> findAllTerms() {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<Term> terms = TermSqlService.getDefault().findAllTerms();
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), terms.size(), "findAllTerms()"); // NOI18N
stopWatch.stop();
return terms;
}
示例13: findAllTermsInExerciseTermsWithoutParent
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Term> findAllTermsInExerciseTermsWithoutParent() {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<Term> allTerms = FXCollections.observableArrayList();
allTerms.addAll(this.findAllTerms());
final ObservableList<Term> terms = ExerciseTermSqlService.getDefault().findAllTermsInExerciseTermsWithoutParent(allTerms);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), terms.size(), "findAllTermsInExerciseTermsWithoutParent()"); // NOI18N
stopWatch.stop();
return terms;
}
示例14: findAllTermsWithTitle
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Term> findAllTermsWithTitle(final String title) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<Term> terms = TermSqlService.getDefault().findAllTermsWithTitle(title);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), terms.size(), "findAllTermsWithTitle(String title)"); // NOI18N
stopWatch.stop();
return terms;
}
示例15: findAllTermsWithTopicId
import org.apache.commons.lang3.time.StopWatch; //導入方法依賴的package包/類
public ObservableList<Term> findAllTermsWithTopicId(final long topicId) {
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final ObservableList<Term> allTermsWithTopicId = FXCollections.observableArrayList();
final ObservableList<Exercise> observableListExercises = this.findAllExercisesWithTopicId(topicId);
final Set<Long> uniqueTermIds = new LinkedHashSet<>();
observableListExercises.stream()
.forEach(exercise -> {
final ObservableList<ExerciseTerm> exerciseTerms = this.findAllExerciseTermsWithExerciseId(exercise.getId());
exerciseTerms.stream()
.forEach(exerciseTerm -> {
uniqueTermIds.add(exerciseTerm.getTermId());
});
});
uniqueTermIds.stream()
.forEach(termId -> {
allTermsWithTopicId.add(TermSqlService.getDefault().findById(termId));
});
Collections.sort(allTermsWithTopicId);
stopWatch.split();
this.printToLog(stopWatch.toSplitString(), allTermsWithTopicId.size(), "findAllTermsWithTopicId(long topicId)"); // NOI18N
stopWatch.stop();
return allTermsWithTopicId;
}