示例#1
0
  private void fillUseCasePathElementBeanList(
      JourneyCallIntermediateContainer container, TraceStep element, int recursion, TimeUnit unit) {
    TracedCallStepAO b = new TracedCallStepAO();
    b.setCall(recursion == 0 ? "ROOT" : element.getCall());
    b.setRoot(recursion == 0);
    b.setLayer(recursion);
    b.setDuration(unit.transformNanos(element.getDuration()));
    b.setLevel(recursion);
    StringBuilder ident = new StringBuilder();
    for (int i = 0; i < recursion; i++) ident.append("&nbsp;&nbsp;");
    b.setIdent(ident.toString());
    b.setAborted(element.isAborted());
    container.add(b);

    long timeSpentInChildren = 0;
    for (TraceStep p : element.getChildren()) {

      timeSpentInChildren += p.getDuration();
      fillUseCasePathElementBeanList(container, p, recursion + 1, unit);
    }
    b.setTimespent(unit.transformNanos((element.getDuration() - timeSpentInChildren)));
  }
示例#2
0
  @Override
  public List<StatValueAO> getValues(IStats statsObject, String interval, TimeUnit unit) {
    OSStats stats = (OSStats) statsObject;

    List<StatValueAO> ret = new ArrayList<StatValueAO>(CAPTIONS.length);
    int i = 0;
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getOpenFiles(interval)));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getMinOpenFiles(interval)));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getMaxOpenFiles(interval)));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getMaxSupportedOpenFiles(interval)));

    ret.add(new LongValueAO(CAPTIONS[i++], unit.transformNanos(stats.getProcessCPUTime(interval))));
    ret.add(
        new LongValueAO(
            CAPTIONS[i++], unit.transformNanos(stats.getProcessTotalCPUTime(interval))));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getFreePhysicalMemory(interval)));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getFreePhysicalMemory(interval) / MB));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getTotalPhysicalMemory(interval)));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getTotalPhysicalMemory(interval) / MB));
    ret.add(new LongValueAO(CAPTIONS[i++], stats.getProcessors(interval)));

    return ret;
  }