|
ORE Studio 0.0.4
|
Records communication frames to a session file. More...
#include <session_recorder.hpp>

Public Member Functions | |
| session_recorder (const session_recorder &)=delete | |
| session_recorder & | operator= (const session_recorder &)=delete |
| session_recorder (session_recorder &&)=delete | |
| session_recorder & | operator= (session_recorder &&)=delete |
| std::expected< std::filesystem::path, session_file_error > | start (const std::filesystem::path &output_directory, const std::string &server_address, messaging::compression_type compression=messaging::compression_type::none) |
| Start recording to a new session file. | |
| void | stop () |
| Stop recording and close the session file. | |
| bool | is_recording () const |
| Check if recording is currently active. | |
| void | record_sent (const messaging::frame &f) |
| Record a frame that was sent by the client. | |
| void | record_received (const messaging::frame &f) |
| Record a frame that was received by the client. | |
| boost::uuids::uuid | session_id () const |
| Get the session ID for the current recording. | |
| std::filesystem::path | file_path () const |
| Get the path to the current recording file. | |
| std::uint64_t | frame_count () const |
| Get the number of frames recorded so far. | |
Records communication frames to a session file.
This class provides thread-safe recording of frames sent and received during a client session. The recorded data can later be analyzed using the ores.comms.analyser tool.
Usage:
| std::expected< std::filesystem::path, session_file_error > start | ( | const std::filesystem::path & | output_directory, |
| const std::string & | server_address, | ||
| messaging::compression_type | compression = messaging::compression_type::none |
||
| ) |
Start recording to a new session file.
Creates a new session file with a unique name in the specified directory. The filename format is: session-YYYYMMDD-HHMMSS-{short-uuid}.ores
| output_directory | Directory where the session file will be created |
| server_address | The server address being connected to |
| compression | The negotiated compression type for the session |
| void stop | ( | ) |
Stop recording and close the session file.
Flushes any buffered data and closes the file. Safe to call multiple times or when not recording.
| void record_sent | ( | const messaging::frame & | f | ) |
Record a frame that was sent by the client.
Thread-safe. If recording is not active, does nothing.
| f | The frame that was sent |
| void record_received | ( | const messaging::frame & | f | ) |
Record a frame that was received by the client.
Thread-safe. If recording is not active, does nothing.
| f | The frame that was received |
| boost::uuids::uuid session_id | ( | ) | const |
Get the session ID for the current recording.
| std::filesystem::path file_path | ( | ) | const |
Get the path to the current recording file.