aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CacheStats.java
blob: d53b6398d4b7052b6826b02ea06c61136953165a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.persistence;

/**
 * Statistics for caches used by {@link com.yahoo.vespa.hosted.provision.NodeRepository}.
 *
 * @author mpolden
 */
public class CacheStats {

    private final double hitRate;
    private final long evictionCount;
    private final long size;

    public CacheStats(double hitRate, long evictionCount, long size) {
        this.hitRate = hitRate;
        this.evictionCount = evictionCount;
        this.size = size;
    }

    /** The fraction of lookups that resulted in a hit */
    public double hitRate() {
        return hitRate;
    }

    /** The number of entries that have been evicted */
    public long evictionCount() {
        return evictionCount;
    }

    /** The current size of the cache */
    public long size() {
        return size;
    }

}