|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include <TTimeStamp.h>
21 PerfStats* PerfStats::s_instance =
nullptr;
71 Info(
"start",
"Starting performance monitoring" );
91 const ::Double_t elapsed = TTimeStamp().AsDouble() -
95 stats.setProcessTime(
stats.processTime() + elapsed );
101 Info(
"stop",
"Performance monitoring stopped after %s",
119 ::Long64_t eventsprocessed,
121 ::Double_t proctime, ::Double_t cputime,
122 ::Long64_t bytesRead ) {
127 eventsprocessed, latency, proctime,
128 cputime, bytesRead );
135 const char* nodename,
const char*
filename,
171 const ::Double_t tnow = TTimeStamp();
172 const ::Double_t dtime = tnow -
start;
176 stats.setReadTime(
stats.readTime() + dtime );
179 stats.setBytesRead(
stats.bytesRead() + len );
200 ::Double_t
start, ::Int_t complen,
204 const ::Double_t tnow = TTimeStamp();
205 const ::Double_t dtime = tnow -
start;
209 stats.setUnzipTime(
stats.unzipTime() + dtime );
212 ::TTree*
t =
dynamic_cast< ::TTree*
>(
tree );
214 Warning(
"UnzipEvent",
"Couldn't cast object to TTree" );
216 stats.setCacheSize(
t->GetCacheSize() );
228 ::Long64_t eventsprocessed,
229 ::Long64_t bytesRead ) {
312 #define FWD_CALL(CALL) \
313 void PerfStats::CALL( TBranch *b, size_t basketNumber ) { \
314 if( m_otherPerfStats ) m_otherPerfStats->CALL( b, basketNumber ); \
316 void PerfStats::CALL( size_t bi, size_t basketNumber ) { \
317 if( m_otherPerfStats ) m_otherPerfStats->CALL( bi, basketNumber ); \
318 } struct dummyforsemi
333 : m_otherPerfStats(
nullptr ), m_running(
false ), m_startTime( 0.0 ),
334 m_tree(
nullptr ),
m_file(
nullptr ), m_treeWarningPrinted(
false ) {
339 if( gPerfStats && ( gPerfStats !=
this ) ) {
340 m_otherPerfStats = gPerfStats;
342 "Will forward calls to former gPerfStats object" );
349 #if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 23, 2 )
357 #endif // ROOT version
PerfStats()
The constructor is protected, as it's a singleton.
virtual void UnzipEvent(::TObject *tree, ::Long64_t pos, ::Double_t start, ::Int_t complen, ::Int_t objlen)
Function called in general when a file unzipping operation happens.
void Clear(::Option_t *opt="")
Clear the statistics information (inherited from TNamed...)
std::lock_guard< std::mutex > lock_t
::Long64_t bytesRead() const
Get how many bytes were read in total during the analysis.
ReadStats & stats()
Access the object belonging to the current thread.
void start(bool clear=true)
Start the statistics collection.
ClassImp(xAOD::PerfStats) namespace xAOD
virtual void UpdateBranchIndices(TObjArray *branches)
Update the fBranchIndexCache collection to match the current TTree given the ordered list of branch n...
virtual void FileOpenEvent(::TFile *file, const char *filename, ::Double_t start)
Function called by PROOF when a file is opened.
virtual void FileEvent(const char *slave, const char *slavename, const char *nodename, const char *filename, ::Bool_t isStart)
PROOF specific function, not implemented here.
virtual void PrintBasketInfo(Option_t *option="") const
Print the TTree basket read caching statistics.
virtual ::Long64_t GetNumEvents() const
Function used by PROOF to set the number of processed events correctly.
virtual void FileReadEvent(::TFile *file, ::Int_t len, ::Double_t start)
Function called in general when a file reading operation happens.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Class for collecting information about the xAOD file access pattern.
~PerfStats()
Destructor, sometimes called by PROOF.
std::unique_ptr< TFile > m_file
description: this is a custom writer for the old-school drivers that don't use an actual writer
virtual void PacketEvent(const char *slave, const char *slavename, const char *filename, ::Long64_t eventsprocessed, ::Double_t latency, ::Double_t proctime, ::Double_t cputime, ::Long64_t bytesRead)
PROOF specific function, not implemented here.
::TFile * m_file
The currently open xAOD file.
virtual void SimpleEvent(EEventType type)
Generic function called when a specified event happens.
virtual void RateEvent(::Double_t proctime, ::Double_t deltatime, ::Long64_t eventsprocessed, ::Long64_t bytesRead)
PROOF specific function, not implemented here.
static IOStats & instance()
Singleton object accessor.
virtual ::Long64_t GetBytesRead() const
Function used by PROOF to set the read bytes correctly on the master.
static std::mutex s_mutex
Lock controlling access to the singleton.
std::string timeToString(::Double_t secs)
Function creating a human-readable elapsed time printout.
virtual void SetBytesRead(::Long64_t num)
Function used by PROOF to set the read bytes correctly on the master.
static PerfStats & instance()
Function accessing the singleton instance.
bool m_running
Flag showing whether the statistic collection is ongoing or not.
::TVirtualPerfStats * m_otherPerfStats
Another performance monitoring object.
void stop()
Stop the statistics collection.
virtual void SetNumEvents(::Long64_t num)
Function used by PROOF to set the number of processed events correctly.
::Double_t m_startTime
Time when the statistics collection was started.
virtual void SetFile(TFile *file)
Function letting us know that a new file was opened.