1 #ifndef EVENTFILTER_UTILTIES_PLUGINS_EVFBuildingThrottle
2 #define EVENTFILTER_UTILTIES_PLUGINS_EVFBuildingThrottle
11 #include <sys/statvfs.h>
13 #include "boost/thread/thread.hpp"
24 :
highWaterMark_(pset.getUntrackedParameter<double>(
"highWaterMark",0.8))
25 ,
lowWaterMark_(pset.getUntrackedParameter<double>(
"lowWaterMark",0.5))
29 ,
sleep_( pset.getUntrackedParameter<unsigned int>(
"sleepmSecs",1000))
76 int retval = statvfs(
baseDir_.c_str(),&buf);
82 double fraction = 1.-float(buf.f_bfree*buf.f_bsize)/float(buf.f_blocks*buf.f_frsize);
87 std::cout <<
" building throttle on " <<
baseDir_ <<
" is " << fraction*100 <<
" %full " << std::endl;
void preBeginLumi(edm::LuminosityBlockID const &iID, edm::Timestamp const &iTime)
void postBeginRun(edm::RunID const &id, edm::Timestamp const &ts)
static boost::mutex mutex
void postEndRun(edm::Run const &run, edm::EventSetup const &es)
volatile bool m_stoprequest
ServiceToken presentToken() const
static ServiceRegistry & instance()
Directory whatToThrottleOn_
boost::shared_ptr< boost::thread > m_thread
EvFBuildingThrottle(const edm::ParameterSet &pset, edm::ActivityRegistry ®)
void watchPreBeginLumi(PreBeginLumi::slot_type const &iSlot)
void watchPostEndRun(PostEndRun::slot_type const &iSlot)
volatile std::atomic< bool > shutdown_flag false
void preBeginRun(edm::RunID const &id, edm::Timestamp const &ts)
void watchPreBeginRun(PreBeginRun::slot_type const &iSlot)