kanzi::FunctionProfilerSource Class Reference

Profiling source for a function, gathers performance related metric for a function. More...

#include <kanzi/core/profiling/function_profiler_source.hpp>

Inheritance diagram for kanzi::FunctionProfilerSource:
kanzi::ValueProfilerSource< FunctionProfilingData, FunctionSampleData > kanzi::AbstractProfilerSource

Public Member Functions

 FunctionProfilerSource (string_view name, string_view category, size_t sampleBufferSize)
 Constructor. More...
 
void enter (FunctionSampleData &sample)
 Called by the system when function execution starts. More...
 
void leave (FunctionSampleData &sample)
 
- Public Member Functions inherited from kanzi::ValueProfilerSource< FunctionProfilingData, FunctionSampleData >
 ValueProfilerSource (string_view name, string_view category, const FieldNameContainer &fields, const FieldNameContainer &sampleFields, size_t sampleBufferSize)
 Constructor. More...
 
- Public Member Functions inherited from kanzi::AbstractProfilerSource
virtual ~AbstractProfilerSource ()
 
string_view getName () const
 Returns name of this profiler source. More...
 
string_view getCategory () const
 Returns category of this profiler source. More...
 
FieldNameConstIterator beginFieldNames () const
 Returns iterator to the beginning of the container that stores field names for the profiling data. More...
 
FieldNameConstIterator endFieldNames () const
 Returns iterator to the end of the container that stores field names for the profiling data. More...
 
Value getValue (string_view fieldName) const
 Returns value for given profiling data field. More...
 
FieldNameConstIterator beginSampleFieldNames () const
 Returns iterator to the beginning of the container that stores field names for the profiling sample (per invocation) data. More...
 
FieldNameConstIterator endSampleFieldNames () const
 Returns iterator to the end of the container that stores field names for the profiling sample (per invocation) data. More...
 
size_t getSampleCount () const
 Returns the amount of samples that have been collected. More...
 
Value getSampleValue (size_t sampleIndex, string_view fieldName) const
 Returns value for given sample. More...
 

Protected Member Functions

virtual Value getValueOverride (string_view fieldName) const KZ_OVERRIDE
 Returns value for given profiling data field, needs to be implemented by derived class. More...
 
virtual Value getSampleValueOverride (size_t sampleIndex, string_view fieldName) const KZ_OVERRIDE
 Returns value for given sample, needs to be implemented by derived class. More...
 
- Protected Member Functions inherited from kanzi::ValueProfilerSource< FunctionProfilingData, FunctionSampleData >
const FunctionSampleDatagetSample (size_t index) const
 Returns sample data in given index. More...
 
void addSample (FunctionSampleData sample)
 Stores sample to sample buffer. More...
 
virtual size_t getSampleCountOverride () const KZ_OVERRIDE
 Returns the amount of samples that have been collected, needs to be implemented by derived class. More...
 
- Protected Member Functions inherited from kanzi::AbstractProfilerSource
 AbstractProfilerSource (string_view name, string_view category, const FieldNameContainer &fields, const FieldNameContainer &sampleFields)
 Constructor for derived classes. More...
 

Additional Inherited Members

- Public Types inherited from kanzi::AbstractProfilerSource
enum  DataType {
  DataTypeNotDefined, DataTypeBoolean, DataTypeUint64, DataTypeFloat,
  DataTypeString
}
 Supported profiling value types. More...
 
typedef variant< monostate, bool, uint64_t, float, string > Value
 Container for profiling value. More...
 
typedef vector< string > FieldNameContainer
 Container for data structure field names. More...
 
typedef FieldNameContainer::const_iterator FieldNameConstIterator
 Iterator for field names. More...
 
- Static Public Member Functions inherited from kanzi::AbstractProfilerSource
static DataType getDataType (const Value &value)
 Allows to query the data type of the data value. More...
 
- Protected Attributes inherited from kanzi::ValueProfilerSource< FunctionProfilingData, FunctionSampleData >
FunctionProfilingData m_data
 Data structure for primary data, exposed for derived classes for quick access. More...
 

Detailed Description

Profiling source for a function, gathers performance related metric for a function.

Constructor & Destructor Documentation

kanzi::FunctionProfilerSource::FunctionProfilerSource ( string_view  name,
string_view  category,
size_t  sampleBufferSize 
)
explicit

Constructor.

Parameters
nameName of the function that is being profiled.
categoryCategory of the function that is being profiled.
sampleBufferSizeSize of the sample ring buffer that is used to store more detailed per-invocation data.

Member Function Documentation

void kanzi::FunctionProfilerSource::enter ( FunctionSampleData sample)

Called by the system when function execution starts.

void kanzi::FunctionProfilerSource::leave ( FunctionSampleData sample)
virtual Value kanzi::FunctionProfilerSource::getValueOverride ( string_view  fieldName) const
protectedvirtual

Returns value for given profiling data field, needs to be implemented by derived class.

Parameters
fieldNamename of the data field.
Returns
Value of the data field.

Implements kanzi::AbstractProfilerSource.

virtual Value kanzi::FunctionProfilerSource::getSampleValueOverride ( size_t  sampleIndex,
string_view  fieldName 
) const
protectedvirtual

Returns value for given sample, needs to be implemented by derived class.

Parameters
sampleIndexindex in the sample buffer.
fieldNamename of the data field.
Returns
Value of the sample in given index of the sample buffer.

Implements kanzi::AbstractProfilerSource.


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