TimeToFirstByteEstimator


@UnstableApi
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 functions

Long

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

Unit

Called when a transfer is being initialized.

Unit

Called when a transfer starts.

Unit

Resets the estimator.

Public functions

getTimeToFirstByteEstimateUs

fun getTimeToFirstByteEstimateUs(): Long

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

onTransferInitializing

fun onTransferInitializing(dataSpec: DataSpec!): Unit

Called when a transfer is being initialized.

Parameters
dataSpec: DataSpec!

Describes the data for which the transfer is initialized.

onTransferStart

fun onTransferStart(dataSpec: DataSpec!): Unit

Called when a transfer starts.

Parameters
dataSpec: DataSpec!

Describes the data being transferred.

reset

fun reset(): Unit

Resets the estimator.