26 #ifndef STATISTICS_HPP
27 #define STATISTICS_HPP
29 #include "../my_config.h"
46 #define LOCK_IN pthread_mutex_lock(&lock_mutex)
47 #define LOCK_OUT pthread_mutex_unlock(&lock_mutex)
48 #define LOCK_IN_CONST pthread_mutex_lock(const_cast<pthread_mutex_t *>(&lock_mutex))
49 #define LOCK_OUT_CONST pthread_mutex_unlock(const_cast<pthread_mutex_t *>(&lock_mutex))
54 #define LOCK_OUT_CONST
268 pthread_mutex_t lock_mutex;
304 void increment_locked(
infinint * var)
311 void increment_unlocked(
infinint * var)
316 void add_to_locked(infinint * var,
const infinint & val)
323 void add_to_unlocked(infinint *var,
const infinint & val)
328 infinint returned_locked(
const infinint * var)
const
339 infinint returned_unlocked(
const infinint * var)
const
344 void decrement_locked(infinint * var)
351 void decrement_unlocked(infinint * var)
356 void set_to_locked(infinint *var,
const infinint & val)
363 void set_to_unlocked(infinint *var,
const infinint & val)
368 void sub_from_unlocked(infinint *var,
const infinint & val)
373 void sub_from_locked(infinint *var,
const infinint & val)
decimal class, convert infinint from and to decimal represention
std::string human() const
this produce a string from the decimal stored in the current object
the arbitrary large positive integer class
class used by libdar::archive class to give a summary of treated file during and after an operation
void incr_errored()
increment by one the errored counter
void copy_from(const statistics &ref)
reset mutex and copy data from the object of reference
infinint total() const
total number of file treated
void decr_ignored()
decrement by one the ignored counter
void decr_hard_links()
decrement by one the hard_links counter
void decr_ea_treated()
decrement by one the ea_treated counter
bool locking
whether we use locking or not
infinint errored
files that could not be saved / files that could not be restored (filesystem access right)
infinint hard_links
number of hard linked inodes treated (including those ignored by filters)
void incr_fsa_treated()
increment by one the fsa treated counter
infinint get_deleted() const
returns the current value of the deleted counter
void add_to_ignored(const infinint &val)
increment the ignored counter by a given value
statistics(const statistics &ref)
copy constructor
infinint skipped
files not changed since last backup / file not restored because not saved in backup
infinint treated
number of inode treated (saved, restored, etc.) [all operations]
infinint get_inode_only() const
returns the current value of the inode_only counter
void incr_deleted()
increment by one the deleted counter
std::string get_byte_amount_str() const
returns the current value of the byte_amount counter as a std::string
void sub_from_treated(const infinint &val)
substract value from the treated counter
void incr_ignored()
increment by one the ignored counter
statistics & operator=(const statistics &ref)
copy assignement
void sub_from_ea_treated(const infinint &val)
substract value to the ea_treated counter
infinint get_ignored() const
returns the current value of the ignored counter
void sub_from_fsa_treated(const infinint &val)
substract value to the fsa_treated counter
std::string get_hard_links_str() const
returns the current value of the hard_links counter as a std::string;
infinint ignored
ignored files due to filters
infinint inode_only
files which operation only affected inode metadata not its data
void(statistics::* set_to)(infinint *var, const infinint &val)
generic method for setting a variable to a given value
void decr_deleted()
decrement by one the deleted counter
infinint ea_treated
number of EA saved / number of EA restored
void incr_inode_only()
increment by one the inode_only counter
void move_from(statistics &&ref) noexcept
used by to implement move related operations
infinint get_ea_treated() const
returns the current value of the ea_treated counter
infinint get_tooold() const
returns the current value of the tooold counter
void dump(user_interaction &dialog) const
debuging method
statistics(statistics &&ref)
move constructor
infinint byte_amount
auxilliary counter, holds the wasted bytes due to repeat on change feature for example.
infinint tooold
ignored files because less recent than the filesystem entry [restoration] / modfied during backup
std::string get_ea_treated_str() const
returns the current value of the ea_treated counter as a std::string
void incr_treated()
increment by one the treated counter
void incr_hard_links()
increment by one the hard_links counter
infinint get_errored() const
returns the current value of the errored counter
void decr_tooold()
decrement by one the toold counter
void decr_skipped()
decrement by one the skipped counter
infinint deleted
deleted file seen / number of files deleted during the operation [restoration]
infinint get_fsa_treated() const
returns the current value of the fsa_treated counter
void(statistics::* increment)(infinint *var)
generic method for incrementing a variable
void decr_treated()
decrement by one the treated counter
std::string get_inode_only_str() const
returns the current value of the inode_only counter as a std::string
std::string get_ignored_str() const
returns the current value of the ignored counter as a std::string
std::string get_skipped_str() const
returns the current value of the skipped counter as a std::string
void init(bool lock)
set locking & mutex
void decr_inode_only()
decrement by one the inode_only counter
void sub_from_hard_links(const infinint &val)
substract value to the hard_links counter
infinint fsa_treated
number of FSA saved / number of FSA restored
infinint get_byte_amount() const
returns the current value of the byte_amount counter
infinint get_treated() const
returns the current value of the treated counter
infinint get_hard_links() const
returns the current value of the hard_links counter
void detruit()
release and free the mutex
void(statistics::* add_to)(infinint *var, const infinint &val)
generic method for add a value to a variable
void incr_tooold()
increment by one the tooold counter
void(statistics::* sub_from)(infinint *var, const infinint &val)
generic method for substracting to a variable
void(statistics::* decrement)(infinint *var)
generic method for decrementing a variable
void decr_fsa_treated()
decrement by one the fsa_treated counter
std::string get_errored_str() const
returns the current value of the errored counter as a std::string
infinint(statistics::* returned)(const infinint *var) const
generic method for obtaining the value of a variable
void clear()
reset counters to zero
void add_to_errored(const infinint &val)
increment the errored counter by a given value
void add_to_deleted(const infinint &val)
increment the deleted counter by a given value
void incr_ea_treated()
increment by one the ea_treated counter
std::string get_deleted_str() const
returns the current value of the deleted counter as a std::string
void add_to_byte_amount(const infinint &val)
increment the byte amount counter by a given value
std::string get_fsa_treated_str() const
returns the current value of the fsa_treated counter as a std::string
std::string get_treated_str() const
returns the current value of the treated counter as a std::string
void decr_errored()
decrement by one the errored counter
void set_byte_amount(const infinint &val)
set to the given value the byte_amount counter
std::string get_tooold_str() const
returns the current value of the tooold counter as a std::string
infinint get_skipped() const
returns the current value of the skipped counter
void incr_skipped()
increment by one the skipped counter
statistics(bool lock=true)
constructor
This is a pure virtual class that is used by libdar when interaction with the user is required.
manages the decimal representation of infinint
switch module to limitint (32 ou 64 bits integers) or infinint
libdar namespace encapsulate all libdar symbols
defines the interaction interface between libdar and users.