#include <CPUStat.h>
Public Member Functions | |
void | addEntry (int sta) |
CPUStat (unsigned int nstates, unsigned int nproc, unsigned int instance, std::string iDieUrl) | |
std::string & | getChart () |
void | printStat () |
void | reset () |
void | sendLegenda (const std::vector< std::string > &) |
void | sendStat (unsigned int) |
void | setNproc (int nproc) |
~CPUStat () | |
Private Attributes | |
AsciiRollingChart | chart_ |
int | entries_ |
std::string | iDieUrl_ |
int | instance_ |
int * | mstat_ |
int | nproc_ |
int | nstates_ |
CurlPoster * | poster_ |
evf::CPUStat::CPUStat | ( | unsigned int | nstates, |
unsigned int | nproc, | ||
unsigned int | instance, | ||
std::string | iDieUrl | ||
) |
Definition at line 6 of file CPUStat.cc.
References i, iDieUrl_, instance_, mstat_, nproc_, nstates_, and poster_.
: iDieUrl_(iDieUrl) , nstates_(nstates) , nproc_(nproc) , instance_(instance) , entries_(0) , mstat_(new int[nstates_+3]) , chart_("busy fraction",50) { poster_ = new CurlPoster(iDieUrl_); for(int i = 0; i < nstates_; i++) mstat_[i]=0; mstat_[nstates_]=nproc_; mstat_[nstates_+1]=instance_; mstat_[nstates_+2]=0; }
evf::CPUStat::~CPUStat | ( | ) |
void evf::CPUStat::addEntry | ( | int | sta | ) | [inline] |
std::string& evf::CPUStat::getChart | ( | ) | [inline] |
Definition at line 37 of file CPUStat.h.
References chart_, and evf::AsciiRollingChart::draw().
Referenced by evf::FUEventProcessor::updater().
{return chart_.draw();}
void evf::CPUStat::printStat | ( | ) | [inline] |
void evf::CPUStat::reset | ( | void | ) | [inline] |
void evf::CPUStat::sendLegenda | ( | const std::vector< std::string > & | mapmod | ) |
Definition at line 36 of file CPUStat.cc.
References i, evf::CurlPoster::leg, python::rootplot::argparse::message, poster_, and evf::CurlPoster::postString().
Referenced by evf::FUEventProcessor::configuring(), and evf::FUEventProcessor::enabling().
{ std::string message; unsigned int i = 0; while(i<mapmod.size()){ message+=mapmod[i]; if(++i!=mapmod.size()) message+=","; } poster_->postString(message.c_str(),message.length(),0,CurlPoster::leg,"/postChoke"); }
void evf::CPUStat::sendStat | ( | unsigned int | lsid | ) |
Definition at line 30 of file CPUStat.cc.
References chart_, entries_, evf::AsciiRollingChart::flip(), mstat_, nstates_, evf::CurlPoster::postBinary(), and poster_.
Referenced by evf::FUEventProcessor::summarize().
void evf::CPUStat::setNproc | ( | int | nproc | ) | [inline] |
AsciiRollingChart evf::CPUStat::chart_ [private] |
Definition at line 48 of file CPUStat.h.
Referenced by getChart(), and sendStat().
int evf::CPUStat::entries_ [private] |
Definition at line 46 of file CPUStat.h.
Referenced by addEntry(), printStat(), reset(), and sendStat().
std::string evf::CPUStat::iDieUrl_ [private] |
int evf::CPUStat::instance_ [private] |
int* evf::CPUStat::mstat_ [private] |
Definition at line 47 of file CPUStat.h.
Referenced by addEntry(), CPUStat(), printStat(), reset(), sendStat(), setNproc(), and ~CPUStat().
int evf::CPUStat::nproc_ [private] |
int evf::CPUStat::nstates_ [private] |
Definition at line 43 of file CPUStat.h.
Referenced by CPUStat(), printStat(), reset(), sendStat(), and setNproc().
CurlPoster* evf::CPUStat::poster_ [private] |
Definition at line 42 of file CPUStat.h.
Referenced by CPUStat(), sendLegenda(), sendStat(), and ~CPUStat().