Library Version 12.1.6.2

Statistic Functions
Prev | Chapter 3. Berkeley DB Client Driver APIs | Next

## Statistic Functions

All statistic functions in the Java base APIs are supported in the driver APIs. In addition, a function that returns multiple environment statistics at once is provided to save a few client-server round trips when multiple statistics are needed:

    SEnvironment env = ...

    SMultiStatsConfig config = new SMultiStatsConfig();

    // Include cache file statistics in the result.
    config.setCacheFileConfig(true, null);

    // Include log statistics in the result and reset it.
    config.setLogConfig(true, new SStatsConfig().setClear(true));

    // Retrieve both statistics.
    SMultiStats multiStats = env.getMultipleStats(config);

    // Get cache file statistics.
    SCacheFileStats[] cacheFileStats = multiStats.getCacheFileStats();

    // Get log statistics.
    SLogStats logStats = multiStats.getLogStats();

Prev | Up | Next
Key/Data Pairs and Bulk Operations | Home | Secondary Databases