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

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

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

Monitor.getHits介绍

暂无

代码示例

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

/**
 * Gets the hits.
 *
 * @return number of hits
 *
 * @see com.jamonapi.Monitor#getHits()
 */
@Override
public int getHits() {
  return (int) monitor.getHits();
}

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

/**
 * Gets the hits.
 *
 * @return number of hits
 *
 * @see com.jamonapi.Monitor#getHits()
 */
public int getHits() {
  return (int) monitor.getHits();
}

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

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

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

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

代码示例来源:origin: org.wicketstuff/wicketstuff-jamon

public boolean isSatisfiedBy(Monitor monitor)
{
  return monitor.getHits() > 0d;
}

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

/** This returns a weighted average */
public double getAvgActive() {
 double weightedActive=0;
 double totalHits=0;
  for (int i=0;i<numRows;i++) {
  double hits=monitors[i].getHits(); 
  weightedActive=hits*monitors[i].getAvgActive();
  totalHits+=hits;
 }
  
 if (totalHits==0)
  return 0;
 else
  return weightedActive/totalHits;

}

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

/** This returns a weighted average */
@Override
public double getAvgActive() {
  double weightedActive=0;
  double totalHits=0;
  for (int i=0;i<numRows;i++) {
    double hits=monitors[i].getHits();
    weightedActive=hits*monitors[i].getAvgActive();
    totalHits+=hits;
  }
  if (totalHits==0)
    return 0;
  else
    return weightedActive/totalHits;
}

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

/** This is not a true standard deviation but a average weighted std deviation. However
 * individual monitors do have a true standard deviation
 */
public double getStdDev() {
 double weightedStdDev=0;
 double totalHits=0;
  for (int i=0;i<numRows;i++) {
  double hits=monitors[i].getHits(); 
  weightedStdDev=hits*monitors[i].getStdDev();
  totalHits+=hits;
 }
  
 if (totalHits==0)
  return 0;
 else
  return weightedStdDev/totalHits;
  
}

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

/** This is not a true standard deviation but a average weighted std deviation. However
 * individual monitors do have a true standard deviation
 */
@Override
public double getStdDev() {
  double weightedStdDev=0;
  double totalHits=0;
  for (int i=0;i<numRows;i++) {
    double hits=monitors[i].getHits();
    weightedStdDev=hits*monitors[i].getStdDev();
    totalHits+=hits;
  }
  if (totalHits==0)
    return 0;
  else
    return weightedStdDev/totalHits;
}

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

/**
 * Return hits/count of the passed in monitor if it exists otherwise return 0
 *
 * @param label jamon label
 * @param units jamon units
 * @return count
 */
 static long getCount(String label, String units) {
  if (MonitorFactory.exists(label, units)) {
    Monitor mon = MonitorFactory.getMonitor(label, units);
    return (long) mon.getHits();
  }
  return 0;
}

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

b.append(getLastValue());
b.append(", Hits=");
b.append(getHits());
b.append(", Avg=");
b.append(getAvg());

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

@SuppressWarnings("all")
public static void increaseCount (Class clazz, String label) {
  // MonitorFactory.getMonitor(getMonitorPrefix(clazz)+label, "#").add(1.0);
   Monitor m =  MonitorFactory.getMonitor(getMonitorPrefix(clazz)+label, "count");
  // System.out.println(m);
   m.setHits(m.getHits()+1);
  //System.out.println(m);
}

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

return new Double(getAvg());
else if (HITS.equalsIgnoreCase(key))
  return new Double(getHits());
else if (MIN.equalsIgnoreCase(key))
  return new Double(getMin());

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

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

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

/**
 * To csv string.
 *
 * @return the string
 * @see patterntesting.runtime.monitor.ProfileMonitor#toCsvString()
 */
@Override
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: stevensouza/jamonapi

public MonitorDelta(Monitor mon) {
  label = mon.getLabel();
  units = mon.getUnits();
  hits = mon.getHits();
  total = mon.getTotal();
  avg = mon.getAvg();
  min = mon.getMin();
  max = mon.getMax();
  stdDev = mon.getStdDev();
  firstAccess = mon.getFirstAccess();
  lastAccess = mon.getLastAccess();
  lastValue = mon.getLastValue();
  active = mon.getActive();
  maxActive = mon.getMaxActive();
  avgActive = mon.getAvgActive();
}

相关文章