Package org.hyperic.hq.product

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


      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

      } 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

    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

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

    long servicesTotal = td.size();

    dataCache.put("#Services", new MetricValue(servicesTotal));
  }
View Full Code Here

TOP

Related Classes of org.hyperic.hq.product.MetricValue

Copyright © 2018 www.massapicom. 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.