com.jamonapi.Monitor类的使用及代码示例

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

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

Monitor介绍

[英]Used to interact with monitor objects. I would have preferred to make this an interface, but didn't do that as jamon 1.0 code would have broken. Live and learn
[中]用于与监视器对象交互。我本想让它成为一个接口,但没有这样做,因为jamon 1.0的代码会被破坏。活到老学到老

代码示例

代码示例来源: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: net.sf.patterntesting/patterntesting-rt

/**
 * @see patterntesting.runtime.monitor.ProfileMonitor#toCsvString()
 */
public String toCsvString() {
  return monitor.getLabel() + "; " + monitor.getUnits() + "; "
      + monitor.getLastValue() + "; " + (long) monitor.getHits()
      + "; " + monitor.getAvg() + "; " + monitor.getTotal() + "; "
      + monitor.getMin() + "; " + monitor.getMax() + "; "
      + monitor.getActive() + "; " + monitor.getAvgActive() + "; "
      + monitor.getMaxActive() + "; " + monitor.getFirstAccess()
      + "; " + monitor.getLastAccess() + ";";
}

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

b.append(getMonKey() + ": (");
b.append("LastValue=");
b.append(getLastValue());
b.append(", Hits=");
b.append(getHits());
b.append(", Avg=");
b.append(getAvg());
b.append(", Total=");
b.append(getTotal());
b.append(", Min=");
b.append(getMin());
b.append(", Max=");
b.append(getMax());
b.append(", Active=");
b.append(getActive());
b.append(", Avg Active=");
b.append(getAvgActive());
b.append(", Max Active=");
b.append(getMaxActive());
b.append(", First Access=");
b.append(getFirstAccess());
b.append(", Last Access=");
b.append(getLastAccess());
b.append(")");

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

public FinalizedMonitor(Monitor m){
  header = (String)m.getMonKey().getValue(MonKey.LABEL_HEADER);
  units = (String)m.getMonKey().getValue(MonKey.UNITS_HEADER);
  avg = m.getAvg();
  hits = m.getHits();
  stdDev = m.getStdDev();
  lastValue = m.getLastValue();
  max = m.getMax();
  min = m.getMin();
  total = m.getTotal();
  
  
}

代码示例来源: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: SmartDataAnalytics/DL-Learner

mon.reset();
  DescriptiveStatistics sizeStats = new DescriptiveStatistics();
  result.stream()
      .map(r -> {
        System.out.println(r);
        mon.start();
        Model cbd = cbdGen.getConciseBoundedDescription(r, 2);
        mon.stop();
        return cbd;
      })
  sb.append(separator).append(mon.getTotal());
  sb.append(separator).append(mon.getMin());
  sb.append(separator).append(mon.getMax());
  sb.append(separator).append(mon.getAvg());
} catch (Exception e) {
  e.printStackTrace();

代码示例来源: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: SmartDataAnalytics/DL-Learner

MonitorFactory.getTimeMonitor("lgg").start();
    ((LGGGeneratorSimple)lggGenerator).setTimeout(getRemainingPartialSolutionTime(), TimeUnit.SECONDS);
    RDFResourceTree lgg = lggGenerator.getLGG(currentTree, uncoveredTree);
    MonitorFactory.getTimeMonitor("lgg").stop();
logger.trace("LGG time: " + MonitorFactory.getTimeMonitor("lgg").getTotal() + "ms");
logger.trace("Avg. LGG time: " + MonitorFactory.getTimeMonitor("lgg").getAvg() + "ms");
logger.info("#LGG computations: " + MonitorFactory.getTimeMonitor("lgg").getHits());
logger.trace("Subsumption test time: " + MonitorFactory.getTimeMonitor("subsumption").getTotal() + "ms");
logger.trace("Avg. subsumption test time: " + MonitorFactory.getTimeMonitor("subsumption").getAvg() + "ms");
logger.trace("#Subsumption tests: " + MonitorFactory.getTimeMonitor("subsumption").getHits());

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

/**
 * To short string.
 *
 * @return the string
 * @see patterntesting.runtime.monitor.ProfileMonitor#toShortString()
 */
@Override
public String toShortString() {
  return "Hits=" + (long) monitor.getHits() + ", Avg=" + monitor.getAvg() + ", Total=" + monitor.getTotal()
      + ", Max=" + monitor.getMax() + ", Unit=" + monitor.getUnits();
}

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

out.println("~~~~~~~~");
List<Monitor> monitors = new ArrayList<>(asList(MonitorFactory.getRootMonitor().getMonitors()));
monitors.sort((m1, m2) -> Double.compare(m2.getTotal(), m1.getTotal()));
int lm = 10;
for (Monitor monitor : monitors) {
  if (monitor.getLabel().length() > lm) {
    lm = monitor.getLabel().length();
  if (monitor.getHits() > 0) {
    out.println(String.format("%-" + lm + "s -> %8.0f hits; %8.1f avg; %8.1f min; %8.1f max;", monitor.getLabel(),
        monitor.getHits(), monitor.getAvg(), monitor.getMin(), monitor.getMax()));

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

private void runIterative() {
  // get the candidates
  Set<OWLClass> candidates = reasoner.getNonEmptyOWLClasses();
  // check for each candidate how often the subject belongs to it
  int i = 1;
  Monitor mon = MonitorFactory.getTimeMonitor("dom-class-time");
  for (OWLClass candidate : candidates) {
    mon.start();
    logger.debug("Candidate:" + candidate);
    progressMonitor.learningProgressChanged(axiomType, i++, candidates.size());
    // get total number of instances of B
    int cntB = reasoner.getPopularity(candidate);
    if(cntB == 0){// skip empty classes
      logger.debug("Cannot compute domain statements for empty candidate class " + candidate);
      continue;
    }
    // get number of instances of (A AND B)
    SUBJECTS_OF_TYPE_COUNT_QUERY.setIri("type", candidate.toStringID());
    int cntAB = executeSelectQuery(SUBJECTS_OF_TYPE_COUNT_QUERY.toString()).next().getLiteral("cnt").getInt();
    logger.debug("Candidate:" + candidate + "\npopularity:" + cntB + "\noverlap:" + cntAB);
    // compute score
    AxiomScore score = computeScore(popularity, cntB, cntAB);
    currentlyBestAxioms.add(
        new EvaluatedAxiom<>(
            df.getOWLObjectPropertyDomainAxiom(entityToDescribe, candidate),
            score));
    mon.stop();
    logger.debug(candidate + " analyzed in " + mon.getLastValue());
  }
}

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

public static String convMonitorToString (Monitor m) {
  String retVal = m.getLabel()+"|\t";
  String unit = m.getUnits();
  retVal+=unit+"|\t";
  long content = new Double(m.getTotal()).longValue();
  content = content / (1000*1000);
  String contentstr = (unit.equals(MS))? Helper.prettyPrintNanoSeconds(content ) : m.getHits()+"" ;
  retVal+= "total:"+contentstr+"|\t";
  
  long avg = new Double(m.getAvg()).longValue();
  avg = avg / (1000*1000);
  String avgstr = (unit.equals(MS))? Helper.prettyPrintNanoSeconds(avg ) : avg+"" ;
  retVal+= "avg:"+avgstr+"|\t";
  
  return retVal;
}

代码示例来源: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: net.sf.patterntesting/patterntesting-rt

/**
 * Start.
 *
 * @see com.jamonapi.Monitor#start()
 */
public void start() {
  monitor.start();
}

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

public synchronized void init() {
  for (String url : ontologySchemaUrls) {
    log.info("Testing, if indexed: " + url);
    if (alreadyIndexed.add(url)) {
      log.info("Ontology not found, start indexing");
      try {
        Monitor m0 = MonitorFactory.start("Indexer parsing ontology");
        model = ModelFactory.createOntologyModel();
        model.read(url, null);
        classIndexer.index(model);
        m0.stop();
        log.info("indexed ontology in ms: " + m0.getTotal());
      } catch (Exception e) {
        log.error(e.getMessage(), e);
      }
    } else {
      //not so important output
      log.debug("Already indexed: " + url + " " + alreadyIndexed);
    }
  }
}

代码示例来源: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: SmartDataAnalytics/DL-Learner

logger.trace("LGG time: " + MonitorFactory.getTimeMonitor("lgg").getTotal() + "ms");
logger.trace("Avg. LGG time: " + MonitorFactory.getTimeMonitor("lgg").getAvg() + "ms");
logger.info("#LGG computations: " + MonitorFactory.getTimeMonitor("lgg").getHits());
logger.trace("Subsumption test time: " + MonitorFactory.getTimeMonitor("subsumption").getTotal() + "ms");
logger.trace("Avg. subsumption test time: " + MonitorFactory.getTimeMonitor("subsumption").getAvg() + "ms");
logger.trace("#Subsumption tests: " + MonitorFactory.getTimeMonitor("subsumption").getHits());

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

/** Return an array with spaces for the values in header and values populated for monitor data - last value, active and last access */
public Object[] getData(Monitor mon) {
  Object[] retData=new Object[header.length];// all but the 2 values will be null and will be replaced by caller.
  retData[lastValueIndex]=new Double(mon.getLastValue());
  retData[activeIndex]=new Double(mon.getActive());
  retData[dateIndex]=mon.getLastAccess();
  return retData;
}

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

/**
 * Gets the total.
 *
 * @return total
 *
 * @see com.jamonapi.Monitor#getTotal()
 */
@Override
public double getTotal() {
  return monitor.getTotal();
}

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

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

相关文章