kanzi::AbstractProfilerSource Class Referenceabstract

A class that is used to gather profiling data from an abstract source. More...

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

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

Public Types

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...
 

Public Member Functions

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...
 

Static Public Member Functions

static DataType getDataType (const Value &value)
 Allows to query the data type of the data value. More...
 

Protected Member Functions

 AbstractProfilerSource (string_view name, string_view category, const FieldNameContainer &fields, const FieldNameContainer &sampleFields)
 Constructor for derived classes. More...
 
virtual Value getValueOverride (string_view fieldName) const =0
 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 =0
 Returns value for given sample, needs to be implemented by derived class. More...
 
virtual size_t getSampleCountOverride () const =0
 Returns the amount of samples that have been collected, needs to be implemented by derived class. More...
 

Detailed Description

A class that is used to gather profiling data from an abstract source.

Member Typedef Documentation

typedef variant<monostate, bool, uint64_t, float, string> kanzi::AbstractProfilerSource::Value

Container for profiling value.

Container for data structure field names.

typedef FieldNameContainer::const_iterator kanzi::AbstractProfilerSource::FieldNameConstIterator

Iterator for field names.

Member Enumeration Documentation

Supported profiling value types.

Enumerator
DataTypeNotDefined 
DataTypeBoolean 
DataTypeUint64 
DataTypeFloat 
DataTypeString 

Constructor & Destructor Documentation

virtual kanzi::AbstractProfilerSource::~AbstractProfilerSource ( )
virtual
kanzi::AbstractProfilerSource::AbstractProfilerSource ( string_view  name,
string_view  category,
const FieldNameContainer fields,
const FieldNameContainer sampleFields 
)
explicitprotected

Constructor for derived classes.

Parameters
nameName of this source.
nameCategory of this source.
fieldsField names that reflect and describe the inner data structure for profiling data.
fieldsField names that reflect and describe the inner data structure for sample (per invocation) data.

Member Function Documentation

string_view kanzi::AbstractProfilerSource::getName ( ) const

Returns name of this profiler source.

Returns
Name of this profiler source.
string_view kanzi::AbstractProfilerSource::getCategory ( ) const

Returns category of this profiler source.

Returns
Category of this profiler source.
FieldNameConstIterator kanzi::AbstractProfilerSource::beginFieldNames ( ) const

Returns iterator to the beginning of the container that stores field names for the profiling data.

FieldNameConstIterator kanzi::AbstractProfilerSource::endFieldNames ( ) const

Returns iterator to the end of the container that stores field names for the profiling data.

Value kanzi::AbstractProfilerSource::getValue ( string_view  fieldName) const

Returns value for given profiling data field.

Parameters
fieldNamename of the data field.
Returns
Value of the data field.
FieldNameConstIterator kanzi::AbstractProfilerSource::beginSampleFieldNames ( ) const

Returns iterator to the beginning of the container that stores field names for the profiling sample (per invocation) data.

FieldNameConstIterator kanzi::AbstractProfilerSource::endSampleFieldNames ( ) const

Returns iterator to the end of the container that stores field names for the profiling sample (per invocation) data.

size_t kanzi::AbstractProfilerSource::getSampleCount ( ) const

Returns the amount of samples that have been collected.

Returns
Number of samples present in the sample buffer.
Value kanzi::AbstractProfilerSource::getSampleValue ( size_t  sampleIndex,
string_view  fieldName 
) const

Returns value for given sample.

Parameters
sampleIndexindex in the sample buffer.
fieldNamename of the data field.
Returns
Value of the sample in given index of the sample buffer.
static DataType kanzi::AbstractProfilerSource::getDataType ( const Value value)
static

Allows to query the data type of the data value.

Returns
Data type of the value.
virtual Value kanzi::AbstractProfilerSource::getValueOverride ( string_view  fieldName) const
protectedpure virtual

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.

Implemented in kanzi::FunctionProfilerSource.

virtual Value kanzi::AbstractProfilerSource::getSampleValueOverride ( size_t  sampleIndex,
string_view  fieldName 
) const
protectedpure virtual

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.

Implemented in kanzi::FunctionProfilerSource.

virtual size_t kanzi::AbstractProfilerSource::getSampleCountOverride ( ) const
protectedpure virtual

Returns the amount of samples that have been collected, needs to be implemented by derived class.

Returns
Number of samples present in the sample buffer.

Implemented in kanzi::ValueProfilerSource< Data, SampleData >, and kanzi::ValueProfilerSource< FunctionProfilingData, FunctionSampleData >.


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