Class ServerReadQuotaUsageStats


  • public class ServerReadQuotaUsageStats
    extends AbstractVeniceStats
    For measuring quota requests and rejections for a given store. Specifically not using VeniceVersionedStats due to sophisticated needs: 1. Only requestedQPS, requestedKPS, and (usageRatio) nodeKpsResponsibility need to be versioned. We'd still like to report rejections at the store level, regardless if it came from current or backup version due to stale routing. 2. VeniceVersionedStats is tracking current and future. However, for the purpose of quota we only care about current and backup.
    • Constructor Detail

      • ServerReadQuotaUsageStats

        public ServerReadQuotaUsageStats​(io.tehuti.metrics.MetricsRepository metricsRepository,
                                         java.lang.String name)
      • ServerReadQuotaUsageStats

        public ServerReadQuotaUsageStats​(io.tehuti.metrics.MetricsRepository metricsRepository,
                                         java.lang.String name,
                                         Time time)
    • Method Detail

      • setCurrentVersion

        public void setCurrentVersion​(int version)
      • setBackupVersion

        public void setBackupVersion​(int version)
      • getCurrentVersion

        public int getCurrentVersion()
      • getBackupVersion

        public int getBackupVersion()
      • removeVersion

        public void removeVersion​(int version)
      • recordAllowed

        public void recordAllowed​(int version,
                                  long rcu)
        Parameters:
        rcu - The number of Read Capacity Units that the allowed request cost
      • recordRejected

        public void recordRejected​(int version,
                                   long rcu)
        Parameters:
        rcu - The number of Read Capacity Units tha the rejected request would have cost
      • recordAllowedUnintentionally

        public void recordAllowedUnintentionally​(long rcu)
      • setNodeQuotaResponsibility

        public void setNodeQuotaResponsibility​(int version,
                                               long nodeKpsResponsibility)