1 #ifndef FACT_DimWriteStatistics 2 #define FACT_DimWriteStatistics 8 #include <boost/bind.hpp> 9 #if BOOST_VERSION < 104400 10 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)) 11 #undef BOOST_HAS_RVALUE_REFS 14 #include <boost/thread.hpp> 29 Stats() : freeSpace(0), sizeWritten(0), rateWritten(0), timeElapsed(0) { }
uint16_t fUpdateInterval
Current folder being watched for free space.
DimWriteStatistics(const std::string &serverName, MessageImp &log)
Constructor.
The base implementation of a distributed messaging system.
Adds some functionality to boost::posix_time::ptime for our needs.
DimDescribedService fDimService
bool FileOpened(const std::string &fileName)
static bool DoesPathExist(std::string path, MessageImp &log)
void SetUpdateInterval(const int16_t millisec)
uint16_t GetUpdateInterval() const
int64_t GetFreeSpace()
Returns the free space on the disk of the folder being watched (fCurrentFolder)
~DimWriteStatistics()
Default destructor.
void UpdateService()
Main loop.
int Write(const Time &t, const std::string &txt, int qos)
Stats fStats
The data structure holding the stat data.
std::set< std::string > fOpenedFiles
Total base size of all opened files.
const Stats & GetTotalSizeWritten() const
provides a statistics service telling the free space on disk and the total size written so far ...
int64_t GetFileSizeOnDisk(const std::string &file)
Returns the size on disk of a given file.
boost::thread fThread
The boost thread used to update the service.
bool SetCurrentFolder(const std::string &folder)
Configures that current folder where files are written to.
std::string fCurrentFolder
bool fDebug
List of all opened files. set is used to easily check for entries.
size_t fBaseSize
Duration, in millisecond between two service updates. 0 means no more updates.