Monitored activity
Monitored activity : Collection
Parameter | Type | Description | |
---|---|---|---|
Function result | Collection | ← | Collection 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:
Property | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
activityKind | Integer | The type of recorded activity:
| ||||||||||||
activityDuration | Real | The duration of the activity expressed in seconds | ||||||||||||
activityData | Object | Object(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:
Property | Type | Description |
---|---|---|
sequenceNumber | longint | Unique and sequential operation number in the logging session. |
elapsedTime | longint | Elapsed time since the debug log was started (expressed in milliseconds) |
processID | longint | Process ID |
uniqueProcessID | longint | Unique process ID |
stackLevel | longint | Stack level |
duration | longint | Length of time for operation (expressed in microseconds) |
kind | text | The 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:
Property | Type | Kind | Description |
---|---|---|---|
commandName | text | command | Command name |
commandNumber | longint | command | Command number |
connectionUUID | text | task | Client machine UUID |
formEvent | text | command | Name of the form event |
formMethod | text | command | Form method |
functionName | text | member | Name of the ORDA member method |
memberMethod | text | command | Localized string of the member method for 4D's object call |
method | text | command | Localized names of 4D commands and functions |
parameters | text | command member message method pluginCommand pluginEvent task | Parameters passed in the operation |
pluginCommandName | text | pluginCommand pluginEvent | Name of the plug-in command |
pluginCommandNumber | longint | pluginCommand pluginEvent pluginMessage | Number of the plug-in command |
pluginExternalCall | longint | pluginCallback | Plug-in SDK entry point call |
pluginMessageName | text | pluginMessage | Possible values: PackMsgServerDeInit PackMsgServerDisposeData PackMsgServerWriteData PackMsgServerReadData PackMsgServerKillClient PackMsgServerNewClient PackMsgServerInit PackMsgProcessDeInit PackMsgProcessInit PackMsgClientDeInit PackMsgClientInit |
pluginName | text | pluginCallback 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:
Property | Type | Description |
---|---|---|
sequenceNumber | longint | Unique and sequential operation number in the logging session |
time | text | Date and time in ISO 8601 format ("YYYY-MM-DDTHH:MM:SS.sss") |
systemID | text | System ID |
component | text | Component signature (e.g., 4SQLS or dbmg) |
processInfoIndex | longint | Corresponds to the "index" field in 4DRequestsLog_ProcessInfo.txt log, and permits linking a request to a process |
request | longint | Request ID for c/s messages, SQL requests, or LOG EVENT messages |
bytesIn | longint | Number of bytes received |
bytesOut | longint | Number of bytes sent |
execDuration | longint | Depending on where generated:server_duration . OR,exec_duration when generated on the server --Time taken in microseconds for the server to process the request. |
writeDuration | longint | Time taken in microseconds for sending the:Request (when run on the client).Response (when run on the server). |
serverDuration | longint | Time in microseconds for the client/server communication |
taskKind | text | Preemptive or cooperative (respectively 'p' or 'c') |
rtt | longint | Time 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:
Property | Type | Description | |
---|---|---|---|
message | text | Description of the operation | |
maxValue | longint | Maximum number of iterations for the operation (value=-1 for non-iterative operations) | |
remote | boolean | Client / server operation. Possible values: true, false | |
uuid | text | UUID of the operation | |
taskId | longint | Internal 4D identifier for the originating process | |
startTime | text | Start time of the operation in ISO 8601 format ("YYYY-MM-DDTHH:MM:SS.sss") | |
duration | longint | Total time (expressed in milliseconds) of operation execution | |
title | text | Additional information about the operation | |
extraInfo | object | Additional SQL information (if any): extraInfo.SQL_Query (text): The SQL query extraInfo.SQL_User (text): User authenticated on SQL server | |
dbContextInfo | object | Context information of the operation | |
host_name | text | Name of the host that launched the operation | |
user_name | text | Name of 4D user whose session launched the operation | |
task_name | text | Name of the process that launched the operation | |
task_id | longint | ID of the process that launched the operation | |
client_uid | text | (c/s operations only) UUID of the client machine that launched the database operation | |
is_remote_context | longint | (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_id | longint | ID of the 4D user on the client machine | |
user4d_alias | text | Alias set for the 4D user. See SET USER ALIAS | |
client_version | text | Encoded string value that expresses the version number of the 4D environment returned by the Application version command | |
dbOperationDetails | object | Information about operation calls to the database engine | |
table | text | Name of the table in the operation | |
field | text | Name of the table field in the operation | |
queryPlan | text | Query plan for the operation | |
operationType | text | Type of operation | |
sortParameters | collection | Sort criteria | |
subOperations | collection | collection of activytData objects containing information about subordinate operations within the current operation. | |
[ ].message | text | Label of operations | |
[ ].maxValue | longint | Maximum number of iterations for the operation (value=-1 for non-iterative operations) | |
[ ].remote | boolean | Client / server operation (0=true, 1=false) | |
[ ].uuid | text | UUID of the operation | |
[ ].taskId | longint | Internal 4D identifier for the originating process | |
[ ].startTime | text | Start time of the operation in ISO 8601 format ("YYYY-MM-DDTHH:MM:SS.sss") | |
[ ].duration | longint | Total time (expressed in milliseconds) of operation execution | |
[ ].title | text | Additional information about the operation | |
[ ].extraInfo | object | Additional 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