libzypp 17.37.17
DownloadProgressTracker.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#ifndef ZYPP_MEDIA_DETAIL_DOWNLOADPROGRESSTRACKER_INCLUDED
10#define ZYPP_MEDIA_DETAIL_DOWNLOADPROGRESSTRACKER_INCLUDED
11
12#include <chrono>
13#include <optional>
14
15namespace zypp::internal {
16
18
19 using clock = std::chrono::steady_clock;
20
21 std::optional<clock::time_point> _timeStart;
22 std::optional<clock::time_point> _timeLast;
23
24 double _dnlTotal = 0.0;
25 double _dnlLast = 0.0;
26 double _dnlNow = 0.0;
27
28 int _dnlPercent= 0;
29
30 double _drateTotal= 0.0;
31 double _drateLast = 0.0;
32
33 void updateStats( double dltotal = 0.0, double dlnow = 0.0 );
34};
35
36
37}
38
39
40#endif
std::optional< clock::time_point > _timeStart
Start total stats.
double _dnlTotal
Bytes to download or 0 if unknown.
double _drateLast
Download rate in last period.
std::optional< clock::time_point > _timeLast
Start last period(~1sec)
double _drateTotal
Download rate so far.
double _dnlLast
Bytes downloaded at period start.
double _dnlNow
Bytes downloaded now.
int _dnlPercent
Percent completed or 0 if _dnlTotal is unknown.
void updateStats(double dltotal=0.0, double dlnow=0.0)