Examples of Metric


Examples of org.jboss.as.console.client.shared.runtime.Metric

                }
                else
                {
                    ModelNode result = response.get(RESULT).asObject();

                    Metric metric = new Metric(
                            result.get("requestCount").asLong(),
                            result.get("errorCount").asLong(),
                            result.get("processingTime").asLong(),
                            result.get("maxTime").asLong()
                    );
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

                Console.error(Console.MESSAGES.failed("JVM Status "), caught.getMessage());
            }

            @Override
            public void onSuccess(CompositeVMMetric result) {
                getView().setHeap(new Metric(
                        result.getHeap().getMax(),
                        result.getHeap().getUsed(),
                        result.getHeap().getCommitted(),
                        result.getHeap().getInit()
                ));

                getView().setNonHeap(new Metric(
                        result.getNonHeap().getMax(),
                        result.getNonHeap().getUsed(),
                        result.getNonHeap().getCommitted(),
                        result.getNonHeap().getInit()

                ));
                getView().setOSMetric(result.getOs());
                getView().setRuntimeMetric(result.getRuntime());
                getView().setThreads(
                        new Metric(
                                result.getThreads().getCount(),
                                result.getThreads().getDaemonCount()
                        )
                );
            }
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

            public void onSuccess(DMRResponse dmrResponse) {
                ModelNode result = dmrResponse.get();

                TransactionManager metrics = entityAdapter.fromDMR(result.get(RESULT));

                getView().setTxMetric(new Metric(
                        metrics.getNumTransactions(),
                        metrics.getNumCommittedTransactions(),
                        metrics.getNumAbortedTransactions(),
                        metrics.getNumTimeoutTransactions()
                        ));

                getView().setRollbackMetric(new Metric(
                        metrics.getNumApplicationRollback(),
                        metrics.getNumResourceRollback()
                ));

View Full Code Here

Examples of org.jclouds.cloudwatch.domain.Metric

      response = api().list(new ListMetricsOptions());

      performDefaultMetricsTests(response);

      if (Iterables.size(response) > 0) {
         Metric metric = response.iterator().next();

         testMetricName = metric.getMetricName();
         testNamespace = metric.getNamespace();

         if (metric.getDimensions().size() > 0) {
            Dimension dimension = metric.getDimensions().iterator().next();

            testDimensionName = dimension.getName();
            testDimensionValue = dimension.getValue();
         }

         if (testDimensionName == null) {
            for (Metric metric1 : response) {
               Set<Dimension> dimensions = metric1.getDimensions();

               if (dimensions.size() > 0) {
                  Dimension dimension = metric.getDimensions().iterator().next();

                  testDimensionName = dimension.getName();
                  testDimensionValue = dimension.getValue();

                  break;
               }
            }
         }
      }

      // Test with a NextToken, even if it's null
      response = api().list(ListMetricsOptions.Builder.afterMarker(response.nextMarker().orNull()));

      performDefaultMetricsTests(response);

      // Test with a Namespace
      response = api().list(ListMetricsOptions.Builder.namespace(testNamespace));

      performDefaultMetricsTests(response);

      for (Metric metric : response) {
         checkArgument(metric.getNamespace().equals(testNamespace),
                       "All metrics should have the " + testNamespace + " Namespace.");
      }

      // Test with a MetricName
      response = api().list(ListMetricsOptions.Builder.metricName(testMetricName));

      performDefaultMetricsTests(response);

      for (Metric metric : response) {
         checkArgument(metric.getMetricName().equals(testMetricName),
                       "All metrics should have the " + testMetricName + " MetricName.");
      }

      // Test with a Dimension
      if (testDimensionName != null) {
         Dimension testDimension = new Dimension(testDimensionName, testDimensionValue);

         response = api().list(ListMetricsOptions.Builder.dimension(testDimension));

         performDefaultMetricsTests(response);

         for (Metric metric : response) {
            Set<Dimension> dimensions = metric.getDimensions();
            boolean dimensionFound = false;

            for (Dimension dimension : dimensions) {
               if (dimension.getName().equals(testDimensionName)) {
                  dimensionFound = true;
View Full Code Here

Examples of org.onebusaway.watchdog.model.Metric

    prunedTripIds.addAll(tripIds);
    return prunedTripIds;
  }

  protected String ok(String metricName, Object value) {
    Metric metric = new Metric();
    metric.setMetricName(metricName);
    metric.setCurrentTimestamp(System.currentTimeMillis());
    metric.setMetricValue(value);
    metric.setResponse("SUCCESS");
   
    try {
      return _mapper.writeValueAsString(metric);
    } catch (IOException e) {
      _log.error("metric serialization failed:" + e);
View Full Code Here

Examples of org.openiaml.docs.modeldoc.Metric

    // get all the metrics in the library
    for (IPropertyInvestigator m : AllMetamodelPropertiesLibrary.getAllMetamodelProperties(new DefaultElementSelector())) {
      Object result = m.evaluate(rootPackage);
     
      // insert a new metric
      Metric metric = factory.createMetric();
      metric.setName(prefix + m.getName());
      metric.setValue(result.toString());
      root.getMetrics().add(metric);
     
    }
   
  }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.Metric

    load(this.root, fileCountMap, fileSizeMap);
   
    // now save all of the metrics back
    // file count
    for (String extension : fileCountMap.keySet()) {
      Metric metric = factory.createMetric();
      // e.g. file.java.count.org.openiaml.model
      metric.setName("fileCount." + extension + "." + plugin);
      metric.setValue(fileCountMap.get(extension).toString());
      root.getMetrics().add(metric);
    }
   
    // file size
    for (String extension : fileSizeMap.keySet()) {
      Metric metric = factory.createMetric();
      // e.g. file.java.size.org.openiaml.model
      metric.setName("fileSize." + extension + "." + plugin);
      metric.setValue(fileSizeMap.get(extension).toString());
      root.getMetrics().add(metric);
    }
   
  }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.Metric

     */
    public void publish(ModeldocFactory factory, ModelDocumentation root) {
      // now save all of the metrics back
      // file count
      for (String extension : totalCountMap.keySet()) {
        Metric metric = factory.createMetric();
        // e.g. file.java.count.org.openiaml.model
        metric.setName("fileCount." + extension + prefix + ".total");
        metric.setValue(totalCountMap.get(extension).toString());
        root.getMetrics().add(metric);
      }
     
      // file size
      for (String extension : totalSizeMap.keySet()) {
        Metric metric = factory.createMetric();
        // e.g. file.java.size.org.openiaml.model
        metric.setName("fileSize." + extension + prefix + ".total");
        metric.setValue(totalSizeMap.get(extension).toString());
        root.getMetrics().add(metric);
      }
    }
View Full Code Here

Examples of org.rhq.helpers.pluginAnnotations.agent.Metric

      for (Class<?> clazz : classes) {
         MBean mbean = clazz.getAnnotation(MBean.class);
         String prefix = withNamePrefix ? mbean.objectName() + '.' : "";
         Method[] methods = clazz.getMethods();
         for (Method method : methods) {
            Metric rhqMetric = method.getAnnotation(Metric.class);
            ManagedAttribute managedAttr = method.getAnnotation(ManagedAttribute.class);
            ManagedOperation managedOp = method.getAnnotation(ManagedOperation.class);
            Operation rhqOperation = method.getAnnotation(Operation.class);
            if (rhqMetric != null) {
               debug("Metric annotation found " + rhqMetric);
               // Property and description resolution are the reason why annotation scanning is done here.
               // These two fields are calculated from either the method name or the Managed* annotations,
               // and so, only the infinispan side knows about that.
               String property = prefix + BeanConventions.getPropertyFromBeanConvention(method);
               if (!rhqMetric.property().isEmpty()) {
                  property = prefix + rhqMetric.property();
               }
               MetricProps metric = new MetricProps(property);
               String displayName = withNamePrefix ? "[" + mbean.objectName() + "] " + rhqMetric.displayName() : rhqMetric.displayName();
               metric.setDisplayName(displayName);
               metric.setDisplayType(rhqMetric.displayType());
               metric.setDataType(rhqMetric.dataType());
               metric.setUnits(rhqMetric.units());
               if (managedAttr != null) {
                  debug("Metric has ManagedAttribute annotation " + managedAttr);
                  metric.setDescription(managedAttr.description());
               } else if (managedOp != null) {
                  debug("Metric has ManagedOperation annotation " + managedOp);
                  metric.setDescription(managedOp.description());
               } else {
                  log.debug("Metric has no managed annotations, so take the description from the display name.");
                  metric.setDescription(rhqMetric.displayName());
               }
               props.getMetrics().add(metric);
            }
           
            if (rhqOperation != null) {
               debug("Operation annotation found " + rhqOperation);
               String name = prefix + method.getName();
               if (!rhqOperation.name().isEmpty()) {
                  name = prefix + rhqOperation.name();
               }
               OperationProps operation = new OperationProps(name);
               String displayName = withNamePrefix ? "[" + mbean.objectName() + "] " + rhqOperation.displayName() : rhqOperation.displayName();
               operation.setDisplayName(displayName);
               if (managedAttr != null) {
                  debug("Operation has ManagedAttribute annotation " + managedAttr);
                  operation.setDescription(managedAttr.description());
               } else if (managedOp != null) {
                  debug("Operation has ManagedOperation annotation " + managedOp);
                  operation.setDescription(managedOp.description());
               } else {
                  debug("Operation has no managed annotations, so take the description from the display name.");
                  operation.setDescription(rhqOperation.displayName());
               }
              
               Annotation[][] paramAnnotations = method.getParameterAnnotations();
               int i = 0;
               for (Annotation[] paramAnnotationsInEach : paramAnnotations) {
                  boolean hadParameter = false;
                  for (Annotation annot : paramAnnotationsInEach) {
                     debug("Parameter annotation " + annot);
                     if (annot instanceof Parameter) {
                        Parameter param = (Parameter) annot;
                        SimpleProperty prop = new SimpleProperty(param.name());
                        prop.setDescription(param.description());
                        operation.getParams().add(prop);
                        hadParameter = true;
                     }
                  }
                  if (!hadParameter) {
                     operation.getParams().add(new SimpleProperty("p" + i++));
                  }
               }
               Class<?> returnType = method.getReturnType();
               if (!returnType.equals(Void.TYPE)) {
                  SimpleProperty prop = new SimpleProperty("operationResult");
                  operation.setResult(prop);
               }
               props.getOperations().add(operation);
            }
         }
         Field[] fields = clazz.getDeclaredFields();
         for (Field field : fields) {
            debug("Inspecting field " + field);
            Metric rhqMetric = field.getAnnotation(Metric.class);
            if (rhqMetric != null) {
               debug("Field " + field + " contains Metric annotation " + rhqMetric);
               String property = prefix + BeanConventions.getPropertyFromBeanConvention(field);
               if (!rhqMetric.property().isEmpty()) {
                  property = prefix + rhqMetric.property();
               }
               MetricProps metric = new MetricProps(property);
               String displayName = withNamePrefix ? "[" + mbean.objectName() + "] " + rhqMetric.displayName() : rhqMetric.displayName();
               metric.setDisplayName(displayName);
               metric.setDisplayType(rhqMetric.displayType());
               metric.setDataType(rhqMetric.dataType());
               metric.setUnits(rhqMetric.units());
               ManagedAttribute managedAttr = field.getAnnotation(ManagedAttribute.class);
               if (managedAttr != null) {
                  debug("Metric has ManagedAttribute annotation " + managedAttr);
                  metric.setDescription(managedAttr.description());
               } else {
                  log.debug("Metric has no managed annotations, so take the description from the display name.");
                  metric.setDescription(rhqMetric.displayName());
               }
               props.getMetrics().add(metric);
            }
         }
       
View Full Code Here

Examples of org.sonar.api.batch.measure.Metric

  @Override
  public Collection<Metric> findAll(List<String> metricKeys) {
    List<Metric> result = Lists.newLinkedList();
    for (String metricKey : metricKeys) {
      Metric metric = findByKey(metricKey);
      if (metric != null) {
        result.add(metric);
      }
    }
    return result;
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.