com.jamonapi.Monitor.add()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(156)

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

Monitor.add介绍

[英]Introduced as a way to add listeners that allows for lazy initialization saving a fair amount of memory. Note a future enhancement would be to delete the Listeners object when all listeners are removed.
[中]作为一种添加监听器的方式引入,允许延迟初始化,从而节省大量内存。注意,未来的一个增强是在删除所有侦听器时删除侦听器对象。

代码示例

代码示例来源:origin: org.patterntesting/patterntesting-rt

/**
 * Adds the.
 *
 * @param arg0
 *            argument
 * @see com.jamonapi.Monitor#add(double)
 */
@Override
public void add(final double arg0) {
  monitor.add(arg0);
}

代码示例来源:origin: stevensouza/jamonapi

JAMonBufferListener jbl=new JAMonBufferListener();
delme.addListener("max", jbl);
MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").add(100);
jbl=(JAMonBufferListener)MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").getListenerType("max").getListener();
Object[][] data=jbl.getDetailData().getData();

代码示例来源:origin: net.sf.patterntesting/patterntesting-rt

/**
 * @param arg0
 * @see com.jamonapi.Monitor#add(double)
 */
public void add(double arg0) {
  monitor.add(arg0);
}

代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi

public Monitor add(double value) {
  for (int i=0;i<numRows;i++) 
   monitors[i].add(value);   
    
  return this;
}

代码示例来源:origin: stevensouza/jamonapi

@Override
public Monitor add(double value) {
  for (int i=0;i<numRows;i++)
    monitors[i].add(value);
  return this;
}

代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi

System.out.println("***** Class unit tests");
        System.out.println("\nMonitorFactory.main()");
MonitorFactory.main(null);
System.out.println("\nTestClassPerformance.main()");
        TestClassPerformance.main(args);
        Monitor timingMon;
System.out.println("\n***** MonitorFactory.getData():");
        Monitor m1=MonitorFactory.start("pages.purchase.test");
        Monitor m2=MonitorFactory.start("steve.souza.test");
Thread.sleep(350);
        m1.stop();
        Thread.sleep(650);
        m2.stop();
        Object[][] rows=MonitorFactory.getData();
for (int i=0; i<rows.length; i++) {
            String rowData="row"+i+"=[";
            for (int j=0; j<rows[0].length; j++) {
                rowData+=rows[i][j]+", ";
            }
            System.out.println(rowData+"]");
        }
     System.out.println("\n***** Multi-threaded test");
        long LOBIT=0x00000001;//1
        long HIBIT=0x10000000;//268,435,456
timingMon=MonitorFactory.start();
        ThreadGroup threadGroup=new ThreadGroup("threadGroup");
//Note mon1 is shared by all instances of the thread and so will test concurrent access.
Monitor mon1=MonitorFactory.getTimeMonitor("mon1");
        for (int i=0; i<THREADS; i++) // mon1 should be THREADS*1
            new Thread(threadGroup, new TestClass(i, LOBIT, LOBIT, mon1)).start();
Monitor mon2=MonitorFactory.getTimeMonitor("mon2");
        for (int i=0; i<THREADS; i++)//THREADS*HIBIT
            new Thread(threadGroup, new TestClass(i, HIBIT, HIBIT, mon2)).start();
Monitor mon3=MonitorFactory.getTimeMonitor("mon3");
        for (int i=0; i<THREADS; i++)  //(THREADS/2)*LOBIT + (THREADS/2)*HIBIT  
            new Thread(threadGroup, new TestClass(i, LOBIT, HIBIT, mon3)).start();
while(threadGroup.activeCount()!=0)
            ;
System.out.println("Threads have finished processing. It took "+timingMon.stop());
        System.out.println("Total should equal "+THREADS+" - "+mon1);
        System.out.println("Total should equal "+THREADS*HIBIT+" - "+mon2);
        double threadCount=THREADS/2;
        System.out.println("Total should equal "+(threadCount*LOBIT + threadCount*HIBIT) +" - "+mon3);
Monitor mon4=MonitorFactory.start("mon4");
System.out.println("\nStarting mon4 thread test");
Monitor mon4ThreadTest=MonitorFactory.start();
        threadGroup=new ThreadGroup("timingMonitorThreads");
        for (int i=0; i<THREADS; i++)
            new Thread(threadGroup, new TimingMonitorThreads(mon4)).start();
while(threadGroup.activeCount()!=0)
            ;

代码示例来源: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: stevensouza/jamonapi

public Monitor add(MonKey key, double value) {
  return getMonitor(key).add(value);
}

代码示例来源: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: com.jamonapi/com.springsource.com.jamonapi

public Monitor add(MonKey key, double value) {
  return getMonitor(key).add(value);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play

/**
 * Run the code in a new thread after a delay
 * 
 * @param invocation
 *            The code to run
 * @param millis
 *            The time to wait before, in milliseconds
 * @return The future object, to know when the task is completed
 */
public static Future<?> invoke(Invocation invocation, long millis) {
  Monitor monitor = MonitorFactory.getMonitor("Invocation queue", "elmts.");
  monitor.add(executor.getQueue().size());
  return executor.schedule(invocation, millis, TimeUnit.MILLISECONDS);
}

代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi

public Monitor add(String label, String units, double value) {
  return getMonitor(new MonKeyImp(label, units)).add(value);
}

代码示例来源:origin: stevensouza/jamonapi

public Monitor add(String label, String units, double value) {
  return getMonitor(new MonKeyImp(label, units)).add(value);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play

/**
 * Run the code in a new thread took from a thread pool.
 * 
 * @param invocation
 *            The code to run
 * @return The future object, to know when the task is completed
 */
public static Future<?> invoke(Invocation invocation) {
  Monitor monitor = MonitorFactory.getMonitor("Invoker queue size", "elmts.");
  monitor.add(executor.getQueue().size());
  invocation.waitInQueue = MonitorFactory.start("Waiting for execution");
  return executor.submit(invocation);
}

代码示例来源:origin: SmartDataAnalytics/DL-Learner

public void add(MonKeyImp monkey, int index, double value) {
  try {
    get(monkey).getMonitors()[index].add(value);
  } catch (IndexOutOfBoundsException e) {
    e.printStackTrace();
    logger.error("index too big, is: "+index+" max = " +  get(monkey).getMonitors().length);
  }
}

代码示例来源: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);
}

代码示例来源:origin: SmartDataAnalytics/DL-Learner

(a==0)?"":JamonMonitorLogger.PERCENTAGE);
for (int b = 0; b < 2; b++) {
  m[a].add(r.nextDouble());
    (a==0)?"":JamonMonitorLogger.PERCENTAGE);
for (int b = 0; b < 2; b++) {
  m[a].add(r.nextDouble());

代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi

JAMonBufferListener jbl=new JAMonBufferListener();
delme.getListenerType("max").addListener(jbl);
MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").add(100);
jbl=(JAMonBufferListener)MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").getListenerType("max").getListener();
Object[][] data=jbl.getData();

相关文章