Example usage for com.google.common.cache CacheStats minus

List of usage examples for com.google.common.cache CacheStats minus

Introduction

In this page you can find the example usage for com.google.common.cache CacheStats minus.

Prototype

public CacheStats minus(CacheStats other) 

Source Link

Document

Returns a new CacheStats representing the difference between this CacheStats and other .

Usage

From source file:com.google.devtools.build.lib.runtime.CacheFileDigestsModule.java

@Override
public void afterCommand() {
    super.afterCommand();

    if (stats != null) {
        CacheStats newStats = DigestUtils.getCacheStats();
        Preconditions.checkNotNull(newStats, "The cache is enabled so we must get some stats back");
        logStats("Accumulated cache stats after command", newStats);
        logStats("Cache stats for finished command", newStats.minus(stats));
        stats = null; // Silence stats until next command that uses the executor.
    }/*w  w w .j av  a  2  s .c  o  m*/
}