#include <kanzi/core/profiling/abstract_profiler.hpp>
Public Types | |
enum | DataType { DataTypeNotDefined , DataTypeBoolean , DataTypeUint64 , DataTypeFloat , DataTypeString , DataTypeCount } |
Supported profiling data field value types. More... | |
typedef variant< monostate, bool, uint64_t, float, string > | Value |
Container for profiling data field value. | |
Public Member Functions | |
size_t | getAggregateDataFieldCount () const |
Gets the number of aggregate data fields. | |
string | getAggregateDataFieldName (size_t fieldIndex) const |
Gets the name of an aggregate data field. | |
Value | getAggregateDataFieldValue (size_t fieldIndex) const |
Gets the value of an aggregate profiling data field. | |
const ProfilingCategory & | getCategory () const |
Gets a reference to the profiling category assigned to the profiler. | |
string_view | getName () const |
Gets the name of the profiler. | |
size_t | getSampleCount () const |
Gets the number of collected profiling data samples. | |
size_t | getSampleFieldCount () const |
Gets the number of sample data fields. | |
DataType | getSampleFieldDataType (size_t fieldIndex) const |
Gets the data type of a data sample field. | |
string | getSampleFieldName (size_t fieldIndex) const |
Gets the name of a data sample field. | |
Value | getSampleFieldValue (size_t sampleIndex, size_t fieldIndex) const |
Gets the value of a profiling data sample field. | |
void | logAggregateData () const |
Logs aggregate profiling data. | |
void | logAllData () const |
Logs all profiling data. | |
virtual | ~AbstractProfiler () |
Destructor. | |
Static Public Member Functions | |
static DataType | getDataType (const Value &value) |
Gets the type of the data stored in a profiling data field. | |
Protected Member Functions | |
AbstractProfiler (string_view name, const ProfilingCategory &category) | |
Constructor. | |
virtual size_t | getAggregateDataFieldCountOverride () const =0 |
To provide the number of the aggregate data fields, override this function in the derived profiler class. | |
virtual string | getAggregateDataFieldNameOverride (size_t fieldIndex) const =0 |
To provide the name of aggregate data field with given index, override this function in the derived profiler class. | |
virtual Value | getAggregateDataFieldValueOverride (size_t fieldIndex) const =0 |
To provide access to aggregate profiling data field values, override this function in the derived profiler class. | |
virtual size_t | getSampleCountOverride () const =0 |
To provide the number of profiling data samples stored in the derived profiler, override this function in the derived profiler class. | |
virtual size_t | getSampleFieldCountOverride () const =0 |
To provide the number of sample fields, override this function in the derived profiler class. | |
virtual DataType | getSampleFieldDataTypeOverride (size_t fieldIndex) const =0 |
To provide the data type of a sample field with a given index, override this function in the derived profiler class. | |
virtual string | getSampleFieldNameOverride (size_t fieldIndex) const =0 |
To provide the name of a sample field with a given index, override this function in the derived profiler class. | |
virtual Value | getSampleFieldValueOverride (size_t sampleIndex, size_t fieldIndex) const =0 |
To provide access to profiling data sample fields of the derived profiler, override this function in the derived profiler class. | |
virtual void | logAggregateDataOverride () const |
To implement your own logging of aggregate profiling data, override this function in the derived profiler class. | |
virtual void | logAllDataOverride () const |
To implement your own logging of all profiling data, override this function in the derived profiler class. | |
This is the abstract base class of all profilers. See derived class AbstractValueProfiler for a concrete implementation.
See Profiling macros on how to use your profilers.
To extract profiler samples:
typedef variant<monostate, bool, uint64_t, float, string> kanzi::AbstractProfiler::Value |
Container for profiling data field value.
|
virtual |
Destructor.
|
explicitprotected |
Constructor.
name | The name of the profiler. |
category | The profiling category assigned to the profiler. |
string_view kanzi::AbstractProfiler::getName | ( | ) | const |
Gets the name of the profiler.
const ProfilingCategory & kanzi::AbstractProfiler::getCategory | ( | ) | const |
Gets a reference to the profiling category assigned to the profiler.
size_t kanzi::AbstractProfiler::getAggregateDataFieldCount | ( | ) | const |
Gets the number of aggregate data fields.
Calls getAggregateDataFieldCountOverride() overridden in the derived profiler class.
string kanzi::AbstractProfiler::getAggregateDataFieldName | ( | size_t | fieldIndex | ) | const |
Gets the name of an aggregate data field.
Calls getAggregateDataFieldNameOverride() overridden in the derived profiler class.
fieldIndex | The index of the field. |
Value kanzi::AbstractProfiler::getAggregateDataFieldValue | ( | size_t | fieldIndex | ) | const |
Gets the value of an aggregate profiling data field.
Calls getAggregateDataFieldValueOverride() overridden in the derived profiler class.
fieldIndex | The index of the aggregate profiling data field. |
size_t kanzi::AbstractProfiler::getSampleFieldCount | ( | ) | const |
Gets the number of sample data fields.
Calls getSampleFieldCountOverride() overridden in the derived profiler class.
string kanzi::AbstractProfiler::getSampleFieldName | ( | size_t | fieldIndex | ) | const |
Gets the name of a data sample field.
Calls getSampleFieldNameOverride() overridden in the derived profiler class.
fieldIndex | The index of the sample field. |
DataType kanzi::AbstractProfiler::getSampleFieldDataType | ( | size_t | fieldIndex | ) | const |
Gets the data type of a data sample field.
Calls getSampleFieldDataTypeOverride() overridden in the derived profiler class.
fieldIndex | The index of the sample field. |
size_t kanzi::AbstractProfiler::getSampleCount | ( | ) | const |
Gets the number of collected profiling data samples.
Calls getSampleCountOverride() overridden in the derived profiler class.
Value kanzi::AbstractProfiler::getSampleFieldValue | ( | size_t | sampleIndex, |
size_t | fieldIndex ) const |
Gets the value of a profiling data sample field.
Calls getSampleFieldValueOverride() overridden in the derived profiler class.
sampleIndex | The index of the profiling data sample. |
fieldIndex | The index of the field of the profiling data sample. |
Gets the type of the data stored in a profiling data field.
value | Profiling data field value. |
|
inline |
Logs aggregate profiling data.
|
inline |
Logs all profiling data.
|
protectedpure virtual |
To provide the number of the aggregate data fields, override this function in the derived profiler class.
Implemented in kanzi::MainLoopProfiler, kanzi::IntervalProfiler, and kanzi::NamedIntervalProfiler.
|
protectedpure virtual |
To provide the name of aggregate data field with given index, override this function in the derived profiler class.
fieldIndex | The index of the field. |
Implemented in kanzi::MainLoopProfiler, kanzi::IntervalProfiler, and kanzi::NamedIntervalProfiler.
|
protectedpure virtual |
To provide access to aggregate profiling data field values, override this function in the derived profiler class.
fieldIndex | The index of the aggregate profiling data field. |
Implemented in kanzi::MainLoopProfiler, kanzi::IntervalProfiler, and kanzi::NamedIntervalProfiler.
|
protectedpure virtual |
To provide the number of sample fields, override this function in the derived profiler class.
Implemented in kanzi::MainLoopProfiler, kanzi::IntervalProfiler, and kanzi::NamedIntervalProfiler.
|
protectedpure virtual |
To provide the name of a sample field with a given index, override this function in the derived profiler class.
fieldIndex | The index of the field. |
Implemented in kanzi::MainLoopProfiler, kanzi::IntervalProfiler, and kanzi::NamedIntervalProfiler.
|
protectedpure virtual |
To provide the data type of a sample field with a given index, override this function in the derived profiler class.
fieldIndex | The index of the field. |
Implemented in kanzi::MainLoopProfiler, kanzi::IntervalProfiler, and kanzi::NamedIntervalProfiler.
|
protectedpure virtual |
To provide access to profiling data sample fields of the derived profiler, override this function in the derived profiler class.
sampleIndex | The index of the profiling data sample. |
fieldIndex | The index of the field of the profiling data sample. |
Implemented in kanzi::MainLoopProfiler, kanzi::IntervalProfiler, and kanzi::NamedIntervalProfiler.
|
protectedpure virtual |
To provide the number of profiling data samples stored in the derived profiler, override this function in the derived profiler class.
Implemented in kanzi::AbstractValueProfiler< TProfilingDataSample, TAggregateProfilingData >, kanzi::AbstractValueProfiler< IntervalProfilerSampleData, IntervalProfilerSampleStatistics >, kanzi::AbstractValueProfiler< MainLoopProfilingSampleData, MainLoopProfilingAggregateData >, and kanzi::AbstractValueProfiler< NamedIntervalProfilerSampleData, NamedIntervalProfilerSampleStatistics >.
To implement your own logging of aggregate profiling data, override this function in the derived profiler class.
To implement your own logging of all profiling data, override this function in the derived profiler class.