Codota Logo
CacheStats.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.google.common.cache.CacheStats
constructor

Best Java code snippets using com.google.common.cache.CacheStats.<init> (Showing top 20 results out of 315)

  • Common ways to obtain CacheStats
private void myMethod () {
CacheStats c =
  • Codota IconLoadingCache cache;cache.stats()
  • Codota IconCache cache;cache.stats()
  • Codota IconForwardingCache forwardingCache;forwardingCache.delegate().stats()
  • Smart code suggestions by Codota
}
origin: google/guava

/**
 * Returns a new {@code CacheStats} representing the sum of this {@code CacheStats} and {@code
 * other}.
 *
 * @since 11.0
 */
public CacheStats plus(CacheStats other) {
 return new CacheStats(
   hitCount + other.hitCount,
   missCount + other.missCount,
   loadSuccessCount + other.loadSuccessCount,
   loadExceptionCount + other.loadExceptionCount,
   totalLoadTime + other.totalLoadTime,
   evictionCount + other.evictionCount);
}
origin: google/j2objc

/**
 * Returns a new {@code CacheStats} representing the sum of this {@code CacheStats} and {@code
 * other}.
 *
 * @since 11.0
 */
public CacheStats plus(CacheStats other) {
 return new CacheStats(
   hitCount + other.hitCount,
   missCount + other.missCount,
   loadSuccessCount + other.loadSuccessCount,
   loadExceptionCount + other.loadExceptionCount,
   totalLoadTime + other.totalLoadTime,
   evictionCount + other.evictionCount);
}
origin: wildfly/wildfly

/**
 * Returns a new {@code CacheStats} representing the sum of this {@code CacheStats} and {@code
 * other}.
 *
 * @since 11.0
 */
public CacheStats plus(CacheStats other) {
 return new CacheStats(
   hitCount + other.hitCount,
   missCount + other.missCount,
   loadSuccessCount + other.loadSuccessCount,
   loadExceptionCount + other.loadExceptionCount,
   totalLoadTime + other.totalLoadTime,
   evictionCount + other.evictionCount);
}
origin: google/guava

/**
 * Returns a new {@code CacheStats} representing the difference between this {@code CacheStats}
 * and {@code other}. Negative values, which aren't supported by {@code CacheStats} will be
 * rounded up to zero.
 */
public CacheStats minus(CacheStats other) {
 return new CacheStats(
   Math.max(0, hitCount - other.hitCount),
   Math.max(0, missCount - other.missCount),
   Math.max(0, loadSuccessCount - other.loadSuccessCount),
   Math.max(0, loadExceptionCount - other.loadExceptionCount),
   Math.max(0, totalLoadTime - other.totalLoadTime),
   Math.max(0, evictionCount - other.evictionCount));
}
origin: google/j2objc

/**
 * Returns a new {@code CacheStats} representing the difference between this {@code CacheStats}
 * and {@code other}. Negative values, which aren't supported by {@code CacheStats} will be
 * rounded up to zero.
 */
public CacheStats minus(CacheStats other) {
 return new CacheStats(
   Math.max(0, hitCount - other.hitCount),
   Math.max(0, missCount - other.missCount),
   Math.max(0, loadSuccessCount - other.loadSuccessCount),
   Math.max(0, loadExceptionCount - other.loadExceptionCount),
   Math.max(0, totalLoadTime - other.totalLoadTime),
   Math.max(0, evictionCount - other.evictionCount));
}
origin: wildfly/wildfly

/**
 * Returns a new {@code CacheStats} representing the difference between this {@code CacheStats}
 * and {@code other}. Negative values, which aren't supported by {@code CacheStats} will be
 * rounded up to zero.
 */
public CacheStats minus(CacheStats other) {
 return new CacheStats(
   Math.max(0, hitCount - other.hitCount),
   Math.max(0, missCount - other.missCount),
   Math.max(0, loadSuccessCount - other.loadSuccessCount),
   Math.max(0, loadExceptionCount - other.loadExceptionCount),
   Math.max(0, totalLoadTime - other.totalLoadTime),
   Math.max(0, evictionCount - other.evictionCount));
}
origin: google/guava

@Override
public CacheStats snapshot() {
 return new CacheStats(
   hitCount.sum(),
   missCount.sum(),
   loadSuccessCount.sum(),
   loadExceptionCount.sum(),
   totalLoadTime.sum(),
   evictionCount.sum());
}
origin: google/j2objc

@Override
public CacheStats snapshot() {
 return new CacheStats(
   hitCount.sum(),
   missCount.sum(),
   loadSuccessCount.sum(),
   loadExceptionCount.sum(),
   totalLoadTime.sum(),
   evictionCount.sum());
}
origin: wildfly/wildfly

@Override
public CacheStats snapshot() {
 return new CacheStats(
   hitCount.sum(),
   missCount.sum(),
   loadSuccessCount.sum(),
   loadExceptionCount.sum(),
   totalLoadTime.sum(),
   evictionCount.sum());
}
origin: ben-manes/caffeine

@Override
public CacheStats stats() {
 com.github.benmanes.caffeine.cache.stats.CacheStats stats = cache.stats();
 return new CacheStats(stats.hitCount(), stats.missCount(), stats.loadSuccessCount(),
   stats.loadFailureCount(), stats.totalLoadTime(), stats.evictionCount());
}
origin: google/guava

public void testMinus() {
 CacheStats one = new CacheStats(11, 13, 17, 19, 23, 27);
 CacheStats two = new CacheStats(53, 47, 43, 41, 37, 31);
 CacheStats diff = two.minus(one);
 assertEquals(76, diff.requestCount());
 assertEquals(42, diff.hitCount());
 assertEquals(42.0 / 76, diff.hitRate());
 assertEquals(34, diff.missCount());
 assertEquals(34.0 / 76, diff.missRate());
 assertEquals(26, diff.loadSuccessCount());
 assertEquals(22, diff.loadExceptionCount());
 assertEquals(22.0 / 48, diff.loadExceptionRate());
 assertEquals(26 + 22, diff.loadCount());
 assertEquals(14, diff.totalLoadTime());
 assertEquals(14.0 / (26 + 22), diff.averageLoadPenalty());
 assertEquals(4, diff.evictionCount());
 assertEquals(new CacheStats(0, 0, 0, 0, 0, 0), one.minus(two));
}
origin: google/guava

 public void testPlus() {
  CacheStats one = new CacheStats(11, 13, 15, 13, 11, 9);
  CacheStats two = new CacheStats(53, 47, 41, 39, 37, 35);

  CacheStats sum = two.plus(one);
  assertEquals(124, sum.requestCount());
  assertEquals(64, sum.hitCount());
  assertEquals(64.0 / 124, sum.hitRate());
  assertEquals(60, sum.missCount());
  assertEquals(60.0 / 124, sum.missRate());
  assertEquals(56, sum.loadSuccessCount());
  assertEquals(52, sum.loadExceptionCount());
  assertEquals(52.0 / 108, sum.loadExceptionRate());
  assertEquals(56 + 52, sum.loadCount());
  assertEquals(48, sum.totalLoadTime());
  assertEquals(48.0 / (56 + 52), sum.averageLoadPenalty());
  assertEquals(44, sum.evictionCount());

  assertEquals(sum, one.plus(two));
 }
}
origin: google/guava

assertEquals(new CacheStats(38, 60, 44, 54, totalLoadTime, 66), counter1.snapshot());
origin: google/guava

public void testSingle() {
 CacheStats stats = new CacheStats(11, 13, 17, 19, 23, 27);
 assertEquals(24, stats.requestCount());
 assertEquals(11, stats.hitCount());
 assertEquals(11.0 / 24, stats.hitRate());
 assertEquals(13, stats.missCount());
 assertEquals(13.0 / 24, stats.missRate());
 assertEquals(17, stats.loadSuccessCount());
 assertEquals(19, stats.loadExceptionCount());
 assertEquals(19.0 / 36, stats.loadExceptionRate());
 assertEquals(17 + 19, stats.loadCount());
 assertEquals(23, stats.totalLoadTime());
 assertEquals(23.0 / (17 + 19), stats.averageLoadPenalty());
 assertEquals(27, stats.evictionCount());
}
origin: google/guava

public void testEmpty() {
 CacheStats stats = new CacheStats(0, 0, 0, 0, 0, 0);
 assertEquals(0, stats.requestCount());
 assertEquals(0, stats.hitCount());
 assertEquals(1.0, stats.hitRate());
 assertEquals(0, stats.missCount());
 assertEquals(0.0, stats.missRate());
 assertEquals(0, stats.loadSuccessCount());
 assertEquals(0, stats.loadExceptionCount());
 assertEquals(0.0, stats.loadExceptionRate());
 assertEquals(0, stats.loadCount());
 assertEquals(0, stats.totalLoadTime());
 assertEquals(0.0, stats.averageLoadPenalty());
 assertEquals(0, stats.evictionCount());
}
origin: apache/jackrabbit-oak

@Override
protected CacheStats getCurrentStats() {
  return new CacheStats(
      hitCount.get(),
      missCount.get(),
      loadSuccessCount.get(),
      loadExceptionCount.get(),
      loadTime.get(),
      evictionCount.get()
  );
}
origin: org.sonatype.sisu/sisu-guava

@Override
public CacheStats snapshot() {
 return new CacheStats(
   hitCount.get(),
   missCount.get(),
   loadSuccessCount.get(),
   loadExceptionCount.get(),
   totalLoadTime.get(),
   evictionCount.get());
}
origin: at.bestsolution.efxclipse.eclipse/com.google.guava

@Override
public CacheStats snapshot() {
 return new CacheStats(
   hitCount.sum(),
   missCount.sum(),
   loadSuccessCount.sum(),
   loadExceptionCount.sum(),
   totalLoadTime.sum(),
   evictionCount.sum());
}
origin: com.diffplug.guava/guava-cache

@Override
public CacheStats snapshot() {
  return new CacheStats(
      hitCount.sum(),
      missCount.sum(),
      loadSuccessCount.sum(),
      loadExceptionCount.sum(),
      totalLoadTime.sum(),
      evictionCount.sum());
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public CacheStats snapshot() {
 return new CacheStats(
   hitCount.sum(),
   missCount.sum(),
   loadSuccessCount.sum(),
   loadExceptionCount.sum(),
   totalLoadTime.sum(),
   evictionCount.sum());
}
com.google.common.cacheCacheStats<init>

Javadoc

Constructs a new CacheStats instance.

Five parameters of the same type in a row is a bad thing, but this class is not constructed by end users and is too fine-grained for a builder.

Popular methods of CacheStats

  • hitCount
    Returns the number of times Cache lookup methods have returned a cached value.
  • evictionCount
    Returns the number of times an entry has been evicted. This count does not include manual Cache#inva
  • missCount
    Returns the number of times Cache lookup methods have returned an uncached (newly loaded) value, or
  • loadExceptionCount
    Returns the number of times Cache lookup methods threw an exception while loading a new value. This
  • totalLoadTime
    Returns the total number of nanoseconds the cache has spent loading new values. This can be used to
  • loadSuccessCount
    Returns the number of times Cache lookup methods have successfully loaded a new value. This is alway
  • requestCount
    Returns the number of times Cache lookup methods have returned either a cached or uncached value. Th
  • hitRate
    Returns the ratio of cache requests which were hits. This is defined as hitCount / requestCount, or
  • loadCount
    Returns the total number of times that Cache lookup methods attempted to load new values. This inclu
  • missRate
    Returns the ratio of cache requests which were misses. This is defined as missCount / requestCount,
  • averageLoadPenalty
    Returns the average time spent loading new values. This is defined as totalLoadTime / (loadSuccessCo
  • loadExceptionRate
    Returns the ratio of cache loading attempts which threw exceptions. This is defined as loadException
  • averageLoadPenalty,
  • loadExceptionRate,
  • toString,
  • minus,
  • plus

Popular in Java

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now