本文整理汇总了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;
}