StormByte-Database 2.0.0
C++26 database module of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Database::Telemetry::OperationScope Class Reference

Records one operation and its elapsed time on destruction. More...

#include <StormByte/database/telemetry.hxx>

Public Member Functions

 OperationScope (StormByte::Shared< Telemetry > telemetry, Operation operation) noexcept
 
 OperationScope (const OperationScope &)=delete
 Copy constructor is deleted.
 
 OperationScope (OperationScope &&)=delete
 Move constructor is deleted.
 
void Complete (bool success, std::uint64_t rows_returned=0) noexcept
 Record the result and optional returned row count.
 
 ~OperationScope () noexcept
 Record the attempt when the scope ends.
 

Detailed Description

Records one operation and its elapsed time on destruction.

Constructor & Destructor Documentation

◆ OperationScope() [1/3]

StormByte::Database::Telemetry::OperationScope::OperationScope ( StormByte::Shared< Telemetry >  telemetry,
Operation  operation 
)
noexcept
@brief Start measuring one operation.
Parameters
telemetryTelemetry object that receives the measurement.
operationOperation category.

◆ OperationScope() [2/3]

StormByte::Database::Telemetry::OperationScope::OperationScope ( const OperationScope &  )
delete

Copy constructor is deleted.

◆ OperationScope() [3/3]

StormByte::Database::Telemetry::OperationScope::OperationScope ( OperationScope &&  )
delete

Move constructor is deleted.

◆ ~OperationScope()

StormByte::Database::Telemetry::OperationScope::~OperationScope ( )
noexcept

Record the attempt when the scope ends.

Member Function Documentation

◆ Complete()

void StormByte::Database::Telemetry::OperationScope::Complete ( bool  success,
std::uint64_t  rows_returned = 0 
)
noexcept

Record the result and optional returned row count.

Parameters
successWhether the operation succeeded.
rows_returnedRows returned by this operation.

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