Class AggVersionedBlobTransferStats

All Implemented Interfaces:
StoreDataChangedListener

public class AggVersionedBlobTransferStats extends AbstractVeniceAggVersionedStats<BlobTransferStats,BlobTransferStatsReporter>
Aggregates blob transfer statistics at the store version level. This class manages versioned statistics for blob transfer operations, tracking metrics such as response counts, throughput, transfer times, and bytes sent/received for each store version. It extends AbstractVeniceAggVersionedStats to provide automatic aggregation across all versions of a store.

OTel stats lifecycle: OTel stats are created lazily by getBlobTransferOtelStats(java.lang.String) and updated by onVersionInfoUpdated(java.lang.String, int, int) via computeIfPresent. This class uses eager loading (loadAllStats() is NOT overridden), so onVersionInfoUpdated needs a null guard because it is called during the super() constructor before subclass fields (otelStatsMap) are initialized. cleanupVersionResources is not overridden because BlobTransferOtelStats has no per-version state to clean up — version classification is handled by volatile VersionInfo, which is updated separately.

  • Constructor Details

    • AggVersionedBlobTransferStats

      public AggVersionedBlobTransferStats(io.tehuti.metrics.MetricsRepository metricsRepository, ReadOnlyStoreRepository metadataRepository, VeniceServerConfig serverConfig)
      Constructs an AggVersionedBlobTransferStats instance.
      Parameters:
      metricsRepository - the metrics repository for recording statistics
      metadataRepository - the store metadata repository
      serverConfig - the Venice server configuration
    • AggVersionedBlobTransferStats

      public AggVersionedBlobTransferStats(io.tehuti.metrics.MetricsRepository metricsRepository, ReadOnlyStoreRepository metadataRepository, VeniceServerConfig serverConfig, Time time)
      Constructor for testing that allows injecting a Time instance.
      Parameters:
      metricsRepository - the metrics repository for recording statistics
      metadataRepository - the store metadata repository
      serverConfig - the Venice server configuration
      time - the time instance for testing purposes
  • Method Details

    • onVersionInfoUpdated

      protected void onVersionInfoUpdated(String storeName, int currentVersion, int futureVersion)
      Updates version info for existing OTel stats only. Null guard needed because eager loading calls this from the super() constructor before otelStatsMap is initialized.
      Overrides:
      onVersionInfoUpdated in class AbstractVeniceAggVersionedStats<BlobTransferStats,BlobTransferStatsReporter>
    • handleStoreDeleted

      public void handleStoreDeleted(String storeName)
      Specified by:
      handleStoreDeleted in interface StoreDataChangedListener
      Overrides:
      handleStoreDeleted in class AbstractVeniceAggVersionedStats<BlobTransferStats,BlobTransferStatsReporter>
    • recordBlobTransferResponsesCount

      public void recordBlobTransferResponsesCount(String storeName, int version)
      Record the blob transfer request count (Tehuti only).

      OTel metrics are intentionally NOT recorded here to avoid double-counting. OTel uses a single counter with a VeniceResponseStatusCategory dimension, recorded by recordBlobTransferResponsesBasedOnBoostrapStatus(java.lang.String, int, boolean) instead. The total is the sum of SUCCESS + FAIL in OTel.

    • recordBlobTransferResponsesBasedOnBoostrapStatus

      public void recordBlobTransferResponsesBasedOnBoostrapStatus(String storeName, int version, boolean isBlobTransferSuccess)
      Records the blob transfer request count based on the bootstrap status (Tehuti and OTel).
      Parameters:
      storeName - the store name
      version - the version of the store
      isBlobTransferSuccess - true if the blob transfer is successful, false otherwise
    • recordBlobTransferFileReceiveThroughput

      public void recordBlobTransferFileReceiveThroughput(String storeName, int version, double throughput)
      Record the blob transfer file receive throughput (Tehuti only).

      OTel does not have a separate throughput metric — throughput is derivable as the rate of bytes.received.

    • recordBlobTransferTimeInSec

      public void recordBlobTransferTimeInSec(String storeName, int version, double timeInSec)
      Records the blob transfer time (Tehuti and OTel).
      Parameters:
      storeName - the store name
      version - the version of the store
      timeInSec - the time in seconds
    • recordBlobTransferBytesReceived

      public void recordBlobTransferBytesReceived(String storeName, int version, long value)
      Records the number of bytes received during a blob transfer operation (Tehuti and OTel).
      Parameters:
      storeName - the name of the Venice store
      version - the version number of the store
      value - the number of bytes received
    • recordBlobTransferBytesSent

      public void recordBlobTransferBytesSent(String storeName, int version, long value)
      Records the number of bytes sent during a blob transfer operation (Tehuti and OTel).
      Parameters:
      storeName - the name of the Venice store
      version - the version number of the store
      value - the number of bytes sent