HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_PerfMonProfile Class Reference

#include <UT_PerfMonProfile.h>

Public Member Functions

 UT_PerfMonProfile (int id, const char *title, const UT_PerfMonRecordOptions *options=NULL)
 
 ~UT_PerfMonProfile ()
 
int id () const
 Return the profile id that was assigned by the performance monitor. More...
 
const char * title () const
 Return the user-readable profile title. More...
 
void uiFriendlyTitle (UT_String &title) const
 
void setTitle (const char *title)
 Set the profile title. More...
 
void startRecording ()
 Start recording events. More...
 
void stopRecording ()
 Stop event recording. More...
 
void addEvent (UT_PerfMonEvent *event)
 
void collectDataFromEvent (UT_PerfMonEvent *event)
 
bool isActive () const
 
void enableRecording (bool enable)
 Turn on/off event recording. More...
 
bool isRecording () const
 Return true if the profile is recording. More...
 
const UT_PerfMonRecordOptionsrecordOptions () const
 Return the recording options. More...
 
void setRecordOptions (const UT_PerfMonRecordOptions &options)
 Set the recording options. More...
 
int getMinFrame () const
 Return the minimum frame recorded. More...
 
int getMaxFrame () const
 Return the maximum frame recorded. More...
 
bool getIsDiff () const
 
const UT_PerfMonStatDefinitionsstatDefinitions () const
 
const UT_StringArraystatsByCategory (UT_PerfMonCategory category) const
 
const UT_PerfMonStatDefinitiongetStatDefinition (const char *stat_name) const
 
const UT_PerfMonStatsstats () const
 
fpreal statsPercentValue (const UT_PerfMonStats *stats, const char *stat_name) const
 Calculate percent changes on a per stat basis. More...
 
fpreal statsPercentValue (const UT_PerfMonStats *stats, const char *stat_name, int first_frame, int last_frame, int thread_id=UT_PERFMON_STAT_WALL_TIME) const
 
fpreal diffStatsPercentValue (const UT_PerfMonStats *stats, const char *stat_name) const
 
fpreal diffStatsPercentValue (const UT_PerfMonStats *stats, const char *stat_name, int first_frame, int last_frame, int thread_id=UT_PERFMON_STAT_WALL_TIME) const
 
fpreal getMaxStatValue (const char *stat_name) const
 
void setStats (UT_PerfMonStats *stats, const UT_PerfMonStatDefinitions &stat_defs, int min_frame, int max_frame)
 
void createDiffStats (const UT_PerfMonProfile *profile1, const UT_PerfMonProfile *profile2)
 
const UT_PerfMonStatsgetStatsByPath (const char *path) const
 
const char * getDiffProfileTitle (int index) const
 
bool save (const char *file_path) const
 
bool exportStatsAsCSV (const char *file_path) const
 
void clearStats ()
 Clear recorded stats in the profile. More...
 

Detailed Description

Definition at line 31 of file UT_PerfMonProfile.h.

Constructor & Destructor Documentation

UT_PerfMonProfile::UT_PerfMonProfile ( int  id,
const char *  title,
const UT_PerfMonRecordOptions options = NULL 
)

id is the unique id generated by the performance monitor for this profile. title is a user-readable profile title.

UT_PerfMonProfile::~UT_PerfMonProfile ( )

Member Function Documentation

void UT_PerfMonProfile::addEvent ( UT_PerfMonEvent event)

Add the given event to the log. The performance monitor is responsible for the deletion of the event.

void UT_PerfMonProfile::clearStats ( )

Clear recorded stats in the profile.

void UT_PerfMonProfile::collectDataFromEvent ( UT_PerfMonEvent event)

Collect data from the event. The data contributes to the profile's statistics.

void UT_PerfMonProfile::createDiffStats ( const UT_PerfMonProfile profile1,
const UT_PerfMonProfile profile2 
)
fpreal UT_PerfMonProfile::diffStatsPercentValue ( const UT_PerfMonStats stats,
const char *  stat_name 
) const
fpreal UT_PerfMonProfile::diffStatsPercentValue ( const UT_PerfMonStats stats,
const char *  stat_name,
int  first_frame,
int  last_frame,
int  thread_id = UT_PERFMON_STAT_WALL_TIME 
) const
void UT_PerfMonProfile::enableRecording ( bool  enable)

Turn on/off event recording.

bool UT_PerfMonProfile::exportStatsAsCSV ( const char *  file_path) const

Export the collected stats in CSV format. Return true if the export succeeded. Return false otherwise.

const char* UT_PerfMonProfile::getDiffProfileTitle ( int  index) const
bool UT_PerfMonProfile::getIsDiff ( ) const

Return whether the current profile is a diff profile, for the purposes of rendering differently in OPUI

int UT_PerfMonProfile::getMaxFrame ( ) const

Return the maximum frame recorded.

fpreal UT_PerfMonProfile::getMaxStatValue ( const char *  stat_name) const
int UT_PerfMonProfile::getMinFrame ( ) const

Return the minimum frame recorded.

const UT_PerfMonStatDefinition* UT_PerfMonProfile::getStatDefinition ( const char *  stat_name) const

Return the stat definition with the given name. Return NULL if no such definition has been registered with the profile.

const UT_PerfMonStats* UT_PerfMonProfile::getStatsByPath ( const char *  path) const
int UT_PerfMonProfile::id ( ) const

Return the profile id that was assigned by the performance monitor.


GENERAL.


bool UT_PerfMonProfile::isActive ( ) const

Return true if the profile is active. An active profile is one that is still interested in events but may not be recording at the moment (i.e. if it is paused).

bool UT_PerfMonProfile::isRecording ( ) const

Return true if the profile is recording.

const UT_PerfMonRecordOptions& UT_PerfMonProfile::recordOptions ( ) const

Return the recording options.

bool UT_PerfMonProfile::save ( const char *  file_path) const

Save the collected stats to disk. Return true if the save succeeded. Return false otherwise.

void UT_PerfMonProfile::setRecordOptions ( const UT_PerfMonRecordOptions options)

Set the recording options.

void UT_PerfMonProfile::setStats ( UT_PerfMonStats stats,
const UT_PerfMonStatDefinitions stat_defs,
int  min_frame,
int  max_frame 
)

Override the generated stats (if any) in the profile with the specified stats. The profile takes ownership of the stat objects and the stat definitions. min_frame and max_frame describe the frame range that the stats reside in.

void UT_PerfMonProfile::setTitle ( const char *  title)

Set the profile title.

void UT_PerfMonProfile::startRecording ( )

Start recording events.


EVENT RECORDING.


const UT_PerfMonStatDefinitions& UT_PerfMonProfile::statDefinitions ( ) const

Return a list of stat definitions registered with the profile. Return NULL if the profile has no stat definitions.

const UT_PerfMonStats* UT_PerfMonProfile::stats ( ) const

Return the set of stats collected by the profile. Return NULL if the profile has not started or if the profile is still recording.

const UT_StringArray* UT_PerfMonProfile::statsByCategory ( UT_PerfMonCategory  category) const

Return a list of stat names that belong to the given stat category. Return NULL if category is not a valid enum value.

fpreal UT_PerfMonProfile::statsPercentValue ( const UT_PerfMonStats stats,
const char *  stat_name 
) const

Calculate percent changes on a per stat basis.

fpreal UT_PerfMonProfile::statsPercentValue ( const UT_PerfMonStats stats,
const char *  stat_name,
int  first_frame,
int  last_frame,
int  thread_id = UT_PERFMON_STAT_WALL_TIME 
) const
void UT_PerfMonProfile::stopRecording ( )

Stop event recording.

const char* UT_PerfMonProfile::title ( ) const

Return the user-readable profile title.

void UT_PerfMonProfile::uiFriendlyTitle ( UT_String title) const

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