You.i Engine
CYIEasyProfiler Class Reference

Detailed Description

A wrapper around easy_profiler's API for starting the profiler server, writing to a file, or starting and stopping capture of data globally.

CYIEasyProfiler can be used in conjunction with easy_profiler's profiler_gui application to collect profiling data from a running You.i Engine application. Additionally, data can be saved to a file via CYIEasyProfiler::WriteToFile for later inspection. The engine is pre-integrated with profiling blocks but can be extended with app-specific blocks by the inclusion of the EASY_FUNCTION or EASY_BLOCK macros in user code.

Consult the easy_profiler documentation for advanced usage instructions.

#include <utility/YiEasyProfiler.h>

Public Member Functions

 CYIEasyProfiler ()=delete
 

Static Public Member Functions

static void StartListening ()
 
static void StartListening (uint16_t port)
 
static void StopListening ()
 
static bool IsListening ()
 
static void StartCapture ()
 
static void StopCapture ()
 
static void StopCaptureAfterNextDraw ()
 
static bool IsCapturing ()
 
static uint32_t WriteToFile (const CYIString &fullPath)
 

Constructor & Destructor Documentation

◆ CYIEasyProfiler()

CYIEasyProfiler::CYIEasyProfiler ( )
delete

Member Function Documentation

◆ IsCapturing()

static bool CYIEasyProfiler::IsCapturing ( )
static

Indicates if recording of profiler blocks is currently active. Capturing can be enabled programmatically or through the profiler GUI.

See also
StartCapture()
StopCapture()

◆ IsListening()

static bool CYIEasyProfiler::IsListening ( )
static

Indicates if the profiler server is currently running.

See also
StartListening()
StopListening()

◆ StartCapture()

static void CYIEasyProfiler::StartCapture ( )
static

Manually starts recording of profiler blocks. Upon connection, the GUI can initiate a capture that will also enable the profiler blocks. Use this function to start recording before the GUI is able to connect to the application, such as when profiling events that happen on start-up, or when saving the data to a file instead.

Note
Be aware that once capture is enabled, profiling blocks will begin to consume memory and might even encounter memory pressure or be aborted by the operating system after some time. Consider dumping the data to a file with WriteToFile or calling StopCapture in response to CYIApp::HandleLowMemory.
See also
YI_START_EASY_PROFILER_CAPTURE_AT_INIT
StopCapture

◆ StartListening() [1/2]

static void CYIEasyProfiler::StartListening ( )
static

Starts the profiler server on the default port for the purposes of communicating with the GUI. The default port can vary across platforms.

The default port is not necessarily accessible on all platforms and all application configurations. The application's permissions might need to be edited to enable network access, port access, or even whitelisting of specific ports. If such configuration options are not available it is possible to dump the profiler contents to a file using WriteToFile

Platform Default Port
Unless otherwise specified 40800
LG WebOS 9930
See also
StopListening()

◆ StartListening() [2/2]

static void CYIEasyProfiler::StartListening ( uint16_t  port)
static

Starts the profiler server on the given port for the purposes of communicating with the GUI.

The specified port is not necessarily accessible on all platforms and all application configurations. The application's permissions might need to be edited to enable network access, port access, or even whitelisting of specific ports. If such configuration options are not available it is possible to dump the profiler contents to a file using WriteToFile

See also
StopListening()

◆ StopCapture()

static void CYIEasyProfiler::StopCapture ( )
static

Manually stops recording of profiler blocks. Upon connection, the GUI can initiate a capture that will also disable the profiler blocks upon termination. Use this function to stop recording at a specific point in time. WriteToFile will also stop capture.

See also
StartCapture

◆ StopCaptureAfterNextDraw()

static void CYIEasyProfiler::StopCaptureAfterNextDraw ( )
static

Stops recording of profiler blocks after the next frame has been drawn. Unlike StopCapture, capturing will continue when this function returns. This can be used in conjunction with YI_START_EASY_PROFILER_CAPTURE_AT_INIT to profile from app init time to after the first frame is drawn.

◆ StopListening()

static void CYIEasyProfiler::StopListening ( )
static

Stops the profiler server. Prevents connection to the application from the GUI.

See also
StartListening()

◆ WriteToFile()

static uint32_t CYIEasyProfiler::WriteToFile ( const CYIString fullPath)
static

Write the currently recorded blocks to a file. If this function is called from within an area that's being profiled, the data may not contain the currently open blocks. Running this function on the next frame may be required. The return value represents the number of blocks written, 0 may indicate that the file write failed or that no blocks were encountered during the capture.

Note
This function will have the side effect of stopping capture.

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