[Dar-libdar_api] Progress reporting
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
|
From: Johnathan B. <jk...@us...> - 2005-03-29 08:37:59
|
Hi Denis,
I'm interested in being able to get progress on libdar operations while the=
y=20
happen. Something like a visual representation of the libdar::statistics=20
structure as the counters are being incremented would be helpful.
Since libdar already provides this structure at the end of the operation, i=
t=20
seems it would be possible to store it in the user_interaction abstract=20
class, giving the user access to it at will, perhaps via internal accessor=
=20
methods involving mutexes. One could argue that providing the user with=20
operation stats is a form of user interaction anyway. So you could then get=
=20
rid of the separate "libdar::statistics" parameter in each archive operatio=
n=20
method.
Another way could be to change=20
void libdar::user_interaction::warning( const std::string & message )
to=20
void libdar::user_interaction::warning( const libdar::message & info )
where info is=20
struct info
{
std::string message;
bool progress_update;
libdar::statistics stats;
}
(or change it to void libdar::user_interaction::warning( const std::string =
&=20
message, const libdar::statistics & stats ) )
Then I could do the following in KDar:
KDarInteraction::warning( const libdar::info info)
{
if ( info.progress_update )
{
m_inodesProcessed =3D info.stats.treated;
progressBar->update( (int) (m_inodesProcessed*100/totalInodes) );
}
}
where totalInodes is computed by running the creation operation in dry-run=
=20
mode beforehand or concurrently as a separate, but much faster, thread (to =
be=20
done by the client).
What do you think?
Cheers,
JB
=2D-=20
Johnathan K. Burchill, Ph.D.
jk...@us...
|