Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
EventFilter
Utilities
src
CPUStat.cc
Go to the documentation of this file.
1
#include "
EventFilter/Utilities/interface/CPUStat.h
"
2
#include "
EventFilter/Utilities/interface/CurlPoster.h
"
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
{
11
poster_
=
new
CurlPoster
(
iDieUrl_
);
12
for
(
int
i
= 0;
i
<
nstates_
;
i
++)
13
mstat_
[
i
]=0;
14
}
15
CPUStat::~CPUStat
()
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
}
i
int i
Definition:
DBlmapReader.cc:9
CPUStat.h
evf::CurlPoster::postString
void postString(const char *, size_t, unsigned int, mode, const std::string &=standard_post_method_)
Definition:
CurlPoster.cc:104
evf::CurlPoster::leg
Definition:
CurlPoster.h:14
evf::CurlPoster::postBinary
void postBinary(const unsigned char *, size_t, unsigned int, const std::string &=standard_post_method_)
Definition:
CurlPoster.cc:110
evf::CPUStat::~CPUStat
~CPUStat()
Definition:
CPUStat.cc:15
evf::CurlPoster
Definition:
CurlPoster.h:10
evf::CPUStat::poster_
CurlPoster * poster_
Definition:
CPUStat.h:37
evf::CPUStat::sendStat
void sendStat(unsigned int)
Definition:
CPUStat.cc:21
CurlPoster.h
evf::CPUStat::CPUStat
CPUStat(unsigned int nstates, std::string iDieUrl)
Definition:
CPUStat.cc:6
argparse.message
string message
Definition:
argparse.py:126
evf::CPUStat::nstates_
int nstates_
Definition:
CPUStat.h:38
evf::CPUStat::sendLegenda
void sendLegenda(const std::vector< std::string > &)
Definition:
CPUStat.cc:26
evf::CPUStat::mstat_
int * mstat_
Definition:
CPUStat.h:40
evf::CPUStat::iDieUrl_
std::string iDieUrl_
Definition:
CPUStat.h:36
Generated for CMSSW Reference Manual by
1.8.5