OmniSciDB  8a228a1076
logger::DurationTree Class Reference

Public Member Functions

 DurationTree (ThreadId thread_id, int start_depth)
 
void pushDurationTree (DurationTree &duration_tree)
 
const DurationrootDuration () const
 
int currentDepth () const
 
void decrementDepth ()
 
DurationTreeNodes const & durations () const
 
template<typename... Ts>
DurationnewDuration (Ts &&... args)
 

Public Attributes

int const depth_
 
Clock::time_point const start_
 
ThreadId const thread_id_
 

Private Attributes

DurationTreeNodes durations_
 
int current_depth_
 

Detailed Description

Definition at line 468 of file Logger.cpp.

Constructor & Destructor Documentation

◆ DurationTree()

logger::DurationTree::DurationTree ( ThreadId  thread_id,
int  start_depth 
)
inline

Definition at line 476 of file Logger.cpp.

478  : current_depth_(start_depth + bool(start_depth))
479  , depth_(start_depth)
480  , start_(Clock::now())
481  , thread_id_(thread_id) {}
Clock::time_point const start_
Definition: Logger.cpp:474
ThreadId const thread_id_
Definition: Logger.cpp:475
ThreadId thread_id()
Definition: Logger.cpp:731
int const depth_
Definition: Logger.cpp:473

Member Function Documentation

◆ currentDepth()

int logger::DurationTree::currentDepth ( ) const
inline

Definition at line 489 of file Logger.cpp.

489 { return current_depth_; }

◆ decrementDepth()

void logger::DurationTree::decrementDepth ( )
inline

Definition at line 490 of file Logger.cpp.

490 { --current_depth_; }

◆ durations()

DurationTreeNodes const& logger::DurationTree::durations ( ) const
inline

Definition at line 491 of file Logger.cpp.

Referenced by logger::JsonEncoder::operator()(), logger::EraseDurationTrees::operator()(), and logger::operator<<().

491 { return durations_; }
DurationTreeNodes durations_
Definition: Logger.cpp:469
+ Here is the caller graph for this function:

◆ newDuration()

template<typename... Ts>
Duration* logger::DurationTree::newDuration ( Ts &&...  args)
inline

Definition at line 493 of file Logger.cpp.

References run_benchmark_import::args.

493  {
494  durations_.emplace_back(Duration(this, current_depth_++, std::forward<Ts>(args)...));
495  return boost::get<Duration>(&durations_.back());
496  }
DurationTreeNodes durations_
Definition: Logger.cpp:469

◆ pushDurationTree()

void logger::DurationTree::pushDurationTree ( DurationTree duration_tree)
inline

Definition at line 482 of file Logger.cpp.

482  {
483  durations_.emplace_back(duration_tree);
484  }
DurationTreeNodes durations_
Definition: Logger.cpp:469

◆ rootDuration()

const Duration& logger::DurationTree::rootDuration ( ) const
inline

Definition at line 485 of file Logger.cpp.

References CHECK.

485  {
486  CHECK(!durations_.empty());
487  return boost::get<Duration>(durations_.front());
488  }
DurationTreeNodes durations_
Definition: Logger.cpp:469
#define CHECK(condition)
Definition: Logger.h:197

Member Data Documentation

◆ current_depth_

int logger::DurationTree::current_depth_
private

Definition at line 470 of file Logger.cpp.

◆ depth_

int const logger::DurationTree::depth_

◆ durations_

DurationTreeNodes logger::DurationTree::durations_
private

Definition at line 469 of file Logger.cpp.

◆ start_

Clock::time_point const logger::DurationTree::start_

Definition at line 474 of file Logger.cpp.

◆ thread_id_

ThreadId const logger::DurationTree::thread_id_

The documentation for this class was generated from the following file: