code: public static double getPartitionAvgRecordMillis(State state, KafkaPartition partition) {
      double avgRecordMillis = state.getPropAsDouble(
          getPartitionPropName(partition.getTopicName(), partition.getId()) + "." + KafkaSource.AVG_RECORD_MILLIS);
  
      // cap to prevent a poorly behaved topic from impacting the bin-packing
      int avgFetchTimeCap = state.getPropAsInt(ConfigurationKeys.KAFKA_SOURCE_AVG_FETCH_TIME_CAP,
              ConfigurationKeys.DEFAULT_KAFKA_SOURCE_AVG_FETCH_TIME_CAP);
  
      if (avgFetchTimeCap > 0 && avgRecordMillis > avgFetchTimeCap) {
        log.info("Topic {} partition {} has an average fetch time of {}, capping it to {}", partition.getTopicName(),
                  partition.getId(), avgRecordMillis, avgFetchTimeCap);
        avgRecordMillis = avgFetchTimeCap;
      }
  
      return avgRecordMillis;
    }
docs: Get the average time to pull a record of a partition, which is stored in property
  "[topicname].[partitionid].avg.record.millis". If state doesn't contain this property, it returns defaultValue.