Skip to main content
Version: 20 R7 BETA

Monitored activity

Monitored activity : Collection

ParameterTypeDescription
Function resultCollectionCollection of monitored activities

Description

The Monitored activity command returns a collection of objects describing operations recorded according to the specifications set by the START MONITORING ACTIVITY command. It can be called and executed on 4D remote, 4D Server, and 4D standalone applications (if source isn't from network activity).

The objects in the returned collection have the following properties:

PropertyTypeDescription
activityKindIntegerThe type of recorded activity:

ConstantValueComment
Activity language1Language execution operations
Activity network2Network request operations
Activity operations44D data operations
activityDurationRealThe duration of the activity expressed in seconds
activityDataObjectObject(s) containing specific properties depending on the type of recorded activity (activityKind). In some circumstances, several objects can be returned for the same operation. In this case, the objects will have the same UUID. The additional properties in these objects are described in the sections below.
activityKind = Activity language (1)

Note: The activityData object uses the information defined by the SET DATABASE PARAMETER command for the 4DDebugLog.txt (standard) (if any), otherwise it uses a default mode. Starting log recording during execution of the Monitored activity command will thus impact the returned results.

activityData object:

PropertyTypeDescription
sequenceNumberlongintUnique and sequential operation number in the logging session.
elapsedTimelongintElapsed time since the debug log was started (expressed in milliseconds)
processIDlongintProcess ID
uniqueProcessIDlongintUnique process ID
stackLevellongintStack level
durationlongintLength of time for operation (expressed in microseconds)
kindtextThe kind of operation logged. Possible values:
"command" "method" "Message" "pluginMessage" "pluginCommand" "pluginCallback" "pluginEvent" "task" "member"
Additional properties

The following additional properties are returned in the activityData object according to the kind of operation:

PropertyTypeKindDescription
commandNametextcommandCommand name
commandNumberlongintcommandCommand number
connectionUUIDtexttaskClient machine UUID
formEventtextcommandName of the form event
formMethodtextcommandForm method
functionNametextmemberName of the ORDA member method
memberMethodtextcommandLocalized string of the member method for 4D's object call
methodtextcommandLocalized names of 4D commands and functions
parameterstextcommand
member
message
method
pluginCommand
pluginEvent
task
Parameters passed in the operation
pluginCommandNametextpluginCommand
pluginEvent
Name of the plug-in command
pluginCommandNumberlongintpluginCommand
pluginEvent
pluginMessage
Number of the plug-in command
pluginExternalCalllongintpluginCallbackPlug-in SDK entry point call
pluginMessageNametextpluginMessagePossible values: PackMsgServerDeInit PackMsgServerDisposeData PackMsgServerWriteData PackMsgServerReadData PackMsgServerKillClient PackMsgServerNewClient PackMsgServerInit PackMsgProcessDeInit PackMsgProcessInit PackMsgClientDeInit PackMsgClientInit
pluginNametextpluginCallback
pluginCommand
pluginEvent
pluginMessage
Name of the plug-in
activityKind = Activity network (2)

Notes:

  • If the debug logs have been stopped on the 4D Server GRAPH SETTINGS, Monitored activity will return nothing. If the logs are restarted on the server or via the START MONITORING ACTIVITY command with Activity network, Monitored activity will resume returning network activity information.
  • The activityData object uses the information defined by the SET DATABASE PARAMETER command for the 4DRequestsLog.txt (if any), otherwise it uses a default mode. Starting log recording during execution of the Monitored activity command will thus impact the returned results.

activityData object:

PropertyTypeDescription
sequenceNumberlongintUnique and sequential operation number in the logging session
timetextDate and time in ISO 8601 format ("YYYY-MM-DDTHH:MM:SS.sss")
systemIDtextSystem ID
componenttextComponent signature (e.g., 4SQLS or dbmg)
processInfoIndexlongintCorresponds to the "index" field in 4DRequestsLog_ProcessInfo.txt log, and permits linking a request to a process
requestlongintRequest ID for c/s messages, SQL requests, or LOG EVENT messages
bytesInlongintNumber of bytes received
bytesOutlongintNumber of bytes sent
execDurationlongintDepending on where generated:server_duration .
OR,exec_duration when generated on the server --Time taken in microseconds for the server to process the request.
writeDurationlongintTime taken in microseconds for sending the:Request (when run on the client).Response (when run on the server).
serverDurationlongintTime in microseconds for the client/server communication
taskKindtextPreemptive or cooperative (respectively 'p' or 'c')
rttlongintTime estimate in microseconds for the client to send the request and the server to acknowledge it. Only measured when using the ServerNet network layer, returns 0 when used with the legacy network layer.For Windows versions prior to Windows 10 or Windows Server 2016, the call will return 0.
activityKind = Activity operations (4)

Note: The activityData object is similar to the one returned by the ACTIVITY SNAPSHOT command, except that it only thresholded and finished operations are returned.

activityData object:

PropertyTypeDescription
messagetextDescription of the operation
maxValuelongintMaximum number of iterations for the operation (value=-1 for non-iterative operations)
remotebooleanClient / server operation. Possible values: true, false
uuidtextUUID of the operation
taskIdlongintInternal 4D identifier for the originating process
startTimetextStart time of the operation in ISO 8601 format ("YYYY-MM-DDTHH:MM:SS.sss")
durationlongintTotal time (expressed in milliseconds) of operation execution
titletextAdditional information about the operation
extraInfoobjectAdditional SQL information (if any):

extraInfo.SQL_Query (text): The SQL query extraInfo.SQL_User (text): User authenticated on SQL server
dbContextInfoobjectContext information of the operation
host_nametextName of the host that launched the operation
user_nametextName of 4D user whose session launched the operation
task_nametextName of the process that launched the operation
task_idlongintID of the process that launched the operation
client_uidtext(c/s operations only) UUID of the client machine that launched the database operation
is_remote_contextlongint(c/s operations only) Indicates if operation was launced by the server via a stored procedure (value=0) or by a client (value=1)
user4d_idlongintID of the 4D user on the client machine
user4d_aliastextAlias set for the 4D user. See SET USER ALIAS
client_versiontextEncoded string value that expresses the version number of the 4D environment returned by the Application version command
dbOperationDetailsobjectInformation about operation calls to the database engine
tabletextName of the table in the operation
fieldtextName of the table field in the operation
queryPlantextQuery plan for the operation
operationTypetextType of operation
sortParameterscollectionSort criteria
subOperationscollectioncollection of activytData objects containing information about subordinate operations within the current operation.
[ ].messagetextLabel of operations
[ ].maxValuelongintMaximum number of iterations for the operation (value=-1 for non-iterative operations)
[ ].remotebooleanClient / server operation (0=true, 1=false)
[ ].uuidtextUUID of the operation
[ ].taskIdlongintInternal 4D identifier for the originating process
[ ].startTimetextStart time of the operation in ISO 8601 format ("YYYY-MM-DDTHH:MM:SS.sss")
[ ].durationlongintTotal time (expressed in milliseconds) of operation execution
[ ].titletextAdditional information about the operation
[ ].extraInfoobjectAdditional SQL information (if any):

[ ].extraInfo.SQL_Query (text): The SQL query [ ].extraInfo.SQL_User (text): User authenticated on SQL server

Example

See example for START MONITORING ACTIVITY

See also

START MONITORING ACTIVITY
STOP MONITORING ACTIVITY

Properties

Command number1713
Thread safe