#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 | setCPUStat (int busyPer1k) |
void | setElapsed (int mseconds) |
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_+6]) , 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; mstat_[nstates_+3]=0;//cpu*1000 mstat_[nstates_+4]=0;//dt*1000 mstat_[nstates_+5]=0;//0 }
evf::CPUStat::~CPUStat | ( | ) |
void evf::CPUStat::addEntry | ( | int | sta | ) | [inline] |
std::string& evf::CPUStat::getChart | ( | ) | [inline] |
Definition at line 43 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 39 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 33 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::setCPUStat | ( | int | busyPer1k | ) | [inline] |
void evf::CPUStat::setElapsed | ( | int | mseconds | ) | [inline] |
void evf::CPUStat::setNproc | ( | int | nproc | ) | [inline] |
Definition at line 22 of file CPUStat.h.
References mstat_, errorMatrix2Lands::nproc, and nstates_.
Referenced by evf::FUEventProcessor::summarize().
AsciiRollingChart evf::CPUStat::chart_ [private] |
Definition at line 54 of file CPUStat.h.
Referenced by getChart(), and sendStat().
int evf::CPUStat::entries_ [private] |
Definition at line 52 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 53 of file CPUStat.h.
Referenced by addEntry(), CPUStat(), printStat(), reset(), sendStat(), setCPUStat(), setElapsed(), setNproc(), and ~CPUStat().
int evf::CPUStat::nproc_ [private] |
int evf::CPUStat::nstates_ [private] |
Definition at line 49 of file CPUStat.h.
Referenced by CPUStat(), printStat(), reset(), sendStat(), setCPUStat(), setElapsed(), and setNproc().
CurlPoster* evf::CPUStat::poster_ [private] |
Definition at line 48 of file CPUStat.h.
Referenced by CPUStat(), sendLegenda(), sendStat(), and ~CPUStat().