Examples of PartitionExecutorProfiler


Examples of edu.brown.profilers.PartitionExecutorProfiler

    @Override
    protected void populateColumnSchema(ArrayList<ColumnInfo> columns) {
        super.populateColumnSchema(columns);
       
        // Make a dummy profiler just so that we can get the fields from it
        PartitionExecutorProfiler profiler = new PartitionExecutorProfiler();
        assert(profiler != null);
       
        columns.add(new VoltTable.ColumnInfo("PARTITION", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("TRANSACTIONS", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("ELAPSED_TIME", VoltType.BIGINT));
//        columns.add(new VoltTable.ColumnInfo("CONFLICT_CHECKER", VoltType.STRING));
        for (ProfileMeasurement pm : profiler.getProfileMeasurements()) {
            String name = pm.getName().toUpperCase();
            // We need two columns per ProfileMeasurement
            //  (1) The total think time in nanoseconds
            //  (2) The number of invocations
            columns.add(new VoltTable.ColumnInfo(name, VoltType.BIGINT));
View Full Code Here

Examples of edu.brown.profilers.PartitionExecutorProfiler

    @Override
    protected synchronized void updateStatsRow(Object rowKey, Object[] rowValues) {
        Integer partition = (Integer)rowKey;
        PartitionExecutor.Debug dbg = hstore_site.getPartitionExecutor(partition).getDebugContext();
        PartitionExecutorProfiler profiler = dbg.getProfiler();
        assert(profiler != null);
       
        int offset = columnNameToIndex.get("PARTITION");
        rowValues[offset++] = partition;
        rowValues[offset++] = profiler.numTransactions;
        rowValues[offset++] = System.currentTimeMillis() - profiler.start_time;
       
//        if (dbg.getSpecExecConflictChecker() != null) {
//            rowValues[offset++] = dbg.getSpecExecConflictChecker().getClass().getSimpleName();
//        } else {
//            rowValues[offset++] = null;
//        }
       
        for (ProfileMeasurement pm : profiler.getProfileMeasurements()) {
            rowValues[offset++] = pm.getTotalThinkTime();
            rowValues[offset++] = pm.getInvocations();
        } // FOR
        super.updateStatsRow(rowKey, rowValues);
    }
View Full Code Here

Examples of edu.brown.profilers.PartitionExecutorProfiler

       
        // Examine the stats output.
        VoltTable vt = cresponse.getResults()[0];
        System.err.println(VoltTableUtil.format(vt));
        assertEquals(NUM_PARTITONS, vt.getRowCount());
        PartitionExecutorProfiler profiler = this.executor.getDebugContext().getProfiler();
        assertNotNull(profiler);
        while (vt.advanceRow()) {
            int partition = (int)vt.getLong("PARTITION");
            assertTrue(partition >= 0);
            assertTrue(partition < NUM_PARTITONS);
View Full Code Here

Examples of edu.brown.profilers.PartitionExecutorProfiler

        TransactionQueueManager queueManager = hstore_site.getTransactionQueueManager();
        TransactionQueueManager.Debug queueManagerDebug = queueManager.getDebugContext();
        HStoreThreadManager threadManager = hstore_site.getThreadManager();
        HStoreThreadManager.Debug threadManagerDebug = threadManager.getDebugContext();
       
        PartitionExecutorProfiler total = new PartitionExecutorProfiler();
       
        // EXECUTION ENGINES
        Map<Integer, String> partitionLabels = new HashMap<Integer, String>();
        ObjectHistogram<Integer> invokedTxns = new ObjectHistogram<Integer>();
        Long txn_id = null;
       
        for (int partition : hstore_site.getLocalPartitionIds().values()) {
            String partitionLabel = String.format("%02d", partition);
            partitionLabels.put(partition, partitionLabel);
           
            PartitionExecutor executor = hstore_site.getPartitionExecutor(partition);
            if (executor == null) continue;
            PartitionExecutor.Debug executorDebug = executor.getDebugContext();
            PartitionExecutorProfiler profiler = executorDebug.getProfiler();
            PartitionLockQueue lockQueue = queueManager.getLockQueue(partition);
           
            // Queue Information
            Map<String, Object> m = new LinkedHashMap<String, Object>();
           
            // PartitionLockQueue
            String queueStatus = String.format("%d queued / %3d blocked / %3d spec-exec / %3d restart\n",
                                               lockQueue.size(),
                                               executorDebug.getBlockedWorkCount(),
                                               executorDebug.getBlockedSpecExecCount(),
                                               queueManagerDebug.getRestartQueueSize()
            );
           
            queueStatus += String.format("%s [limit=%d, release=%d] %s",
                                               lockQueue.getQueueState(),
                                               lockQueue.getThrottleThreshold(),
                                               lockQueue.getThrottleRelease(),
                                               (lockQueue.isThrottled() ? "*THROTTLED* " : ""));
            txn_id = queueManagerDebug.getCurrentTransaction(partition);
            if (txn_id != null) {
                AbstractTransaction ts = hstore_site.getTransaction(txn_id);
                if (ts != null) {
                    PartitionCountingCallback<AbstractTransaction> callback = ts.getInitCallback();
                    if (callback != null) {
                        queueStatus += String.format("\nReceivedPartitions=%s / AllPartitions=%s",
                                                      callback.getReceivedPartitions(), callback.getPartitions());
                    }
                }
            }
            m.put("Lock Queue", queueStatus);
           
            if (profiler != null) {
                String inner = String.format("%d current / %d processed\n%s",
                                             executorDebug.getWorkQueueSize(),
                                             profiler.numMessages.getSampleCount(),
                                             profiler.numMessages.toString(30, 20));
                m.put("Work Queue", inner);
            } else {
                m.put("Work Queue", String.format("%d current", executorDebug.getWorkQueueSize()));
            }
           
            txn_id = executorDebug.getCurrentTxnId();
            m.put("Current Txn", String.format("%s / %s", (txn_id != null ? "#"+txn_id : "-"), executorDebug.getExecutionMode()));
            AbstractTransaction current_dtxn = executorDebug.getCurrentDtxn();
            m.put("Current DTXN", (current_dtxn == null ? "-" : current_dtxn));
           
            txn_id = executorDebug.getLastExecutedTxnId();
            m.put("Last Executed Txn", (txn_id != null ? "#"+txn_id : "-"));
           
            txn_id = executorDebug.getLastCommittedTxnId();
            m.put("Last Committed Txn", (txn_id != null ? "#"+txn_id : "-"));
           
            // Partition Executor Profiler Info
            if (hstore_conf.site.exec_profiling) {
                PartitionExecutorProfiler lastProfiler = this.lastExecMeasurements.get(executor);
                PartitionExecutorProfiler nextProfiler = new PartitionExecutorProfiler();
                invokedTxns.put(partition, (int)profiler.txn_time.getInvocations());
               
                AbstractProfiler profilers[] = { profiler, lastProfiler, nextProfiler, total };
                for (ProfileMeasurement pm : profilers[0].getProfileMeasurements()) {
                    String name = pm.getName();
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.