Package edu.brown.profilers

Examples of edu.brown.profilers.ProfileMeasurement


        this.hstore_conf = hstore_site.getHStoreConf();
        this.name = name;
        this.queue = queue;
       
        if (profile) {
            this.idleTime = new ProfileMeasurement("IDLE");
            this.execTime = new ProfileMeasurement("EXEC");
        } else {
            this.idleTime = null;
            this.execTime = null;
        }
    }
View Full Code Here


        "  SET MSC_LOCATION = MSC_LOCATION + 1 "
    );
   
    public VoltTable[] run(int partition) {
        // -------------------- LOCK BEFORE QUERY --------------------
        ProfileMeasurement pm_before = new ProfileMeasurement("BEFORE");
        LOG.info(this.getTransactionState() + " - Blocking until LOCK_BEFORE is released");
        pm_before.start();
        try {
            // Notify others before we lock
            NOTIFY_BEFORE.release();
            LOCK_BEFORE.acquire();
            LOCK_BEFORE.release();
        } catch (InterruptedException ex) {
            ex.printStackTrace();
            throw new VoltAbortException(ex.getMessage());
        } finally {
            NOTIFY_BEFORE.drainPermits();
            pm_before.stop();
            LOG.info("AWAKE - " + pm_before.debug());
        }
       
        // -------------------- DISTRIBUTED QUERY --------------------
        voltQueueSQL(updateAll);
        final VoltTable results[] = voltExecuteSQL();
        assert(results.length == 1);
        LOG.info(this.getTransactionState() + " - RESULTS:\n" + results[0]);

        // -------------------- LOCK AFTER QUERY --------------------
        ProfileMeasurement pm_after = new ProfileMeasurement("AFTER");
        LOG.info(this.getTransactionState() + " - Blocking until LOCK_AFTER is released");
        pm_after.start();
        try {
            // Notify others before we lock
            NOTIFY_AFTER.release();
            LOCK_AFTER.acquire();
            LOCK_AFTER.release();
        } catch (InterruptedException ex) {
            ex.printStackTrace();
            throw new VoltAbortException(ex.getMessage());
        } finally {
            NOTIFY_AFTER.drainPermits();
            pm_after.stop();
            LOG.info("AWAKE - " + pm_after.debug());
        }
       
        if (SHOULD_ABORT.get()) {
            String msg = "Txn aborted because somebody asked us to! Deal with it!";
            throw new VoltAbortException(msg);
View Full Code Here

        // txn has been restarted before), then we don't want to block on
        // any of the locks.
        boolean takeLocks = (this.getTransactionState().getRestartCounter() == 0);
       
        // -------------------- LOCK BEFORE QUERY --------------------
        ProfileMeasurement pm_before = new ProfileMeasurement("BEFORE");
        LOG.info(this.getTransactionState() + " - Blocking until LOCK_BEFORE is released");
        pm_before.start();
        try {
            // Notify others before we lock
            NOTIFY_BEFORE.release();
            if (takeLocks) LOCK_BEFORE.acquire();
        } catch (InterruptedException ex) {
            ex.printStackTrace();
            throw new VoltAbortException(ex.getMessage());
        } finally {
            NOTIFY_BEFORE.drainPermits();
            pm_before.stop();
            LOG.info("AWAKE - " + pm_before.debug());
        }
       
        // BATCH #1
        voltQueueSQL(GetAccount, sendAcct);
        voltQueueSQL(GetAccount, destAcct);
        final VoltTable acctResults[] = voltExecuteSQL();
        assert(acctResults != null);
       
        // BATCH #2
        voltQueueSQL(GetCheckingBalance, sendAcct);
        final VoltTable balResults[] = voltExecuteSQL();
        assert(balResults != null);
       
        // BATCH #3
        voltQueueSQL(UpdateCheckingBalance, amount*-1d, sendAcct);
        voltQueueSQL(UpdateCheckingBalance, amount, destAcct);
        final VoltTable updateResults[] = voltExecuteSQL();
       
        // -------------------- LOCK AFTER QUERY --------------------
        ProfileMeasurement pm_after = new ProfileMeasurement("AFTER");
        LOG.info(this.getTransactionState() + " - Blocking until LOCK_AFTER is released");
        pm_after.start();
        try {
            // Notify others before we lock
            NOTIFY_AFTER.release();
            if (takeLocks) LOCK_AFTER.acquire();
        } catch (InterruptedException ex) {
            ex.printStackTrace();
            throw new VoltAbortException(ex.getMessage());
        } finally {
            NOTIFY_AFTER.drainPermits();
            pm_after.stop();
            LOG.info("AWAKE - " + pm_after.debug());
        }
       
        return (updateResults);
    }
View Full Code Here

//            m_localserver.waitForInitialization();
        }

       
        if (m_loaderClass != null && m_config.noLoader == false) {
            ProfileMeasurement stopwatch = new ProfileMeasurement("load").start();
            this.startLoader();
            stopwatch.stop();
            if (this.failed) System.exit(1);
            LOG.info(String.format("Completed %s loading phase in %.2f sec",
                                   this.projectBuilder.getProjectName().toUpperCase(),
                                   stopwatch.getTotalThinkTimeSeconds()));
        } else if (debug.val && m_config.noLoader) {
            LOG.debug("Skipping data loading phase");
        }

        // Start the clients
View Full Code Here

        if (hstore_conf.client.blocking) {
            debugOpts += ", concurrent=" + hstore_conf.client.blocking_concurrent;
        }
        debugOpts += "]";
       
        ProfileMeasurement stopwatch = new ProfileMeasurement("clients").start();
        LOG.info(String.format("Starting %s execution with %d %sclient%s %s",
                 this.projectBuilder.getProjectName().toUpperCase(),
                 m_clientThreads.size(),
                 (hstore_conf.client.blocking ? "blocking " : ""),
                 (m_clientThreads.size() > 1 ? "s" : ""),
                 debugOpts));
        if (m_config.statsDatabaseURL != null) {
            LOG.info("Client Stats Database: " + m_config.statsDatabaseURL);
        }
       
        // ---------------------------------------------------------------------------------
       
        // HACK
        int gdb_sleep = 0;
        if (gdb_sleep > 0) {
            LOG.info("Sleeping for " + gdb_sleep + " waiting for GDB");
            ThreadUtil.sleep(gdb_sleep*1000);
        }
       
        currentResults = new BenchmarkResults(hstore_conf.client.interval,
                                                hstore_conf.client.duration,
                                                m_clientThreads.size());
        currentResults.setEnableBasePartitions(hstore_conf.client.output_basepartitions);
       
       
        long nextIntervalTime = hstore_conf.client.interval;
        for (int i = 0; i < m_clients.size(); i++) {
            ClientStatusThread t = new ClientStatusThread(this, i);
            t.setUncaughtExceptionHandler(this.exceptionHandler);
            t.start();
            m_statusThreads.add(t);
        } // FOR
        if (debug.val)
            LOG.debug(String.format("Started %d %s",
                      m_statusThreads.size(), ClientStatusThread.class.getSimpleName()));

        // Get a connection to the cluster
        Client local_client = this.getClientConnection();
       
        // Spin on whether all clients are ready
        while (m_clientsNotReady.get() > 0 && this.stop == false) {
            if (debug.val)
                LOG.debug(String.format("Waiting for %d clients to come online", m_clientsNotReady.get()));
            try {
                Thread.sleep(500);
            } catch (InterruptedException ex) {
                if (this.stop == false) throw ex;
                return;
            }
        } // WHILE
        stopwatch.stop();
        LOG.info(String.format("Initialized %d %s client threads in %.2f sec",
                 m_clientThreads.size(),
                 this.projectBuilder.getProjectName().toUpperCase(),
                 stopwatch.getTotalThinkTimeSeconds()));
       
        if (this.stop) {
            if (debug.val) LOG.debug("Stop flag is set to true");
            return;
        }
View Full Code Here

        // Calculate the actual cost too while we're at it...
        TimeIntervalCostModel<SingleSitedCostModel> cm = new TimeIntervalCostModel<SingleSitedCostModel>(args.catalogContext, SingleSitedCostModel.class, args.num_intervals);
        cm.applyDesignerHints(args.designer_hints);
        double upper_bound = cm.estimateWorkloadCost(args.catalogContext, args.workload);

        final ProfileMeasurement timer = new ProfileMeasurement("timer").start();
        LowerBoundsCalculator lb = new LowerBoundsCalculator(info, args.num_intervals);
        double lower_bound = lb.calculate(args.workload);
        timer.stop();

        ListOrderedMap<String, Object> m = new ListOrderedMap<String, Object>();
        m.put("# of Partitions", args.catalogContext.numberOfPartitions);
        m.put("# of Intervals", args.num_intervals);
        m.put("Lower Bound", String.format("%.03f", lower_bound));
        m.put("Upper Bound", String.format("%.03f", upper_bound));
        m.put("Search Time", String.format("%.2f sec", timer.getTotalThinkTimeSeconds()));

        for (Entry<String, Object> e : m.entrySet()) {
            LOG.info(String.format("%-20s%s", e.getKey() + ":", e.getValue().toString()));
        } // FOR
    }
View Full Code Here

        this.tickCallback(counter);
       
        if (debug.val) {
            if (this.computeTime.isEmpty() == false) {
                for (String txnName : this.computeTime.keySet()) {
                    ProfileMeasurement pm = this.computeTime.get(txnName);
                    if (pm.getInvocations() != 0) {
                        LOG.debug(String.format("[%02d] - %s COMPUTE TIME: %s", counter, txnName, pm.debug()));
                        pm.reset();
                    }
                } // FOR
            }
            LOG.debug("Client Queue Time: " + this.m_voltClient.getQueueTime().debug());
            this.m_voltClient.getQueueTime().reset();
View Full Code Here

     * Must be called before stopComputeTime()
     * @see BenchmarkComponent.stopComputeTime
     * @param txnName
     */
    protected synchronized void startComputeTime(String txnName) {
        ProfileMeasurement pm = this.computeTime.get(txnName);
        if (pm == null) {
            pm = new ProfileMeasurement(txnName);
            this.computeTime.put(txnName, pm);
        }
        pm.start();
    }
View Full Code Here

     * Must be called after startComputeTime()
     * @see BenchmarkComponent.startComputeTime
     * @param txnName
     */
    protected synchronized void stopComputeTime(String txnName) {
        ProfileMeasurement pm = this.computeTime.get(txnName);
        assert(pm != null) : "Unexpected " + txnName;
        pm.stop();
    }
View Full Code Here

            }
            if (hints.target_plan != null) {
                LOG.info("Searching for target PartitionPlan '" + hints.target_plan_path + "'");
            }

            ProfileMeasurement timer = new ProfileMeasurement("timer").start();
            try {
                this.traverse(start, 0);
            } catch (Exception ex) {
                LOG.error("Failed to execute search", ex);
                throw new RuntimeException(ex);
            } finally {
                timer.stop();
                if (this.halt_reason == null)
                    this.halt_reason = HaltReason.EXHAUSTED_SEARCH;
                this.completed_search = true;
            }
            LOG.info(String.format("Search Halted - %s [%.2f sec]", this.halt_reason, timer.getTotalThinkTimeSeconds()));
        }
View Full Code Here

TOP

Related Classes of edu.brown.profilers.ProfileMeasurement

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.