Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFit::MultiProcess::ProcessTimer Class Reference

Can be used to generate timings of multiple processes simultaneously and output logs.

This static class records timings of multiple processes simultaneously and allows for these timings to be written out in json format, one file for each process. Multiple overlapping sections can be timed independently on the same process. It also allows for the timings to be written out to json logfiles in a specified interval, for example every half hour.

Note that this class logs timings in milliseconds.

Definition at line 28 of file ProcessTimer.h.

Static Public Member Functions

static void add_metadata (json data)
 
static void end_timer (std::string section_name)
 
static std::list< std::chrono::time_point< std::chrono::steady_clock > > get_durations (std::string section_name)
 
static pid_t get_process ()
 
static void print_durations (std::string to_print="all")
 
static void print_timestamps ()
 
static void set_process (pid_t proc)
 
static void set_write_interval (int write_interval)
 
static void setup (pid_t proc, bool set_begin=true)
 
static void start_timer (std::string section_name)
 
static void write_file ()
 

Private Types

using duration_map_t = std::map< std::string, std::list< std::chrono::time_point< std::chrono::steady_clock > > >
 

Static Private Attributes

static std::chrono::time_point< std::chrono::steady_clock > begin = chrono::steady_clock::now()
 
static duration_map_t durations
 
static json metadata
 
static std::chrono::time_point< std::chrono::steady_clock > previous_write = chrono::steady_clock::now()
 
static pid_t process = 0
 
static int times_written = 0
 
static int write_interval = 0
 

#include </home/sftnight/build/workspace/root-makedoc-v632/rootspi/rdoc/src/v6-32-00-patches/roofit/multiprocess/res/RooFit/MultiProcess/ProcessTimer.h>

Member Typedef Documentation

◆ duration_map_t

using RooFit::MultiProcess::ProcessTimer::duration_map_t = std::map<std::string, std::list<std::chrono::time_point<std::chrono::steady_clock> >>
private

Definition at line 58 of file ProcessTimer.h.

Member Function Documentation

◆ add_metadata()

void RooFit::MultiProcess::ProcessTimer::add_metadata ( json  data)
static

Definition at line 164 of file ProcessTimer.cxx.

◆ end_timer()

void RooFit::MultiProcess::ProcessTimer::end_timer ( std::string  section_name)
static

Definition at line 71 of file ProcessTimer.cxx.

◆ get_durations()

list< chrono::time_point< chrono::steady_clock > > RooFit::MultiProcess::ProcessTimer::get_durations ( std::string  section_name)
static

Definition at line 38 of file ProcessTimer.cxx.

◆ get_process()

static pid_t RooFit::MultiProcess::ProcessTimer::get_process ( )
inlinestatic

Definition at line 39 of file ProcessTimer.h.

◆ print_durations()

void RooFit::MultiProcess::ProcessTimer::print_durations ( std::string  to_print = "all")
static

Definition at line 95 of file ProcessTimer.cxx.

◆ print_timestamps()

void RooFit::MultiProcess::ProcessTimer::print_timestamps ( )
static

Definition at line 118 of file ProcessTimer.cxx.

◆ set_process()

static void RooFit::MultiProcess::ProcessTimer::set_process ( pid_t  proc)
inlinestatic

Definition at line 40 of file ProcessTimer.h.

◆ set_write_interval()

void RooFit::MultiProcess::ProcessTimer::set_write_interval ( int  write_interval)
static

Definition at line 178 of file ProcessTimer.cxx.

◆ setup()

static void RooFit::MultiProcess::ProcessTimer::setup ( pid_t  proc,
bool  set_begin = true 
)
inlinestatic

Definition at line 31 of file ProcessTimer.h.

◆ start_timer()

void RooFit::MultiProcess::ProcessTimer::start_timer ( std::string  section_name)
static

Definition at line 55 of file ProcessTimer.cxx.

◆ write_file()

void RooFit::MultiProcess::ProcessTimer::write_file ( )
static

Definition at line 141 of file ProcessTimer.cxx.

Member Data Documentation

◆ begin

chrono::time_point< chrono::steady_clock > RooFit::MultiProcess::ProcessTimer::begin = chrono::steady_clock::now()
staticprivate

Definition at line 61 of file ProcessTimer.h.

◆ durations

ProcessTimer::duration_map_t RooFit::MultiProcess::ProcessTimer::durations
staticprivate

Definition at line 60 of file ProcessTimer.h.

◆ metadata

json RooFit::MultiProcess::ProcessTimer::metadata
staticprivate

Definition at line 64 of file ProcessTimer.h.

◆ previous_write

chrono::time_point< chrono::steady_clock > RooFit::MultiProcess::ProcessTimer::previous_write = chrono::steady_clock::now()
staticprivate

Definition at line 62 of file ProcessTimer.h.

◆ process

pid_t RooFit::MultiProcess::ProcessTimer::process = 0
staticprivate

Definition at line 63 of file ProcessTimer.h.

◆ times_written

int RooFit::MultiProcess::ProcessTimer::times_written = 0
staticprivate

Definition at line 66 of file ProcessTimer.h.

◆ write_interval

int RooFit::MultiProcess::ProcessTimer::write_interval = 0
staticprivate

Definition at line 65 of file ProcessTimer.h.

  • roofit/multiprocess/res/RooFit/MultiProcess/ProcessTimer.h
  • roofit/multiprocess/src/ProcessTimer.cxx