Class StatsService

java.lang.Object
edu.ucsb.cs156.diningcachingproxy.services.StatsService

@Service public class StatsService extends Object
In-memory counters tracking cache performance since the proxy was started up. Reset on restart — durable persistence of these stats may come later.
  • Constructor Details

    • StatsService

      public StatsService()
  • Method Details

    • recordHit

      public void recordHit()
    • recordMiss

      public void recordMiss()
    • getTotalRequests

      public long getTotalRequests()
    • getCacheHits

      public long getCacheHits()
    • getCacheMisses

      public long getCacheMisses()
    • getHitRatePercentage

      public double getHitRatePercentage()