CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CPUStat.cc
Go to the documentation of this file.
3 
4 namespace evf{
5 
6 CPUStat::CPUStat(unsigned int nstates, std::string iDieUrl) : iDieUrl_(iDieUrl)
7  , nstates_(nstates)
8  , entries_(0)
9  , mstat_(new int[nstates_])
10 {
12  for(int i = 0; i < nstates_; i++)
13  mstat_[i]=0;
14 }
16 {
17  delete poster_;
18  delete mstat_;
19 }
20 
21 void CPUStat::sendStat(unsigned int lsid)
22 {
23  poster_->postBinary((unsigned char *)mstat_,(nstates_+1)*sizeof(int),lsid,"/postChoke");
24 }
25 
26 void CPUStat::sendLegenda(const std::vector<std::string> &mapmod)
27 {
28  std::string message;
29  unsigned int i = 0;
30  while(i<mapmod.size()){
31  message+=mapmod[i];
32  if(++i!=mapmod.size()) message+=",";
33  }
34  poster_->postString(message.c_str(),message.length(),0,CurlPoster::leg,"/postChoke");
35 }
36 
37 }
int i
Definition: DBlmapReader.cc:9
void postString(const char *, size_t, unsigned int, mode, const std::string &=standard_post_method_)
Definition: CurlPoster.cc:104
void postBinary(const unsigned char *, size_t, unsigned int, const std::string &=standard_post_method_)
Definition: CurlPoster.cc:110
CurlPoster * poster_
Definition: CPUStat.h:37
void sendStat(unsigned int)
Definition: CPUStat.cc:21
CPUStat(unsigned int nstates, std::string iDieUrl)
Definition: CPUStat.cc:6
string message
Definition: argparse.py:126
int nstates_
Definition: CPUStat.h:38
void sendLegenda(const std::vector< std::string > &)
Definition: CPUStat.cc:26
int * mstat_
Definition: CPUStat.h:40
std::string iDieUrl_
Definition: CPUStat.h:36