Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
EventFilter
Utilities
interface
CPUStat.h
Go to the documentation of this file.
1
#ifndef EVF_CPUSTAT
2
#define EVF_CPUSTAT
3
4
#include <vector>
5
#include <string>
6
#include <iostream>
7
#include "
EventFilter/Utilities/interface/AsciiRollingChart.h
"
8
9
namespace
evf{
10
11
class
CurlPoster;
12
13
class
CPUStat
{
14
public
:
15
CPUStat
(
unsigned
int
nstates,
unsigned
int
nproc,
unsigned
int
instance
,
std::string
iDieUrl);
16
~CPUStat
();
17
void
addEntry
(
int
sta)
18
{
19
mstat_
[sta]++;
20
entries_
++;
21
}
22
void
setNproc
(
int
nproc){
23
mstat_
[
nstates_
+2]=nproc;
24
}
25
void
setCPUStat
(
int
busyPer1k) {
26
mstat_
[
nstates_
+3]=busyPer1k;
27
}
28
void
setElapsed
(
int
mseconds) {
29
mstat_
[
nstates_
+4]=mseconds;
30
}
31
void
reset
()
32
{
33
for
(
int
i
= 0;
i
<
nstates_
;
i
++)
34
mstat_
[
i
]=0;
35
entries_
= 0;
36
}
37
void
printStat
(){
38
std::cout
<<
"dump of microstates avg.:"
<<
entries_
<<
" samples"
<< std::endl;
39
for
(
int
i
= 0;
i
<
nstates_
;
i
++)
40
if
(
mstat_
[
i
]!=0)
std::cout
<<
i
<<
" "
<< float(
mstat_
[
i
])/float(
entries_
)
41
<< std::endl;
42
}
43
std::string
&
getChart
(){
return
chart_
.
draw
();}
44
void
sendStat
(
unsigned
int
);
45
void
sendLegenda
(
const
std::vector<std::string> &);
46
private
:
47
std::string
iDieUrl_
;
48
CurlPoster
*
poster_
;
49
int
nstates_
;
50
int
nproc_
;
51
int
instance_
;
52
int
entries_
;
53
int
*
mstat_
;
54
AsciiRollingChart
chart_
;
55
};
56
}
57
#endif
i
int i
Definition:
DBlmapReader.cc:9
AsciiRollingChart.h
evf::CPUStat
Definition:
CPUStat.h:13
evf::CPUStat::instance_
int instance_
Definition:
CPUStat.h:51
instance
static PFTauRenderPlugin instance
Definition:
PFTauRenderPlugin.cc:72
evf::CPUStat::printStat
void printStat()
Definition:
CPUStat.h:37
evf::CPUStat::setCPUStat
void setCPUStat(int busyPer1k)
Definition:
CPUStat.h:25
evf::CPUStat::nproc_
int nproc_
Definition:
CPUStat.h:50
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
evf::CPUStat::setElapsed
void setElapsed(int mseconds)
Definition:
CPUStat.h:28
evf::CPUStat::entries_
int entries_
Definition:
CPUStat.h:52
evf::CPUStat::~CPUStat
~CPUStat()
Definition:
CPUStat.cc:27
evf::AsciiRollingChart
Definition:
AsciiRollingChart.h:11
evf::CurlPoster
Definition:
CurlPoster.h:10
evf::CPUStat::poster_
CurlPoster * poster_
Definition:
CPUStat.h:48
evf::CPUStat::setNproc
void setNproc(int nproc)
Definition:
CPUStat.h:22
evf::CPUStat::addEntry
void addEntry(int sta)
Definition:
CPUStat.h:17
evf::CPUStat::sendStat
void sendStat(unsigned int)
Definition:
CPUStat.cc:33
evf::AsciiRollingChart::draw
std::string & draw()
Definition:
AsciiRollingChart.h:28
evf::CPUStat::reset
void reset()
Definition:
CPUStat.h:31
evf::CPUStat::CPUStat
CPUStat(unsigned int nstates, unsigned int nproc, unsigned int instance, std::string iDieUrl)
Definition:
CPUStat.cc:6
evf::CPUStat::getChart
std::string & getChart()
Definition:
CPUStat.h:43
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
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
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