Examples of MetricValue


Examples of edu.pku.sei.metric.MetricValue

  private class BasicMetric extends Metric {

    public BasicMetric(AbstractMetricElement source) {
      super(source);
      values = new MetricValue[] { new MetricValue(NOM, 0),
          new MetricValue(NOSM, 0), new MetricValue(NOIM, 0) };
    }
View Full Code Here

Examples of edu.pku.sei.metric.MetricValue

      pOut.print(MetricUtility.transferLevel(level));
      pOut.print("\"");

      if (level <= root.getLevel()) {
        rowNeeded = true;
        MetricValue m = root.getValue(name);
        if (m != null) {
          pOut.print(" total = \"");
          pOut.print(format(m.getValue()));
          pOut.print("\"");
        }
      }

      AvgValue avg = root.getAverageValue(name);
View Full Code Here

Examples of edu.pku.sei.metric.MetricValue

          pOut.print("\""
              + getElementName(children[i].getJavaElement())
              + "\"");

          MetricValue val = children[i].getValue(metric);
          if (val != null) {
            pOut.print(" total = ");
            pOut.print("\"" + format(val.getValue()) + "\"");
          }
          AvgValue avg = children[i].getAverageValue(metric);
          MaxValue max = children[i].getMaxValue(metric);
          if ((avg != null) || (max != null)) {
            if (avg != null) {
View Full Code Here

Examples of edu.stanford.bmir.protege.web.shared.metrics.MetricValue

            writeLock.lock();
            for(Iterator<MetricCalculator> metricIt = dirtyMetrics.iterator(); metricIt.hasNext(); ) {
                MetricCalculator metric = metricIt.next();
                metricIt.remove();
                try {
                    MetricValue metricValue = metric.computeValue();
                    valueCache.put(metric, metricValue);
                } catch (Exception e) {
                    logger.severe(e);
                    // Mark as not computed
                    valueCache.put(metric, null);
View Full Code Here

Examples of edu.stanford.bmir.protege.web.shared.metrics.MetricValue

    private List<MetricValue> readMetrics() {
        readLock.lock();
        try {
            List<MetricValue> result = Lists.newArrayList();
            for(MetricCalculator metric : metrics) {
                MetricValue value = valueCache.get(metric);
                if (value != null) {
                    result.add(value);
                }
            }
            return result;
View Full Code Here

Examples of org.hyperic.hq.product.MetricValue

            metric.getProperties());
        fromCache = false;
        cache.put(oldObjectName, newObjectName);
      } catch (MetricUnreachableException e) {
        if (metric.isAvail()) {
          return new MetricValue(Metric.AVAIL_DOWN);
        }
        throw e;
      }
    }

    try {
      metric.setObjectName(newObjectName);

      try {
        return super.getValue(metric);
      } catch (MetricNotFoundException e) {
        if (!(e.getCause() instanceof InstanceNotFoundException)
            || !fromCache) {
          throw e;
        }

        cache.invalidate(oldObjectName);

        try {
          newObjectName = findObjectName(oldObjectName,
              metric.getProperties());
        } catch (MetricUnreachableException e2) {
          if (metric.isAvail()) {
            return new MetricValue(Metric.AVAIL_DOWN);
          }
          throw e2;
        }

        cache.put(oldObjectName, newObjectName);
View Full Code Here

Examples of org.hyperic.hq.product.MetricValue

      String objNameStr = Metric.decode(metric.getObjectName());
      Object o = MxUtil.getValue(metric.getProperties(), objNameStr, metric.getAttributeName());
     
      if (o instanceof Collection<?>) {
        Collection<?> c = (Collection<?>) o;
        return new MetricValue(c.size());
      } else if (o instanceof Map<?, ?>) {
        Map<?, ?> m = (Map<?, ?>) o;
        return new MetricValue(m.size());
      } else if (o instanceof Number) {
        Number n = (Number) o;
        return new MetricValue(n);
      }
    } catch (IOException e) {
      throw new MetricUnreachableException("Error during communication with remote MBean Server.", e);
    } catch (Exception e) {
      throw new PluginException(e);
View Full Code Here

Examples of org.hyperic.hq.product.MetricValue

      } else if (state.startsWith("I") || state.startsWith("i")) {
        bundlesInstalled++;
      }
    }

    dataCache.put("#Bundles-Total", new MetricValue(bundlesTotal));
    dataCache.put("#Bundles-Active", new MetricValue(bundlesActive));
    dataCache.put("#Bundles-Resolved", new MetricValue(bundlesResolved));
    dataCache.put("#Bundles-Installed", new MetricValue(bundlesInstalled));
  }
View Full Code Here

Examples of org.hyperic.hq.product.MetricValue

    TabularData tdRepos = retreiveTabularAttributeData(connection, objnameFeatures,
        "Repositories");

    long repositoriesTotal = tdRepos.size();
   
    dataCache.put("#Features", new MetricValue(featuresTotal));
    dataCache.put("#FeatureRepositories", new MetricValue(repositoriesTotal));
  }
View Full Code Here

Examples of org.hyperic.hq.product.MetricValue

    TabularData td = retreiveTabularMethodData(connection, objnameServices,
        "list");

    long servicesTotal = td.size();

    dataCache.put("#Services", new MetricValue(servicesTotal));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.