1 #ifndef EVENTFILTER_UTILTIES_PLUGINS_EVFBuildingThrottle
2 #define EVENTFILTER_UTILTIES_PLUGINS_EVFBuildingThrottle
11 #include <sys/statvfs.h>
13 #include "boost/thread/thread.hpp"
23 :
highWaterMark_(pset.getUntrackedParameter<double>(
"highWaterMark",0.8))
24 ,
lowWaterMark_(pset.getUntrackedParameter<double>(
"lowWaterMark",0.5))
28 ,
sleep_( pset.getUntrackedParameter<unsigned int>(
"sleepmSecs",1000))
68 int retval = statvfs(
baseDir_.c_str(),&buf);
74 double fraction = 1.-float(buf.f_bfree*buf.f_bsize)/float(buf.f_blocks*buf.f_frsize);
79 std::cout <<
" building throttle on " <<
baseDir_ <<
" is " << fraction*100 <<
" %full " << std::endl;
static boost::mutex mutex
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void preBeginLumi(edm::GlobalContext const &gc)
volatile bool m_stoprequest
ServiceToken presentToken() const
void postBeginRun(edm::GlobalContext const &gc)
static ServiceRegistry & instance()
Directory whatToThrottleOn_
boost::shared_ptr< boost::thread > m_thread
EvFBuildingThrottle(const edm::ParameterSet &pset, edm::ActivityRegistry ®)
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
void preBeginRun(edm::GlobalContext const &gc)
volatile std::atomic< bool > shutdown_flag false
void postEndRun(edm::GlobalContext const &gc)