Nymph  v1.5.2
Flow-Based Data Processing Framework
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
KTThroughputProfiler Class Reference

Measures the speed of data processing. More...

#include <KTThroughputProfiler.hh>

Inheritance diagram for KTThroughputProfiler:
Inheritance graph

Public Member Functions

 KTThroughputProfiler (const std::string &name="throughput-profiler")
 
virtual ~KTThroughputProfiler ()
 
bool Configure (const scarab::param_node &node)
 Should perform parameter store and command-line configurations. More...
 
void Start ()
 
void Stop ()
 
void StartProfiling (KTDataPtr data)
 
void Data (KTDataPtr data)
 
void Finish ()
 
timespec Elapsed ()
 
bool GetOutputFileFlag () const
 
void SetOutputFileFlag (bool flag)
 
const std::string & GetOutputFilename () const
 
void SetOutputFilename (const std::string &fname)
 
- Public Member Functions inherited from KTProcessor
 KTProcessor (const std::string &name="default-proc-name")
 
virtual ~KTProcessor ()
 
void ConnectASlot (const std::string &signalName, KTProcessor *processor, const std::string &slotName, int groupNum=-1)
 
void ConnectASignal (KTProcessor *processor, const std::string &signalName, const std::string &slotName, int groupNum=-1)
 
void ConnectSignalToSlot (KTSignalWrapper *signal, KTSlotWrapper *slot, int groupNum=-1)
 
template<class XProcessor >
void RegisterSignal (std::string name, XProcessor *signalPtr)
 
template<class XTarget , typename XReturn >
void RegisterSlot (std::string name, XTarget *target, XReturn(XTarget::*funcPtr)())
 
template<class XTarget , typename XReturn , typename XArg1 >
void RegisterSlot (std::string name, XTarget *target, XReturn(XTarget::*funcPtr)(XArg1))
 
template<class XTarget , typename XReturn , typename XArg1 , typename XArg2 >
void RegisterSlot (std::string name, XTarget *target, XReturn(XTarget::*funcPtr)(XArg1, XArg2))
 
KTSignalWrapperGetSignal (const std::string &name)
 
KTSlotWrapperGetSlot (const std::string &name)
 
template<typename XSignalSig >
void RegisterSignal (std::string name, XSignalSig *signalPtr)
 
- Public Member Functions inherited from KTConfigurable
 KTConfigurable (const std::string &name="default-name")
 
virtual ~KTConfigurable ()
 
bool Configure (const std::string &config)
 Implement the option for calling Configure without passing a parameter store node. More...
 
const std::string & GetConfigName () const
 
void SetConfigName (const std::string &name)
 

Private Member Functions

timespec CurrentTime ()
 
timespec Diff (timespec start, timespec end) const
 

Static Private Member Functions

static int GetTimeCurrent (struct timespec *time)
 
static double TimeToSec (struct timespec time)
 
static void TimeDiff (struct timespec start, struct timespec end, struct timespec *diff)
 

Private Attributes

bool fOutputFileFlag
 
std::string fOutputFilename
 
timespec fTimeStart
 
timespec fTimeEnd
 
unsigned fNDataProcessed
 

Additional Inherited Members

- Protected Types inherited from KTProcessor
typedef std::map< std::string, KTSignalWrapper *> SignalMap
 
typedef SignalMap::iterator SigMapIt
 
typedef SignalMap::value_type SigMapVal
 
typedef std::map< std::string, KTSlotWrapper *> SlotMap
 
typedef SlotMap::iterator SlotMapIt
 
typedef SlotMap::value_type SlotMapVal
 
- Protected Attributes inherited from KTProcessor
SignalMap fSignalMap
 
SlotMap fSlotMap
 
- Protected Attributes inherited from KTConfigurable
KTCommandLineHandlerfCLHandler
 
std::string fConfigName
 

Detailed Description

Measures the speed of data processing.

Author
N. S. Oblath

A single timer is used to count the total processing time.

The timer is started with a call to the Start function. The ProcessHeader function is provided as a convenient timer-starting slot called "start", since the Egg processor emits a matching signal before slice processing starts. If using the signal/slot interface, it's recommended to connect the "header" signal (e.g. from KTEggProcessor) to the "start" slot last (i.e. after any other processors have used the "header" signal).

The timer is stopped with a call to the Stop function. The Finish function is provided as a convenient timer-stopping slot called "stop". If using the signal/slot interface, it's recommended to connect the "egg-done" signal (e.g. from KTEggProcessor) to the "stop" slot first (i.e. before any other processors have used the "egg-done" signal).

Information printed:

Configuration name: "throughput-profiler"

Available configuration values:

Slots:

Definition at line 77 of file KTThroughputProfiler.hh.

Constructor & Destructor Documentation

◆ KTThroughputProfiler()

KTThroughputProfiler ( const std::string &  name = "throughput-profiler")

Definition at line 23 of file KTThroughputProfiler.cc.

◆ ~KTThroughputProfiler()

~KTThroughputProfiler ( )
virtual

Definition at line 36 of file KTThroughputProfiler.cc.

Member Function Documentation

◆ Configure()

bool Configure ( const scarab::param_node &  node)
virtual

Should perform parameter store and command-line configurations.

Implements KTConfigurable.

Definition at line 40 of file KTThroughputProfiler.cc.

◆ CurrentTime()

timespec CurrentTime ( )
private

Definition at line 106 of file KTThroughputProfiler.cc.

◆ Data()

void Data ( KTDataPtr  data)

Definition at line 75 of file KTThroughputProfiler.cc.

◆ Diff()

timespec Diff ( timespec  start,
timespec  end 
) const
private

Definition at line 113 of file KTThroughputProfiler.cc.

◆ Elapsed()

timespec Elapsed ( )

Definition at line 62 of file KTThroughputProfiler.cc.

◆ Finish()

void Finish ( )

Definition at line 82 of file KTThroughputProfiler.cc.

◆ GetOutputFileFlag()

bool GetOutputFileFlag ( ) const
inline

Definition at line 126 of file KTThroughputProfiler.hh.

◆ GetOutputFilename()

const std::string & GetOutputFilename ( ) const
inline

Definition at line 137 of file KTThroughputProfiler.hh.

◆ GetTimeCurrent()

int GetTimeCurrent ( struct timespec *  time)
staticprivate

Definition at line 125 of file KTThroughputProfiler.cc.

◆ SetOutputFileFlag()

void SetOutputFileFlag ( bool  flag)
inline

Definition at line 131 of file KTThroughputProfiler.hh.

◆ SetOutputFilename()

void SetOutputFilename ( const std::string &  fname)
inline

Definition at line 142 of file KTThroughputProfiler.hh.

◆ Start()

void Start ( )

Definition at line 48 of file KTThroughputProfiler.cc.

◆ StartProfiling()

void StartProfiling ( KTDataPtr  data)

Definition at line 67 of file KTThroughputProfiler.cc.

◆ Stop()

void Stop ( )

Definition at line 55 of file KTThroughputProfiler.cc.

◆ TimeDiff()

void TimeDiff ( struct timespec  start,
struct timespec  end,
struct timespec *  diff 
)
staticprivate

Definition at line 151 of file KTThroughputProfiler.cc.

◆ TimeToSec()

double TimeToSec ( struct timespec  time)
staticprivate

Definition at line 146 of file KTThroughputProfiler.cc.

Member Data Documentation

◆ fNDataProcessed

unsigned fNDataProcessed
private

Definition at line 113 of file KTThroughputProfiler.hh.

◆ fOutputFileFlag

bool fOutputFileFlag
private

Definition at line 107 of file KTThroughputProfiler.hh.

◆ fOutputFilename

std::string fOutputFilename
private

Definition at line 108 of file KTThroughputProfiler.hh.

◆ fTimeEnd

timespec fTimeEnd
private

Definition at line 111 of file KTThroughputProfiler.hh.

◆ fTimeStart

timespec fTimeStart
private

Definition at line 110 of file KTThroughputProfiler.hh.


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