org.springframework.util.StopWatch.toString()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.springframework.util.StopWatch.toString()方法的一些代码示例,展示了StopWatch.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StopWatch.toString()方法的具体详情如下:
包路径:org.springframework.util.StopWatch
类名称:StopWatch
方法名:toString

StopWatch.toString介绍

[英]Return an informative string describing all tasks performed For custom reporting, call getTaskInfo() and use the task info directly.
[中]返回一个信息字符串,描述为自定义报告执行的所有任务,调用getTaskInfo(),并直接使用任务信息。

代码示例

代码示例来源:origin: spring-projects/spring-framework

assertTrue(pp.contains("kept"));
String toString = sw.toString();
assertFalse(toString.contains(name1));
assertFalse(toString.contains(name2));

代码示例来源:origin: spring-projects/spring-framework

assertTrue(tasks[1].getTaskName().equals(name2));
String toString = sw.toString();
assertTrue(toString.contains(id));
assertTrue(toString.contains(name1));

代码示例来源:origin: metatron-app/metatron-discovery

public static String report() {
  return watchThreadLocal.get().toString();
 }
}

代码示例来源:origin: com.github.fartherp/framework-core

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
    throws IOException, ServletException {
  HttpServletRequest httpRequest = (HttpServletRequest) request;
  // 如果在excludePath中,则跳过
  if (StringUtils.isNotBlank(UrlUtils.urlMatch(excludePathSet, RequestUtils.getReqPath(httpRequest)))) {
    chain.doFilter(request, response);
    return;
  }
  StopWatch stopWatch = new StopWatch();
  stopWatch.start();
  request.setAttribute(START_TIME, stopWatch);
  chain.doFilter(request, response);
  stopWatch.stop();
  if (null != request.getAttribute(START_TIME)) {
    logger.info("URL[" + httpRequest.getRequestURI() + "]executeTime[" + stopWatch.toString() + "]");
  }
}

代码示例来源:origin: metatron-app/metatron-discovery

LOGGER.info("Pivot time : {}", stopWatch.toString());

相关文章