Go to the SVN repository for this file.
39 #ifdef DEBUG_RATE_MONITOR 47 #ifdef DEBUG_RATE_MONITOR 48 static voidx_PrintList(
constlist<CRateMonitor::TMark>&
data)
51list<CRateMonitor::TMark>::const_iterator it =
data.begin();
52cout <<
data.size() <<
':'<< endl;
53 for(
size_t n= 0;
n<
data.size();
n++) {
56 "p = "<<
next.first <<
",\t" 57 "t = "<<
next.second;
60 "dp = "<<
prev.first -
next.first <<
",\t" 61 "dt = "<<
prev.second -
next.second << endl;
74 if(
m_Data.front().first > pos ||
75 m_Data.front().second > time) {
82list<TMark>::const_iterator it;
83 if(
m_Data.front().first == pos ||
m_Data.front().second == time
84|| time - (++(it =
m_Data.begin()))->second <
kSpan 87 m_Data.front().first = pos;
88 m_Data.front().second = time;
89 #ifdef DEBUG_RATE_MONITOR 90cout <<
"UPDATED"<< endl;
99 m_Data.push_front(make_pair(pos, time));
100 #ifdef DEBUG_RATE_MONITOR 101cout <<
"ADDED"<< endl;
120list<TMark>::const_iterator it =
m_Data.begin();
122 for(++it; it !=
m_Data.end(); ++it) {
124 doubledt =
prev.second -
next.second;
126 #ifdef DEBUG_RATE_MONITOR 127cout <<
"dt = "<< dt <<
",\td ="<< (
kSpan- dt)
128<<
",\tn = "<< distance(
m_Data.begin(), it) << endl;
134gaps.push_back(make_pair(
prev.first -
next.first, dt));
138 doubledt =
m_Data.front().second -
m_Data.back().second;
141gaps.push_back(make_pair(
m_Data.front().first -
142 m_Data.back ().first, dt));
149 doublerate = double(gaps.front().first) / gaps.front().second;
173 doubleeta = double(
m_Size- pos) / rate;
189 doubletime =
m_Data.front().second;
192time = time * double(
m_Size) / double(pos) - time;
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
double GetETA(void) const
How long it will take to complete, at the current rate.
pair< Uint8, double > TMark
Uint8 GetPos(void) const
Get current progress position (position 0 when job starts)
Uint8 m_Size
Total size of job to be performed.
void Mark(Uint8 pos, double time)
Submit a mark of the job progress.
double GetTimeRemaining(void) const
How long it will take to complete, at the average pace.
list< TMark > m_Data
Measurements as submitted by Mark()
double GetRate(void) const
How fast the recent rate has been, in positions per time unit, using the weighted formula.
double GetPace(void) const
How fast the average pace has been so far, in positions per time unit.
double m_Rate
Cached rate from last calculation.
NCBI C++ auxiliary debug macros.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4