Engine.LogProfilerAction
- Updated2024-10-09
- 3 minute(s) read
Engine.LogProfilerAction
Syntax
Engine.LogProfilerAction( profilerMechanism, adapterKeyName, sequenceContextParam, threadId, threadDisplayName, name, synchronizationState, operation, timeout, postMessage, reserved)
Return Value
Returns the OutputMessage this method creates that stores the profiler information. If you pass True to postMessage, you do not need to operate on the returned OutputMessage. The OutputMessage.Category property has a value of Engine.ProfilerOutputMessageCategoryName to indicate that it contains profiler information and should not be displayed in an output messages window.
A TestStand profiler window functions by collecting OutputMessages that have this category name and inspecting their contents.
Purpose
Logs the beginning, end, or a change in the state of an operation so that the information can be collected and displayed by a profiler. The method performs no action if Engine.ProfilingEnabled is not true.
Remarks
This method creates an OutputMessage that stores the profiler information. The built-in properties of the OutputMessage store some information, such as the source location of the event being logged and the time that it occurred. This methods adds custom sub-properties to the OutputMessage to store the remaining information. The ProfilerOutputMessageSubProperties constants define the names of these sub-properties.
Parameters
profilerMechanism As String
[In] Pass a ProfilerMechanisms constant, or a string that indicates the mechanism the profiler event is recording.
adapterKeyName As String
[In] Pass an adapter key name, if applicable. If this value is not null or an empty string, the method stores it as a sub-property of the OutputMessage with a name defined by ProfilerOutputMessageSubProperty_AdapterKeyName.
sequenceContextParam As SequenceContext
[In] Pass the current SequenceContext, if applicable. Otherwise pass null or Nothing. This method uses the sequence context to determine location and test socket information for the source of profiler event.
threadId As String
[In] Pass the UniqueThreadId property of the current TestStand thread as a string. If the current thread is not a TestStand execution thread, pass the decimal formatted result of the Win32 GetCurrentThreadId function as a string with the following string appended: "|"
threadDisplayName As String
[In] Pass the DisplayName property of the current TestStand thread. If the current thread is not a TestStand execution thread, pass the result of Engine.GetResourceString("PROFILER", "NON_EXECUTION_THREAD").
name As String
[In] Pass the name of the item that generated the profiler event. This method stores the name as a sub-property of the OutputMessage with a name defined by ProfilerOutputMessageSubProperty_Name.
synchronizationState As ProfilerStates
[In] Pass an element of the ProfilerStates enumeration that describes the transition that the profiler event records. This method stores the profilerState as a numeric sub-property of the OutputMessage with a name defined by ProfilerOutputMessageSubProperty_State .
operation As String
[In] Pass a string that describes the operation that the profiler event is recording a transition for. If applicable, pass an element of the ProfilerOperations module. This method stores the operation as a sub-property of the OutputMessage with a name defined by ProfilerOutputMessageSubProperty_Operation.
timeout As Double
[In] If you pass the value of ProfilerState_Blocked to profilerState, this method stores the value you pass to timeout as a numeric sub-property of the OutputMessage with a name defined by ProfilerOutputMessageSubProperty_TimeoutPeriod.
postMessage As Boolean
[In] Specifies whether this method calls the Post method on the OutputMessage it creates. If you pass false, you must later call the Post method on the OutputMessage the method returns. Pass false if you need to add additional data to the OutputMessage before posting it.
reserved As LPUNKNOWN
[In] Pass Null or Nothing to this reserved parameter.