Package com.linkedin.venice.stats
Class ServerReadQuotaUsageStats
java.lang.Object
com.linkedin.venice.stats.AbstractVeniceStats
com.linkedin.venice.stats.ServerReadQuotaUsageStats
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.
OTel metrics use high-perf async counters (ASYNC_COUNTER_FOR_HIGH_PERF_CASES) with
outcome + version role dimensions, recorded separately from Tehuti sensors. Tehuti sensors
are unversioned (no role dimension) so they are recorded directly, not via joint API.
-
Field Summary
Fields inherited from class com.linkedin.venice.stats.AbstractVeniceStats
DELIMITER -
Constructor Summary
ConstructorsConstructorDescriptionServerReadQuotaUsageStats(io.tehuti.metrics.MetricsRepository metricsRepository, String name, Time time, String clusterName) -
Method Summary
Modifier and TypeMethodDescriptionintintvoidrecordAllowed(int version, long rcu) voidrecordAllowedUnintentionally(int version, long rcu) Records requests that were allowed without quota check (quota enforcer not yet initialized or rate limiter not yet allocated for the resource).voidrecordRejected(int version, long rcu) voidremoveVersion(int version) voidsetNodeQuotaResponsibility(int version, long nodeKpsResponsibility) voidupdateVersionInfo(int currentVersion, int backupVersion) Atomically updates both current and backup version numbers.Methods inherited from class com.linkedin.venice.stats.AbstractVeniceStats
avgAndMax, avgAndTotal, getMetricFullName, getMetricsRepository, getName, getSensorFullName, getSensorFullName, isTotalStats, minAndMax, registerOnlyTotalRate, registerOnlyTotalSensor, registerPerStoreAndTotal, registerPerStoreAndTotalSensor, registerSensor, registerSensor, registerSensor, registerSensor, registerSensorAttributeGauge, registerSensorIfAbsent, registerSensorIfAbsent, registerSensorIfAbsent, registerSensorWithAggregate, registerSensorWithAggregate, unregisterAllSensors
-
Constructor Details
-
ServerReadQuotaUsageStats
-
-
Method Details
-
updateVersionInfo
public void updateVersionInfo(int currentVersion, int backupVersion) Atomically updates both current and backup version numbers. This replaces the volatileServerReadQuotaUsageStats.QuotaVersionInforeference in a single write, matching the pattern used byIngestionOtelStats.updateVersionInfo(int, int). -
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 that the rejected request would have cost
-
recordAllowedUnintentionally
public void recordAllowedUnintentionally(int version, long rcu) Records requests that were allowed without quota check (quota enforcer not yet initialized or rate limiter not yet allocated for the resource).Note: OTel records both request count and key count for this outcome. Tehuti records only key count (no request count sensor exists for unintentionally allowed requests). This is an intentional enrichment — OTel provides strictly more granularity than Tehuti here.
- Parameters:
version- The version number being accessedrcu- The number of Read Capacity Units that the request cost
-
setNodeQuotaResponsibility
public void setNodeQuotaResponsibility(int version, long nodeKpsResponsibility)
-