Skip to content

ResponseDownloadStats

buffy.buffyserver.api.v1.models.ResponseDownloadStats

Bases: BaseModel

Statistics about the running or finished download of remote HTTP resource

HINT: This is pydantic model. Every class-attribute is also a parameter

Source code in buffy/buffyserver/api/v1/models.py
class ResponseDownloadStats(BaseModel):
    """Statistics about the running or finished download of remote HTTP resource

    **HINT**: This is pydantic model. Every `class-attribute` is also a `parameter`
    """

    downloaded_bytes: int = 0
    """How many bytes are allready downloaded"""
    avg_bytes_per_sec: int = None
    """The average download speed."""
    download_running_duration_sec: float = None
    """How long is the download or running or how long did it run when finished."""
    download_start_time_unix_ts: float = None
    """The moment when the Buffy-server started the download"""
    total_bytes_to_download: int = None
    """The size of the response content. This value can initaly be unrealiable if the remote webserver reported a wrong value, but will be realiable correct when the download is finished."""
    state: Literal["init", "downloading", "failed", "finished"]
    """State of the download. if `failed` there will be Stacktrace in `error`"""
    error: str = None
    """Stacktrace if download failed"""

avg_bytes_per_sec: int = None class-attribute

The average download speed.

download_running_duration_sec: float = None class-attribute

How long is the download or running or how long did it run when finished.

download_start_time_unix_ts: float = None class-attribute

The moment when the Buffy-server started the download

downloaded_bytes: int = 0 class-attribute

How many bytes are allready downloaded

error: str = None class-attribute

Stacktrace if download failed

state: Literal['init', 'downloading', 'failed', 'finished'] class-attribute

State of the download. if failed there will be Stacktrace in error

total_bytes_to_download: int = None class-attribute

The size of the response content. This value can initaly be unrealiable if the remote webserver reported a wrong value, but will be realiable correct when the download is finished.