ewmscp
..
|
class for limiting process load. More...
#include <throttle.h>
Public Member Functions | |
watch (const std::string &name) | |
void | update (double units=1.0) |
void | wait () |
template<typename T , class ... Types> | |
T | action (T(*f)(Types...), Types ... args) |
Private Attributes | |
options::single< double > | desiredRate |
options::single< double > | tau |
options::single< double > | p |
options::single< double > | i |
double | rateIntegral |
double | lastRate |
clock_type::time_point | lastStop |
std::mutex | updateMutex |
class for limiting process load.
Implemented as a limited PI-controller. Each instance creates it's own set of config options. The update() function tells the watch how much "rate" was produced just now, the wait() function will delay the current thread so that the desired rate will not be exceeded.
Definition at line 18 of file throttle.h.
|
inline |
Definition at line 28 of file throttle.h.
|
inline |
|
inline |
Definition at line 35 of file throttle.h.
References desiredRate, lastRate, lastStop, rateIntegral, tau, and updateMutex.
Referenced by action(), inputHandler::davix::readerDavix::readBlock(), inputHandler::dcap::readerDcap::readBlock(), inputHandler::daosFs::readerDaosFs::readBlock(), inputHandler::libssh::readerLibssh::readBlock(), inputHandler::posixFile::readerPosixFile::readBlock(), outputHandler::davix::writerDavix::writeBlock(), outputHandler::dcap::writerDcap::writeBlock(), outputHandler::libssh::writerLibssh::writeBlock(), outputHandler::posixFile::writerPosixFile::writeBlock(), outputHandler::daosFs::writerDaosFs::writeBlock(), and throttle::action::~action().
|
inline |
Definition at line 50 of file throttle.h.
References desiredRate, i, lastRate, p, and rateIntegral.
Referenced by action(), throttle::action::action(), inputHandler::davix::readerDavix::readBlock(), inputHandler::dcap::readerDcap::readBlock(), inputHandler::daosFs::readerDaosFs::readBlock(), inputHandler::libssh::readerLibssh::readBlock(), inputHandler::posixFile::readerPosixFile::readBlock(), outputHandler::davix::writerDavix::writeBlock(), outputHandler::dcap::writerDcap::writeBlock(), outputHandler::libssh::writerLibssh::writeBlock(), outputHandler::posixFile::writerPosixFile::writeBlock(), and outputHandler::daosFs::writerDaosFs::writeBlock().
|
private |
Definition at line 19 of file throttle.h.
|
private |
Definition at line 22 of file throttle.h.
Referenced by wait().
|
private |
Definition at line 24 of file throttle.h.
|
private |
Definition at line 25 of file throttle.h.
Referenced by update().
|
private |
Definition at line 21 of file throttle.h.
Referenced by wait().
|
private |
Definition at line 23 of file throttle.h.
|
private |
Definition at line 20 of file throttle.h.
Referenced by update().
|
private |
Definition at line 26 of file throttle.h.
Referenced by update().