Package org.rhq.server.metrics

Examples of org.rhq.server.metrics.MetricsDAO


     * Return the 1h numeric data for the passed primary keys (schedule, timestamp)
     * @param pks Primary keys to look up
     * @return List of 1h data
     */
    private List<AggregateNumericMetric> getOneHourDataForPKs(List<MeasurementDataPK> pks) {
        MetricsDAO metricsDAO = storageManager.getMetricsDAO();

        List<StorageResultSetFuture> futureResults = new ArrayList<StorageResultSetFuture>();
        for (MeasurementDataPK pk : pks) {
            // technically we could get more than 1 row but in practice this is not going to be the case.
            // there are never going to be 2 measurements for a single schedule persisted within 1 millisecond.
            StorageResultSetFuture f = metricsDAO
                .findAggregateMetricsAsync(pk.getScheduleId(), Bucket.ONE_HOUR, pk.getTimestamp(), pk.getTimestamp() + 1);
            futureResults.add(f);
        }

        AggregateNumericMetricMapper mapper = new AggregateNumericMetricMapper();
View Full Code Here


            storageClusterMonitor = new StorageClusterMonitor(session);
            session.addStorageStateListener(storageClusterMonitor);

            metricsConfiguration = new MetricsConfiguration();
            metricsDAO = new MetricsDAO(session, metricsConfiguration);


            initMetricsServer();
            JMXUtil.registerMBean(this, OBJECT_NAME);
            initialized = true;
View Full Code Here

        MetricsConfiguration configuration = new MetricsConfiguration();

        dateTimeService = new DateTimeService();
        dateTimeService.setConfiguration(configuration);

        dao = new MetricsDAO(storageSession, configuration);
    }
View Full Code Here

    private void initializeMetricsServer(SimulationPlan plan) {
        metrics = new Metrics();
        createSchema(plan.getNodes(), plan.getCqlPort());
        session = createSession(plan.getNodes(), plan.getCqlPort());
        storageSession = new StorageSession(session);
        metricsDAO = new MetricsDAO(storageSession, plan.getMetricsServerConfiguration());

        metricsServer = new MetricsServer();
        metricsServer.setDAO(metricsDAO);
        metricsServer.setConfiguration(plan.getMetricsServerConfiguration());
        metricsServer.setDateTimeService(plan.getDateTimeService());
View Full Code Here

            pw.println("]");
        }

        @Override
        public void write(OutputStream outputStream) throws IOException, WebApplicationException {
            MetricsDAO metricsDAO = sessionManager.getMetricsDAO();
            Iterable<RawNumericMetric> resultSet = metricsDAO.findRawMetrics(scheduleId, startTime, endTime);

            PrintWriter pw = new PrintWriter(outputStream);

            if (mediaType.equals(MediaType.APPLICATION_JSON_TYPE)) {
                jsonOutput(pw, resultSet);
View Full Code Here

TOP

Related Classes of org.rhq.server.metrics.MetricsDAO

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.