|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include <TTimeStamp.h>
28 static std::atomic_bool s_enableDataSumbission(
true );
32 m_serverAddress(
"http://rucio-lb-prod.cern.ch:18762/traces/" ),
33 m_serverInetAddress(),
34 m_monitoredFraction( 1.0 ),
51 if( ! s_enableDataSumbission ) {
58 const char* fractionString =
59 gSystem->Getenv(
"XAOD_ACCESSTRACER_FRACTION" );
60 if( fractionString ) {
62 const Double_t fraction = strtod( fractionString, &endptr );
63 if( endptr != fractionString ) {
71 ::TRandom
rng( ::TTimeStamp().GetNanoSec() );
86 ::Info(
"xAOD::TFileAccessTracer",
90 ::TString hdr =
"POST /";
95 hdr += gSystem->HostName();
97 hdr +=
"User-Agent: xAODRootAccess\r\n";
98 hdr +=
"Content-Type: application/json\r\n";
99 hdr +=
"Content-Length: ";
109 pld +=
"\"accessedFiles\": [";
116 pld +=
info.fullFilePath();
124 pld +=
"\"accessedContainers\": [";
127 if( ! bs.second.readEntries() ) {
134 pld += bs.second.GetName();
136 pld += bs.second.readEntries();
144 pld +=
"\"accessedBranches\": [";
155 pld += bs->GetName();
167 const char* pandaID = gSystem->Getenv(
"PandaID" );
169 pld +=
", \"PandaID\": ";
173 const char* taskID = gSystem->Getenv(
"PanDA_TaskID" );
175 pld +=
", \"PanDA_TaskID\": ";
182 pld +=
", \"ROOT_RELEASE\": \"";
185 pld +=
", \"ReportRate\": ";
190 pld +=
", \"ReadCalls\": ";
192 pld +=
", \"ReadSize\": ";
195 pld +=
", \"CacheSize\": ";
203 const ::TString
msg = hdr + pld;
212 if( ! socket.
send(
msg ).isSuccess() ) {
226 std::lock_guard< std::mutex > lock(
m_mutex );
231 gSystem->BaseName(
file.GetName() ) } );
240 std::lock_guard< std::mutex > lock(
m_mutex );
248 std::lock_guard< std::mutex > lock(
m_mutex );
262 std::lock_guard< std::mutex > lock(
m_mutex );
270 std::lock_guard< std::mutex > lock(
m_mutex );
283 s_enableDataSumbission =
value;
void setMonitoredFraction(::Double_t value)
Set the fraction of jobs that should send monitoring information.
::Int_t fileReads() const
Get the total number of file read calls.
::Long64_t bytesRead() const
Get how many bytes were read in total during the analysis.
::Int_t cacheSize() const
Get the TTreeCache size used.
Very simple wrapper around POSIX sockets.
::TString fileName
The name of the file.
std::string m_serverAddress
Address of the server to send monitoring information to.
static void enableDataSubmission(::Bool_t value)
Function for turning data submission on/off.
void add(const ::TFile &file)
Add information about a new file that got accessed.
~TFileAccessTracer()
Destructor.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
::Double_t monitoredFraction() const
Fraction of jobs that should send monitoring information.
Helper class storing information about the accessed files.
std::mutex m_mutex
Mutex for modifying the object.
::TString filePath
The full path to the file.
::Long64_t readEntries() const
Get how many entries were read from this branch.
const MapC_t & containers() const
Get information about all the containers.
Class describing the access statistics of one (sub-)branch.
TFileAccessTracer()
Default constructor.
::TInetAddress m_serverInetAddress
Technical address of the server.
::Double_t m_monitoredFraction
Fraction of jobs that should send monitoring information.
Singleton object holding on to the process's I/O statistics.
void setServerAddress(const std::string &addr)
Set the address of the server that information is sent to.
std::set< AccessedFile > m_accessedFiles
List of all the input files that were accessed in the job.
bool operator<(const AccessedFile &rhs) const
Operator to be able to put this into an std::set.
const std::string & serverAddress() const
The address of the server that information is sent to.
::TString fullFilePath() const
Function returning the full file path.
StatusCode send(const TString &payload)
Function sending a message to the connected address.
const Map_t & branches() const
Get all variable information.
StatusCode connect(const TInetAddress &address, int port)
Function connecting to the specified address.
ReadStats * m_readStats
Object describing the job's xAOD access statistics.