Package com.sleepycat.je

Examples of com.sleepycat.je.StatsConfig


            storeA.get(TestUtils.toByteArray(i + "A"), null);

            storeB.put(TestUtils.toByteArray(i + "B"), new Versioned<byte[]>(value), null);
            storeB.get(TestUtils.toByteArray(i + "B"), null);

            EnvironmentStats statsA = environmentA.getStats(new StatsConfig());
            EnvironmentStats statsB = environmentB.getStats(new StatsConfig());

            long totalCacheSize = statsA.getCacheTotalBytes() + statsB.getCacheTotalBytes();
            System.out.println("A.size:" + statsA.getCacheTotalBytes() + " B.size:"
                               + statsB.getCacheTotalBytes() + " total:" + totalCacheSize + " max:"
                               + maxCacheUsage + " cacheMax:"
View Full Code Here


    public void tearDown() throws Exception {
        FileDeleteStrategy.FORCE.delete(bdbMasterDir);
    }

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

     * StatsConfig().setFast(false)));
     */

    sb.append("Total number of key-value pairs is ").append(_db.count()).append(".\n");
    sb.append("Total number of application elements is ").append(size()).append(".\n");
    final double cacheDataMB = _env.getStats(new StatsConfig().setFast(true)).getDataBytes()
        / (1024.0 * 1024);
    final double mem = (double) (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()
        .freeMemory()) / 1024 / 1024;
    sb.append("Total heap space: ").append(mem).append(" MB.\n");
    final double cacheTotalMB = _env.getStats(new StatsConfig().setFast(true))
        .getCacheTotalBytes() / (1024.0 * 1024);
    sb.append("Total cache size is ").append(cacheTotalMB).append(" MBs.\n");
    sb.append("Cache size used for keys and data is ").append(cacheDataMB).append(" MBs.\n");

    final File storageDir = new File(_storagePath);
View Full Code Here

            worker.join();
        } catch (InterruptedException ex) {
            LOGGER.debug("Interrupted while waiting for worker to complete");
        }
        try {
            LOGGER.debug("FlumePersistenceManager dataset status: {}", database.getStats(new StatsConfig()));
            database.close();
        } catch (final Exception ex) {
            LOGGER.warn("Failed to close database", ex);
        }
        try {
View Full Code Here

    public ReplicatedEnvironmentStats getRepStats(StatsConfig config)
        throws DatabaseException {

        checkHandleIsValid();
        checkEnv();
        final StatsConfig useConfig =
            (config == null) ? StatsConfig.DEFAULT : config;
        return repImpl.getStats(useConfig);
    }
View Full Code Here

            } catch (DatabaseExistsException e) {
                /* Should never happen, ExclusiveCreate is false. */
                throw EnvironmentFailureException.unexpectedException(e);
            }

            StatsConfig statsConfig = new StatsConfig();
            if (progressInterval > 0) {
                statsConfig.setShowProgressInterval(progressInterval);
                statsConfig.setShowProgressStream(out);
            }

            DatabaseStats stats = db.getStats(statsConfig);
            out.println(stats);

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

        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.err.println("Problem: " + lockStat.getNTotalLocks() +
View Full Code Here

    /**
     * Helper for creating a StatsConfig object to use as an operation
     * parameter.
     */
    protected 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

        }

        @Override
        public void run() {

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

            while (true) {
                try {
                    synchronized (this) {
                        wait(30 * 1000);
 
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.