Main loop.
Updates the service. This is the function executed by the thread.
Definition at line 154 of file DimWriteStatistics.cc.
References data, MessageImp::Debug(), fBaseSize, fDebug, fDimService, fLog, fOpenedFiles, DimWriteStatistics::Stats::freeSpace, fStats, fUpdateInterval, GetFileSizeOnDisk(), GetFreeSpace(), DimWriteStatistics::Stats::rateWritten, DimDescribedService::setData(), DimWriteStatistics::Stats::sizeWritten, str, DimWriteStatistics::Stats::timeElapsed, and DimDescribedService::Update().
Referenced by DimWriteStatistics().
157 uint64_t previousSize = 0;
163 boost::this_thread::interruption_point();
164 boost::this_thread::yield();
177 data.rateWritten = data.sizeWritten-previousSize;
178 data.timeElapsed = (cTime - previousTime).total_milliseconds();
180 previousSize = data.sizeWritten;
181 previousTime = cTime;
uint16_t fUpdateInterval
Current folder being watched for free space.
int Debug(const std::string &str)
Adds some functionality to boost::posix_time::ptime for our needs.
DimDescribedService fDimService
int64_t GetFreeSpace()
Returns the free space on the disk of the folder being watched (fCurrentFolder)
void setData(const void *ptr, size_t sz)
Stats fStats
The data structure holding the stat data.
std::set< std::string > fOpenedFiles
Total base size of all opened files.
int64_t GetFileSizeOnDisk(const std::string &file)
Returns the size on disk of a given file.
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.