Class IngestionStatsUtils

java.lang.Object
com.linkedin.davinci.stats.IngestionStatsUtils

public class IngestionStatsUtils extends Object
Utility methods for computing ingestion statistics from a StoreIngestionTask. These methods are shared between IngestionStats (Tehuti) and com.linkedin.davinci.stats.ingestion.IngestionOtelStats (OpenTelemetry).
  • Method Details

    • hasActiveIngestionTask

      public static boolean hasActiveIngestionTask(StoreIngestionTask task)
      Checks if the given task is active (non-null and running).
      Parameters:
      task - The ingestion task to check
      Returns:
      true if the task is non-null and running, false otherwise
    • getIngestionTaskErroredGauge

      public static int getIngestionTaskErroredGauge(StoreIngestionTask task)
      Gets the ingestion task error count. To prevent this metric being too noisy and align with the PreNotificationCheck of reportError, this metric should only return non-zero if the ingestion task errored after EOP is received for any of the partitions.
      Parameters:
      task - The ingestion task to get error count from
      Returns:
      The number of failed partitions if any partition has completed, 0 otherwise
    • getWriteComputeErrorCode

      public static int getWriteComputeErrorCode(StoreIngestionTask task)
      Gets the write compute error code from the ingestion task.
      Parameters:
      task - The ingestion task to get error code from
      Returns:
      The write compute error code, or INACTIVE_STORE_INGESTION_TASK code if task is inactive
    • getStorageQuotaUsed

      public static double getStorageQuotaUsed(StoreIngestionTask task)
      Gets the storage quota usage from the ingestion task.
      Parameters:
      task - The ingestion task to get quota usage from
      Returns:
      The disk quota usage as a ratio (0.0-1.0), or 0 if unavailable