ATLAS Offline Software
Loading...
Searching...
No Matches
Control
AthenaMonitoring
src
AthMonBench.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AthMonBench.h
"
6
#include <iostream>
7
#include <limits>
8
#include <string>
9
#include <fstream>
10
11
namespace
{
12
template
<
long
f>
13
long
14
multiply(
long
result
){
15
static
constexpr
long
maxval = std::numeric_limits<long>::max()/
f
;
16
if
((
result
>maxval) or (
result
<0))
return
-1;
17
return
result
*
f
;
18
}
19
}
20
21
AthMonBench::TMem
22
AthMonBench::currentVMem
(){
23
long
result
= -1;
24
std::ifstream
file
(
"/proc/self/status"
);
25
const
std::string
search
{
"VmSize:"
};
26
std::string line;
27
while
(getline(
file
, line)) {
28
if
(line.starts_with(
search
)) {
29
result
= std::stol(line.substr(
search
.size()));
30
result
= multiply<1024L>(
result
);
31
break
;
32
}
33
}
34
return
result
;
35
}
36
37
std::ostream&
operator <<
( std::ostream& os,
const
AthMonBench
& br) {
38
if
(br.valid())
39
os <<
"deltaMem: "
<<br.deltaMem_mb()<<
" mb, deltaCPU: "
<<br.deltaCPU_ms()<<
" ms"
;
40
else
41
os <<
" [no data]"
;
42
return
os;
43
}
operator<<
std::ostream & operator<<(std::ostream &os, const AthMonBench &br)
Definition
AthMonBench.cxx:37
AthMonBench.h
AthMonBench
Definition
AthMonBench.h:25
AthMonBench::TMem
long long TMem
Definition
AthMonBench.h:52
AthMonBench::currentVMem
static TMem currentVMem()
Definition
AthMonBench.cxx:22
search
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition
hcg.cxx:739
hist_file_dump.f
f
Definition
hist_file_dump.py:140
result
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.14.0