本文整理了Java中com.jamonapi.Monitor.stop()
方法的一些代码示例,展示了Monitor.stop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Monitor.stop()
方法的具体详情如下:
包路径:com.jamonapi.Monitor
类名称:Monitor
方法名:stop
暂无
代码示例来源:origin: stackoverflow.com
public aspect MonitorAspect {
pointcut monitor() : execution(* *.ClassToMonitor.methodToMonitor(..));
Object arround() : monitor() {
Monitor monitor = MonitorFactory.start(thisJoinPoint.toShortString());
Object returnedObject = proceed();
monitor.stop();
return returnedObject;
}
}
代码示例来源:origin: spring-projects/spring-framework
/**
* Wraps the invocation with a JAMon Monitor and writes the current
* performance statistics to the log (if enabled).
* @see com.jamonapi.MonitorFactory#start
* @see com.jamonapi.Monitor#stop
*/
@Override
protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
String name = createInvocationTraceName(invocation);
MonKey key = new MonKeyImp(name, name, "ms.");
Monitor monitor = MonitorFactory.start(key);
try {
return invocation.proceed();
}
catch (Throwable ex) {
trackException(key, ex);
throw ex;
}
finally {
monitor.stop();
if (!this.trackAllInvocations || isLogEnabled(logger)) {
writeToLog(logger, "JAMon performance statistics for method [" + name + "]:\n" + monitor);
}
}
}
代码示例来源:origin: net.sf.patterntesting/patterntesting-rt
/**
* Stop.
*
* @see com.jamonapi.Monitor#stop()
*/
public void stop() {
monitor.stop();
}
代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi
public Monitor stop() {
for (int i=0;i<numRows;i++)
monitors[i].stop();
return this;
}
代码示例来源:origin: stevensouza/automon
@Override
public void stop(Monitor mon) {
mon.stop();
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi
/**
* Start the monitor.
*/
public void stop()
{
if(this.isActive)
{
this.monitor.stop();
}
}
代码示例来源:origin: org.patterntesting/patterntesting-rt
/**
* Stop.
*
* @see com.jamonapi.Monitor#stop()
*/
@Override
public void stop() {
monitor.stop();
}
代码示例来源:origin: stackoverflow.com
Monitor mon = null;
for(int i =0; i < 1000; i++){
//Part1
mon = MonitorFactory.start("Point 1");
Thread.sleep(2);
mon.stop();
//Part2
mon = MonitorFactory.start("Point 2");
mon.stop();
}
System.out.println(MonitorFactory.getMonitor("Point 1").toString());
System.out.println(MonitorFactory.getMonitor("Point 2").toString());
代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi
public void factoryMonitor() throws Exception {
System.out.println("\nFull Factory TimingMonitor()- uses cached version so doesn't create child monitors");
System.out.println("\tMonitor mon=MonitorFactory.start('pages.admin');");
System.out.println("\tmon.stop();");
for (int i=0; i<testIterations; i++) {
testMon=MonitorFactory.start("pages.admin");
testMon.stop();
}
System.out.println(testMon);
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi
/**
* Stop the monitor
*/
public void stop()
{
if(this.isActive)
{
long duration = System.currentTimeMillis() - this.startTime;
this.monitor.add(duration);
this.monitor.stop();
}
}
代码示例来源:origin: org.apache.turbine/fulcrum-yaafi
/**
* Stop the monitor
*/
public void stop()
{
if(this.isActive)
{
long duration = System.currentTimeMillis() - this.startTime;
this.monitor.add(duration);
this.monitor.stop();
}
}
代码示例来源:origin: org.apache.turbine/fulcrum-yaafi
/**
* Stop the monitor
*/
public void stop(Throwable throwable)
{
if(this.isActive)
{
// use a negative execution time to mark an exception for an affiliate
this.monitor.add(-1);
this.monitor.stop();
}
}
代码示例来源:origin: stevensouza/jamonapi
public void factoryMonitor() throws Exception {
System.out.println("\nFull Factory TimingMonitor()- uses cached version so doesn't create child monitors");
System.out.println("\tMonitor mon=MonitorFactory.start('pages.admin');");
System.out.println("\tmon.stop();");
for (int i=0; i<testIterations; i++) {
testMon=MonitorFactory.start("pages.admin");
testMon.stop();
}
System.out.println(testMon);
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi
/**
* Stop the monitor
*/
public void stop(Throwable throwable)
{
if(this.isActive)
{
// use a negative execution time to mark an exception for an affiliate
this.monitor.add(-1);
this.monitor.stop();
}
}
代码示例来源:origin: springframework/spring-aop
protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
String name = createInvocationTraceName(invocation);
Monitor monitor = MonitorFactory.start(name);
try {
return invocation.proceed();
}
finally {
monitor.stop();
logger.trace("JAMon performance statistics for method [" + name + "]:\n" + monitor);
}
}
代码示例来源:origin: SmartDataAnalytics/DL-Learner
public String getQuestion(QueryTree<N> lgg, List<QueryTree<N>> negTrees, List<String> knownResources) throws TimeOutException{
// return computeQuestionOptimized(lgg, negTrees, knownResources);
mon.start();
String question = computeQuestionBetterPerformance(lgg, negTrees, knownResources);
mon.stop();
return question;
}
代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
Monitor allPages = MonitorFactory.start(new MonKeyImp("com.jamonapi.allPages",getURI(request),"ms."));
Monitor monitor = MonitorFactory.start(getURI(request));
try {
filterChain.doFilter(request, response);
} finally {
monitor.stop();
allPages.stop();
}
}
代码示例来源:origin: stevensouza/automon
@Override
public void stop(Monitor mon, Throwable throwable) {
mon.stop();
put(throwable);
// note the following 'get' always succeeds because of the above 'put'
mon.getMonKey().setDetails(get(throwable));
}
代码示例来源:origin: org.automon/automon
@Override
public void stop(Monitor mon, Throwable throwable) {
mon.stop();
put(throwable);
// note the following 'get' always succeeds because of the above 'put'
mon.getMonKey().setDetails(get(throwable));
}
代码示例来源:origin: stevensouza/jamonapi
@Override
void stopTimeMon(HttpMonRequest httpMonBase) {
if (httpMonBase.getRequest() instanceof Request) {
Request request=(Request)httpMonBase.getRequest();
Monitor mon=httpMonBase.getNextTimeMon();
if (mon!=null) {
mon.add(System.currentTimeMillis()-request.getTimeStamp()).stop();// figure elapsed time and then decrement active.
}
} else
super.stopTimeMon(httpMonBase);
}
内容来源于网络,如有侵权,请联系作者删除!