Package com.sleepycat.je

Examples of com.sleepycat.je.StatsConfig


    }

    public String getStats(String storeName, boolean fast) {
        try {
            if(environments.containsKey(storeName)) {
                StatsConfig config = new StatsConfig();
                config.setFast(fast);
                Environment env = environments.get(storeName);
                return env.getStats(config).toString();
            } else {
                // return empty string if environment not created yet
                return "";
View Full Code Here


        numLockTimeoutExceptions = new AtomicLong(0);
        numEnvironmentFailureExceptions = new AtomicLong(0);
    }

    private EnvironmentStats getEnvironmentStats(boolean fast) {
        StatsConfig config = new StatsConfig();
        config.setFast(fast);
        return environment.getStats(config);
    }
View Full Code Here

    }

    public DatabaseStats getBtreeStatsUncached() throws Exception {
        // fast stats does not provide detailed Btree structure.
        // This is invasive and will affect performance.
        return database.getStats(new StatsConfig().setFast(false));
    }
View Full Code Here

        }
    }

    public DatabaseStats getStats(boolean setFast) {
        try {
            StatsConfig config = new StatsConfig();
            config.setFast(setFast);
            return this.getBdbDatabase().getStats(config);
        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error(e);
            throw new VoldemortException(e);
View Full Code Here

            assertEquals(msg, expectValue, seq.get(txn, delta));
        } catch (DatabaseException e) {
            fail(msg + ' ' + e);
        }

        StatsConfig clearConfig = new StatsConfig();
        clearConfig.setFast(true);
        clearConfig.setClear(true);
        SequenceStats stats = seq.getStats(clearConfig);

        assertEquals(msg, 1, stats.getNGets());
        assertEquals(msg, expectCached ? 1 : 0, stats.getNCachedGets());
    }
View Full Code Here

        openEnv(false);

        /* Insert key 2. */
        insert(2);

        StatsConfig clearStats = new StatsConfig();
        clearStats.setClear(true);

        /* Clear before inserting. */
        LockStats stats = env.getLockStats(clearStats);

        /* Insert key 1, which would lock key 2 while inserting. */
 
View Full Code Here

            logManager = env.getLogManager();
            verifyOkayItems(logManager, testRecs, testLsns, false);

            /* Check that we read these items off disk. */
            EnvironmentStats stats = new EnvironmentStats();
            StatsConfig config = new StatsConfig();
            logManager.loadStats(config, stats);
            assertTrue(stats.getNNotResident() >= testRecs.size());

        } catch (Throwable t) {
            t.printStackTrace();
View Full Code Here

        if (!configManager.getBoolean(EnvironmentParams.ENV_CHECK_LEAKS)) {
            return;
        }

        boolean clean = true;
        StatsConfig statsConfig = new StatsConfig();

        /* Fast stats will not return NTotalLocks below. */
        statsConfig.setFast(false);

        LockStats lockStat = lockStat(statsConfig);
        if (lockStat.getNTotalLocks() != 0) {
            clean = false;
            System.out.println("Problem: " + lockStat.getNTotalLocks() +
View Full Code Here

    /**
     * Helper for creating a StatsConfig object to use as an operation
     * parameter.
     */
    private StatsConfig getStatsConfig(Object [] params) {
        StatsConfig statsConfig = new StatsConfig();
        if ((params != null) && (params.length > 0) && (params[0] != null)) {
            Boolean clear = (Boolean) params[0];
            statsConfig.setClear(clear.booleanValue());
        }
        if ((params != null) && (params.length > 1) && (params[1] != null)) {
            Boolean fast = (Boolean) params[1];
            statsConfig.setFast(fast.booleanValue());
        }
        return statsConfig;
    }
View Full Code Here

                DatabaseConfig dbConfig = new DatabaseConfig();
                dbConfig.setReadOnly(true);
                DbInternal.setUseExistingConfig(dbConfig, true);
                Database db = env.openDatabase(null, dbName, dbConfig);
                try {
                    System.out.println(db.getStats(new StatsConfig()));
                } finally {
                    db.close();
                }
                break;
            }
View Full Code Here

TOP

Related Classes of com.sleepycat.je.StatsConfig

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.