ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
itk::ResourceProbe< ValueType, MeanType > Class Template Referenceabstract

#include <itkResourceProbe.h>

Detailed Description

template<typename ValueType, typename MeanType>
class itk::ResourceProbe< ValueType, MeanType >

Computes the change of a value between two points in code.

This class is the base class of all the probes (time, memory, etc.) between the execution of two pieces of code. It can be started and stopped in order to evaluate the execution over multiple passes.

See also
TimeResourceProbe, MemoryResourceProbe

Definition at line 45 of file itkResourceProbe.h.

+ Collaboration diagram for itk::ResourceProbe< ValueType, MeanType >:

Public Types

using CountType = SizeValueType
 

Public Member Functions

virtual void ExpandedReport (std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
 
virtual ValueType GetInstantValue () const =0
 
virtual ValueType GetMaximum () const
 
virtual MeanType GetMean () const
 
virtual ValueType GetMinimum () const
 
virtual std::string GetNameOfProbe () const
 
CountType GetNumberOfIteration () const
 
CountType GetNumberOfStarts () const
 
CountType GetNumberOfStops () const
 
virtual ValueType GetStandardDeviation ()
 
virtual ValueType GetStandardError ()
 
virtual ValueType GetTotal () const
 
std::string GetType () const
 
std::string GetUnit () const
 
virtual void JSONReport (std::ostream &os=std::cout)
 
virtual void PrintJSONSystemInformation (std::ostream &os=std::cout)
 
virtual void PrintSystemInformation (std::ostream &os=std::cout)
 
virtual void Report (std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
 
virtual void Reset ()
 
 ResourceProbe (std::string type, std::string unit)
 
virtual void SetNameOfProbe (const char *nameOfProbe)
 
virtual void Start ()
 
virtual void Stop ()
 
virtual ~ResourceProbe ()=default
 

Protected Member Functions

virtual void Print (std::ostream &os, Indent indent) const
 
virtual void PrintExpandedReportHead (std::ostream &os=std::cout, bool useTabs=false)
 
template<typename T >
void PrintJSONvar (std::ostream &os, const char *varName, T varValue, unsigned int indent=4, bool comma=true)
 
virtual void PrintReportHead (std::ostream &os=std::cout, bool useTabs=false)
 
virtual void UpdateMinimumMaximumMeasuredValue (ValueType value)
 

Private Attributes

ValueType m_MaximumValue {}
 
ValueType m_MinimumValue {}
 
std::string m_NameOfProbe {}
 
CountType m_NumberOfIteration {}
 
CountType m_NumberOfStarts {}
 
CountType m_NumberOfStops {}
 
std::vector< ValueType > m_ProbeValueList {}
 
ValueType m_StandardDeviation {}
 
ValueType m_StandardError {}
 
ValueType m_StartValue {}
 
ValueType m_TotalValue {}
 
std::string m_TypeString {}
 
std::string m_UnitString {}
 

Static Private Attributes

static constexpr unsigned int tabwidth = 15
 

Member Typedef Documentation

◆ CountType

template<typename ValueType, typename MeanType>
using itk::ResourceProbe< ValueType, MeanType >::CountType = SizeValueType

Type for counting how many times the probe has been started and stopped.

Definition at line 50 of file itkResourceProbe.h.

Constructor & Destructor Documentation

◆ ResourceProbe()

template<typename ValueType, typename MeanType>
itk::ResourceProbe< ValueType, MeanType >::ResourceProbe ( std::string  type,
std::string  unit 
)

Constructor

◆ ~ResourceProbe()

template<typename ValueType, typename MeanType>
virtual itk::ResourceProbe< ValueType, MeanType >::~ResourceProbe ( )
virtualdefault

Destructor

Member Function Documentation

◆ ExpandedReport()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::ExpandedReport ( std::ostream &  os = std::cout,
bool  printSystemInfo = true,
bool  printReportHead = true,
bool  useTabs = false 
)
virtual

Print Probe Results.

◆ GetInstantValue()

template<typename ValueType, typename MeanType>
virtual ValueType itk::ResourceProbe< ValueType, MeanType >::GetInstantValue ( ) const
pure virtual

Returns the instant value of the probed system.

Implemented in itk::TimeProbe, and itk::MemoryProbe.

◆ GetMaximum()

template<typename ValueType, typename MeanType>
virtual ValueType itk::ResourceProbe< ValueType, MeanType >::GetMaximum ( ) const
virtual

Returns the max value changes between the starts and stops of the probe

◆ GetMean()

template<typename ValueType, typename MeanType>
virtual MeanType itk::ResourceProbe< ValueType, MeanType >::GetMean ( ) const
virtual

Returns the average value changes between the starts and stops of the probe. Stop() has to be called at least once, returns 0 otherwise.

◆ GetMinimum()

template<typename ValueType, typename MeanType>
virtual ValueType itk::ResourceProbe< ValueType, MeanType >::GetMinimum ( ) const
virtual

Returns the min value changes between the starts and stops of the probe

◆ GetNameOfProbe()

template<typename ValueType, typename MeanType>
virtual std::string itk::ResourceProbe< ValueType, MeanType >::GetNameOfProbe ( ) const
virtual

Set name of probe

◆ GetNumberOfIteration()

template<typename ValueType, typename MeanType>
CountType itk::ResourceProbe< ValueType, MeanType >::GetNumberOfIteration ( ) const

Returns the number of iteration of the probe

◆ GetNumberOfStarts()

template<typename ValueType, typename MeanType>
CountType itk::ResourceProbe< ValueType, MeanType >::GetNumberOfStarts ( ) const

Returns the number of times that the probe has been started

◆ GetNumberOfStops()

template<typename ValueType, typename MeanType>
CountType itk::ResourceProbe< ValueType, MeanType >::GetNumberOfStops ( ) const

Returns the number of times that the probe has been stopped

◆ GetStandardDeviation()

template<typename ValueType, typename MeanType>
virtual ValueType itk::ResourceProbe< ValueType, MeanType >::GetStandardDeviation ( )
virtual

Returns the standard deviation value changes between the starts and stops of the probe.

◆ GetStandardError()

template<typename ValueType, typename MeanType>
virtual ValueType itk::ResourceProbe< ValueType, MeanType >::GetStandardError ( )
virtual

Returns the standard deviation value changes between the starts and stops of the probe.

◆ GetTotal()

template<typename ValueType, typename MeanType>
virtual ValueType itk::ResourceProbe< ValueType, MeanType >::GetTotal ( ) const
virtual

Returns the accumulated value changes between the starts and stops of the probe

◆ GetType()

template<typename ValueType, typename MeanType>
std::string itk::ResourceProbe< ValueType, MeanType >::GetType ( ) const

Returns the type probed value

◆ GetUnit()

template<typename ValueType, typename MeanType>
std::string itk::ResourceProbe< ValueType, MeanType >::GetUnit ( ) const

Returns the unit probed value

◆ JSONReport()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::JSONReport ( std::ostream &  os = std::cout)
virtual

Print Probe Results.

◆ Print()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::Print ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

Cause the object to print itself out.

Reimplemented in itk::TimeProbe.

◆ PrintExpandedReportHead()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::PrintExpandedReportHead ( std::ostream &  os = std::cout,
bool  useTabs = false 
)
protectedvirtual

Print Probe Results.

◆ PrintJSONSystemInformation()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::PrintJSONSystemInformation ( std::ostream &  os = std::cout)
virtual

Print Probe Results.

◆ PrintJSONvar()

template<typename ValueType, typename MeanType>
template<typename T >
void itk::ResourceProbe< ValueType, MeanType >::PrintJSONvar ( std::ostream &  os,
const char *  varName,
varValue,
unsigned int  indent = 4,
bool  comma = true 
)
protected

Prints a varName: varValue pair.

◆ PrintReportHead()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::PrintReportHead ( std::ostream &  os = std::cout,
bool  useTabs = false 
)
protectedvirtual

Print Probe Results.

◆ PrintSystemInformation()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::PrintSystemInformation ( std::ostream &  os = std::cout)
virtual

Print System information

◆ Report()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::Report ( std::ostream &  os = std::cout,
bool  printSystemInfo = true,
bool  printReportHead = true,
bool  useTabs = false 
)
virtual

Print Probe Results.

◆ Reset()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::Reset ( )
virtual

Reset the probe

◆ SetNameOfProbe()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::SetNameOfProbe ( const char *  nameOfProbe)
virtual

Set name of probe

◆ Start()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::Start ( )
virtual

Start counting the change of value

◆ Stop()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::Stop ( )
virtual

Stop counting the change of value.

If a matching Start() has not been called before, there is no effect.

◆ UpdateMinimumMaximumMeasuredValue()

template<typename ValueType, typename MeanType>
virtual void itk::ResourceProbe< ValueType, MeanType >::UpdateMinimumMaximumMeasuredValue ( ValueType  value)
protectedvirtual

Update the Min and Max values with an input value

Member Data Documentation

◆ m_MaximumValue

template<typename ValueType, typename MeanType>
ValueType itk::ResourceProbe< ValueType, MeanType >::m_MaximumValue {}
private

Definition at line 188 of file itkResourceProbe.h.

◆ m_MinimumValue

template<typename ValueType, typename MeanType>
ValueType itk::ResourceProbe< ValueType, MeanType >::m_MinimumValue {}
private

Definition at line 187 of file itkResourceProbe.h.

◆ m_NameOfProbe

template<typename ValueType, typename MeanType>
std::string itk::ResourceProbe< ValueType, MeanType >::m_NameOfProbe {}
private

Definition at line 198 of file itkResourceProbe.h.

◆ m_NumberOfIteration

template<typename ValueType, typename MeanType>
CountType itk::ResourceProbe< ValueType, MeanType >::m_NumberOfIteration {}
private

Definition at line 194 of file itkResourceProbe.h.

◆ m_NumberOfStarts

template<typename ValueType, typename MeanType>
CountType itk::ResourceProbe< ValueType, MeanType >::m_NumberOfStarts {}
private

Definition at line 192 of file itkResourceProbe.h.

◆ m_NumberOfStops

template<typename ValueType, typename MeanType>
CountType itk::ResourceProbe< ValueType, MeanType >::m_NumberOfStops {}
private

Definition at line 193 of file itkResourceProbe.h.

◆ m_ProbeValueList

template<typename ValueType, typename MeanType>
std::vector<ValueType> itk::ResourceProbe< ValueType, MeanType >::m_ProbeValueList {}
private

Definition at line 196 of file itkResourceProbe.h.

◆ m_StandardDeviation

template<typename ValueType, typename MeanType>
ValueType itk::ResourceProbe< ValueType, MeanType >::m_StandardDeviation {}
private

Definition at line 189 of file itkResourceProbe.h.

◆ m_StandardError

template<typename ValueType, typename MeanType>
ValueType itk::ResourceProbe< ValueType, MeanType >::m_StandardError {}
private

Definition at line 190 of file itkResourceProbe.h.

◆ m_StartValue

template<typename ValueType, typename MeanType>
ValueType itk::ResourceProbe< ValueType, MeanType >::m_StartValue {}
private

Definition at line 185 of file itkResourceProbe.h.

◆ m_TotalValue

template<typename ValueType, typename MeanType>
ValueType itk::ResourceProbe< ValueType, MeanType >::m_TotalValue {}
private

Definition at line 186 of file itkResourceProbe.h.

◆ m_TypeString

template<typename ValueType, typename MeanType>
std::string itk::ResourceProbe< ValueType, MeanType >::m_TypeString {}
private

Definition at line 199 of file itkResourceProbe.h.

◆ m_UnitString

template<typename ValueType, typename MeanType>
std::string itk::ResourceProbe< ValueType, MeanType >::m_UnitString {}
private

Definition at line 200 of file itkResourceProbe.h.

◆ tabwidth

template<typename ValueType, typename MeanType>
constexpr unsigned int itk::ResourceProbe< ValueType, MeanType >::tabwidth = 15
staticconstexprprivate

Definition at line 202 of file itkResourceProbe.h.


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