Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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,
7
unsigned
int
nproc
,
8
unsigned
int
instance
,
9
std::string iDieUrl) : iDieUrl_(iDieUrl)
10
, nstates_(nstates)
11
, nproc_(nproc)
12
, instance_(instance)
13
, entries_(0)
14
, mstat_(new int[nstates_+6])
15
, chart_(
"busy fraction"
,50)
16
{
17
poster_
=
new
CurlPoster
(
iDieUrl_
);
18
for
(
int
i
= 0;
i
<
nstates_
;
i
++)
19
mstat_
[
i
]=0;
20
mstat_
[
nstates_
]=
nproc_
;
21
mstat_
[nstates_+1]=
instance_
;
22
mstat_
[nstates_+2]=0;
23
mstat_
[nstates_+3]=0;
//cpu*1000
24
mstat_
[nstates_+4]=0;
//dt*1000
25
mstat_
[nstates_+5]=0;
//0
26
}
27
CPUStat::~CPUStat
()
28
{
29
delete
poster_
;
30
delete
mstat_
;
31
}
32
33
void
CPUStat::sendStat
(
unsigned
int
lsid)
34
{
35
chart_
.
flip
(lsid,
float
(
entries_
-
mstat_
[2])/
float
(
entries_
));
36
poster_
->
postBinary
((
unsigned
char
*)
mstat_
,(
nstates_
+6)*
sizeof
(
int
),lsid,
"/postChoke"
);
37
}
38
39
void
CPUStat::sendLegenda
(
const
std::vector<std::string> &mapmod)
40
{
41
std::string
message
;
42
unsigned
int
i
= 0;
43
while
(i<mapmod.size()){
44
message+=mapmod[
i
];
45
if
(++i!=mapmod.size()) message+=
","
;
46
}
47
poster_
->
postString
(message.c_str(),message.length(),0,
CurlPoster::leg
,
"/postChoke"
);
48
}
49
50
}
i
int i
Definition:
DBlmapReader.cc:9
errorMatrix2Lands.nproc
tuple nproc
Definition:
errorMatrix2Lands.py:49
evf::CPUStat::instance_
int instance_
Definition:
CPUStat.h:51
instance
static PFTauRenderPlugin instance
Definition:
PFTauRenderPlugin.cc:72
CPUStat.h
evf::CPUStat::nproc_
int nproc_
Definition:
CPUStat.h:50
evf::CurlPoster::postString
void postString(const char *, size_t, unsigned int, mode, const std::string &=standard_post_method_)
Definition:
CurlPoster.cc:112
evf::CurlPoster::leg
Definition:
CurlPoster.h:14
evf::CPUStat::entries_
int entries_
Definition:
CPUStat.h:52
evf::CurlPoster::postBinary
void postBinary(const unsigned char *, size_t, unsigned int, const std::string &=standard_post_method_)
Definition:
CurlPoster.cc:118
evf::CPUStat::~CPUStat
~CPUStat()
Definition:
CPUStat.cc:27
evf::CurlPoster
Definition:
CurlPoster.h:10
evf::CPUStat::poster_
CurlPoster * poster_
Definition:
CPUStat.h:48
evf::CPUStat::sendStat
void sendStat(unsigned int)
Definition:
CPUStat.cc:33
evf::CPUStat::CPUStat
CPUStat(unsigned int nstates, unsigned int nproc, unsigned int instance, std::string iDieUrl)
Definition:
CPUStat.cc:6
CurlPoster.h
evf::AsciiRollingChart::flip
void flip(unsigned int ind, float x)
Definition:
AsciiRollingChart.h:18
evf::CPUStat::nstates_
int nstates_
Definition:
CPUStat.h:49
evf::CPUStat::sendLegenda
void sendLegenda(const std::vector< std::string > &)
Definition:
CPUStat.cc:39
evf::CPUStat::mstat_
int * mstat_
Definition:
CPUStat.h:53
python.rootplot.argparse.message
string message
Definition:
argparse.py:130
evf::CPUStat::iDieUrl_
std::string iDieUrl_
Definition:
CPUStat.h:47
evf::CPUStat::chart_
AsciiRollingChart chart_
Definition:
CPUStat.h:54
Generated for CMSSW Reference Manual by
1.8.5