Package org.rhq.core.domain.measurement

Examples of org.rhq.core.domain.measurement.MeasurementDataNumeric


        long now = System.currentTimeMillis() - initialCollectionTime;
        for (Iterator<MeasurementScheduleRequest> i = metrics.iterator(); i.hasNext();) {
            MeasurementScheduleRequest metric = i.next();
            log("collecting metric " + (metric.getName() + " (interval=" + metric.getInterval() + ")"));
            report.addData(new MeasurementDataNumeric(metric, new Double(1.0)));

            // remember what time we were called and which metric was asked to be collected
            CollectedMetric collectedMetric = new CollectedMetric();
            collectedMetric.collectedTime = now;
            collectedMetric.metricName = metric.getName();
View Full Code Here


        long now = System.currentTimeMillis();
        if (timestamp < now - SEVEN_DAYS)
            throw new IllegalArgumentException("Timestamp is older than 7 days");

        Set<MeasurementDataNumeric> data = new HashSet<MeasurementDataNumeric>(1);
        data.add(new MeasurementDataNumeric(timestamp,scheduleId,value.getValue()));

        dataManager.addNumericData(data);

        UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
        uriBuilder.path("/metric/data/{scheduleId}/raw");
View Full Code Here

        Set<MeasurementDataNumeric> data = new HashSet<MeasurementDataNumeric>(points.size());

        List<NumericDataPoint> rejected = new ArrayList<NumericDataPoint>();
        for (NumericDataPoint point : points) {
            if (isScheduleAccessible(point.getScheduleId())) {
                data.add(new MeasurementDataNumeric(point.getTimeStamp(), point.getScheduleId(), point.getValue()));
            } else {
                rejected.add(point);
            }

        }
View Full Code Here

        MediaType mediaType = headers.getAcceptableMediaTypes().get(0);
        Set<MeasurementDataNumeric> data = new HashSet<MeasurementDataNumeric>(points.size());
        for (Datapoint point : points) {
            Integer scheduleId = findScheduleId(resourceId, point.getMetric());
            if (scheduleId != null) {
                data.add(new MeasurementDataNumeric(point.getTimestamp(), scheduleId,point.getValue()));
            } else {
                return Response
                    .status(Status.FORBIDDEN)
                    .entity(
                        new RHQErrorWrapper("Metric name=" + point.getMetric() + " for resourceId=" + resourceId
View Full Code Here

            }
        } else if (alertConditionCategory == AlertConditionCategory.CHANGE) {
            AlertConditionChangesCategoryComposite changesComposite = (AlertConditionChangesCategoryComposite) composite;
            int scheduleId = changesComposite.getScheduleId();

            MeasurementDataNumeric numeric = measurementDataManager.getCurrentNumericForSchedule(scheduleId);

            try {
                MeasurementNumericCacheElement cacheElement = new MeasurementNumericCacheElement(
                    alertConditionOperator, (numeric == null) ? null : numeric.getValue(), alertConditionId);

                addTo("measurementDataCache", measurementDataCache, scheduleId, cacheElement, alertConditionId, stats);
            } catch (InvalidCacheElementException icee) {
                log.info("Failed to create MeasurementNumericCacheElement with parameters: "
                    + AlertConditionCacheUtils.getCacheElementErrorString(alertConditionId, alertConditionOperator,
View Full Code Here

        for (; timestamp < endOfSimulation; timestamp += 30 * 1000) {
            DateTime currentTime = new DateTime(timestamp);

            data.clear();
            for (int i = 0; i < numberOfMetrics; ++i) {
                data.add(new MeasurementDataNumeric(timestamp, i, random.nextDouble()));
            }

            WaitForRawInserts waitForRawInserts = new WaitForRawInserts(data.size());
            metricsServer.addNumericData(data, waitForRawInserts);
            waitForRawInserts.await("Failed to insert raw data at time: " + timestamp);
View Full Code Here

                    if (callTimeData!=null) {
                        report.addData(callTimeData);
                    }
                    break;
                case MEASUREMENT:
                    MeasurementDataNumeric measurementData = (MeasurementDataNumeric) measurementFactory.nextValue(metric);

                    if (measurementData != null) {
                        report.addData(measurementData);
                    }
                    break;
View Full Code Here

        updateData();
        for (MeasurementScheduleRequest request : metrics) {
            Double val = data.get(request.getName());
            if (val != null) {
                report.addData(new MeasurementDataNumeric(request, val));
            }
        }
    }
View Full Code Here

            processInfo.refresh();

            for (MeasurementScheduleRequest request : metrics) {
                if (request.getName().startsWith("NetworkStat.")) {
                    int val = stats.getByName(request.getName().substring("NetworkStat.".length()));
                    report.addData(new MeasurementDataNumeric(request, (double) val));
                } else if (request.getName().startsWith("Process.")) {
                    Double value = ObjectUtil.lookupDeepNumericAttributeProperty(processInfo, request.getName()
                        .substring("Process.".length()));
                    report.addData(new MeasurementDataNumeric(request, value));
                }
            }
        }
    }
View Full Code Here

                Object value = atribute.refresh();

                if (value != null)
                    if (request.getDataType() == DataType.MEASUREMENT) {
                        Double number = ((Number) value).doubleValue();
                        report.addData(new MeasurementDataNumeric(request, number));
                    } else if (request.getDataType() == DataType.TRAIT) {
                        report.addData(new MeasurementDataTrait(request, value.toString()));
                    }
            } catch (Exception e) {
                log.error("Failure to collect measurement data for metric " + metricName + " from bean "
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.measurement.MeasurementDataNumeric

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.