TimeToFirstByteEstimator


@UnstableApi
public interface TimeToFirstByteEstimator

Known direct subclasses
ExponentialWeightedAverageTimeToFirstByteEstimator

Implementation of TimeToFirstByteEstimator based on exponential weighted average.

PercentileTimeToFirstByteEstimator

Implementation of TimeToFirstByteEstimator that returns a configured percentile of a sliding window of collected response times.


Provides an estimate of the time to first byte of a transfer.

Summary

Public methods

abstract long

Returns the estimated time to first byte of the response body, in microseconds, or TIME_UNSET if no estimate is available.

abstract void

Called when a transfer is being initialized.

abstract void

Called when a transfer starts.

abstract void

Resets the estimator.

Public methods

getTimeToFirstByteEstimateUs

abstract long getTimeToFirstByteEstimateUs()

Returns the estimated time to first byte of the response body, in microseconds, or TIME_UNSET if no estimate is available.

onTransferInitializing

abstract void onTransferInitializing(DataSpec dataSpec)

Called when a transfer is being initialized.

Parameters
DataSpec dataSpec

Describes the data for which the transfer is initialized.

onTransferStart

abstract void onTransferStart(DataSpec dataSpec)

Called when a transfer starts.

Parameters
DataSpec dataSpec

Describes the data being transferred.

reset

abstract void reset()

Resets the estimator.