Examples of Statistics


Examples of org.modeshape.jcr.query.QueryResults.Statistics

        // Create the canonical plan ...
        long start = System.nanoTime();
        PlanNode plan = planner.createPlan(context, query);
        long duration = Math.abs(System.nanoTime() - start);
        Statistics stats = new Statistics(duration);
        final String workspaceName = context.getWorkspaceNames().iterator().next();

        if (trace) {
            LOGGER.trace("Computed canonical query plan for query {0}: {1}", context.id(), plan);
        }

        checkCancelled(context);
        Columns resultColumns = null;
        if (!context.getProblems().hasErrors()) {
            // Optimize the plan ...
            start = System.nanoTime();
            PlanNode optimizedPlan = optimizer.optimize(context, plan);
            duration = Math.abs(System.nanoTime() - start);
            stats = stats.withOptimizationTime(duration);

            if (trace) {
                LOGGER.trace("Computed optimized query plan for query {0}:\n{1}", context.id(), optimizedPlan);
            }

            // Find the query result columns ...
            start = System.nanoTime();

            // Determine the Columns object for specific nodes in the plan, and store them in the context ...
            optimizedPlan.apply(Traversal.POST_ORDER, new PlanNode.Operation() {

                @Override
                public void apply( PlanNode node ) {
                    Columns columns = null;
                    switch (node.getType()) {
                        case PROJECT:
                        case SOURCE:
                            columns = determineProjectedColumns(node, context);
                            assert columns != null;
                            break;
                        case JOIN:
                            Columns leftColumns = context.columnsFor(node.getFirstChild());
                            Columns rightColumns = context.columnsFor(node.getLastChild());
                            columns = leftColumns.with(rightColumns);
                            assert columns != null;
                            break;
                        case DEPENDENT_QUERY:
                            columns = context.columnsFor(node.getLastChild());
                            assert columns != null;
                            break;
                        case SET_OPERATION:
                            leftColumns = context.columnsFor(node.getFirstChild());
                            rightColumns = context.columnsFor(node.getLastChild());
                            if (checkUnionCompatible(leftColumns, rightColumns, context, query)) {
                                columns = leftColumns;
                                assert columns != null;
                            }
                            break;
                        case INDEX:
                            // do nothing with indexes ...
                            break;
                        default:
                            assert node.getChildCount() == 1;
                            columns = context.columnsFor(node.getFirstChild());
                            assert columns != null;
                            break;
                    }
                    if (columns != null) {
                        context.addColumnsFor(node, columns);
                    }
                }
            });
            Problems problems = context.getProblems();
            if (problems.hasErrors()) {
                throw new RepositoryException(JcrI18n.problemsWithQuery.text(query, problems.toString()));
            } else if (LOGGER.isDebugEnabled() && problems.hasWarnings()) {
                LOGGER.debug("There are several warnings with this query: {0}\n{1}", query, problems.toString());
            }

            resultColumns = context.columnsFor(optimizedPlan);
            assert resultColumns != null;
            duration = Math.abs(System.nanoTime() - start);
            stats = stats.withResultsFormulationTime(duration);

            if (trace) {
                LOGGER.trace("Computed output columns for query {0}: {1}", context.id(), resultColumns);
            }

            if (!context.getProblems().hasErrors()) {
                checkCancelled(context);
                // Execute the plan ...
                try {
                    start = System.nanoTime();
                    if (trace) {
                        LOGGER.trace("Start executing query {0}", context.id());
                    }
                    QueryResults results = executeOptimizedQuery(context, query, stats, optimizedPlan);
                    if (trace) {
                        LOGGER.trace("Stopped executing query {0}: {1}", context.id(), stats);
                    }
                    return results;
                } finally {
                    duration = Math.abs(System.nanoTime() - start);
                    stats = stats.withExecutionTime(duration);
                }
            }
        }
        // Check whether the query was cancelled during execution ...
        checkCancelled(context);
View Full Code Here

Examples of org.openjdk.jmh.util.internal.Statistics

                        .build();

                RunResult result = new Runner(opt).runSingle();
                Result uncompressedBytes = result.getSecondaryResults().get("getUncompressedBytes");

                Statistics stats = uncompressedBytes.getStatistics();
                System.out.printf("  %-14s %10s ± %10s (%5.2f%%) (N = %d, \u03B1 = 99.9%%)\n",
                        getBenchmarkName(benchmark),
                        Util.toHumanReadableSpeed((long) stats.getMean()),
                        Util.toHumanReadableSpeed((long) stats.getMeanErrorAt(0.999)),
                        stats.getMeanErrorAt(0.999) * 100 / stats.getMean(),
                        stats.getN());
            }
            System.out.println();
        }
    }
View Full Code Here

Examples of org.opensolaris.opengrok.util.Statistics

        String path = repository.getDirectoryName();
        String type = repository.getClass().getSimpleName();

        if (repository.isWorking()) {
            boolean verbose = RuntimeEnvironment.getInstance().isVerbose();
            Statistics elapsed = new Statistics();

            if (verbose) {
                log.log(Level.INFO, "Creating historycache for {0} ({1})",
                    new Object[]{path, type});
            }

            try {
                repository.createCache(historyCache, sinceRevision);
            } catch (Exception e) {
                log.log(Level.WARNING,
                    "An error occured while creating cache for " + path + " ("
                    + type + ")", e);
            }

            if (verbose) {
                elapsed.report(log, "Done historycache for " + path);
            }
        } else {
            log.log(Level.WARNING, "Skipping creation of historycache of "
                + type + " repository in " + path + ": Missing SCM dependencies?");
        }
View Full Code Here

Examples of org.radargun.stats.Statistics

               if (valueCategory.endsWith(" Throughput")) {
                  timeline.addValue(valueCategory, new Timeline.Value(now, 0));
               }
            }
         } else {
            Statistics aggregated = stats.get(0).copy();
            for (int i = 1; i < stats.size(); ++i) {
               aggregated.merge(stats.get(i));
            }
            for (Map.Entry<String, OperationStats> entry : aggregated.getOperationsStats().entrySet()) {
               Throughput throughput = entry.getValue().getRepresentation(Throughput.class, stats.size(), TimeUnit.MILLISECONDS.toNanos(aggregated.getEnd() - aggregated.getBegin()));
               if (throughput != null && (throughput.actual != 0 || timeline.getValues(entry.getKey() + " Throughput") != null)) {
                  timeline.addValue(entry.getKey() + " Throughput", new Timeline.Value(now, throughput.actual));
               }
            }
         }
View Full Code Here

Examples of org.rioproject.watch.Statistics

    /**
     * Tests the <code>Statistics()</code> constructor.
     */
    @Test
    public void testConstructor1() {
        Statistics stat = new Statistics();
        assertClean(stat);
    }
View Full Code Here

Examples of org.serviceconnector.util.Statistics

    WebContext.getWebConfiguration().load(AppContext.getApacheCompositeConfig());
    // initialize JMX
    SC.initializeJMX();

    // initialize statistics
    Statistics statistics = Statistics.getInstance();
    statistics.setStartupDateTime(new Timestamp(Calendar.getInstance().getTime().getTime()));

    // start configured responders
    Map<String, ListenerConfiguration> listenerList = AppContext.getResponderConfiguration().getListenerConfigurations();
    for (ListenerConfiguration listenerConfig : listenerList.values()) {
      IResponder responder = new Responder(listenerConfig);
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.routing.internal.task.executor.Statistics

  public boolean isUpdatePrefixFileJobRunning() {
    if (config.isFeatureActive() && !periodicUpdaterDidRunAtLeastOnce) {
      log.debug("Boot process not done yet, periodic updater did not yet finish!");
      return true;
    }
    final Statistics statistics = constrainedExecutor.getStatistics();
    log.debug("Running update jobs for {}", statistics.getCurrentlyRunningJobKeys());
    return !statistics.getCurrentlyRunningJobKeys().isEmpty();
  }
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.