Indexes, Columns and Rows in EM_LOG Tables
Indexes in EM logging tables include a:
- Primary key index on the joined timestamp and sequence number columns.
- Secondary key index on the joined timestamp_utc and sequence number columns.
- Secondary index on the timestamp alone.
- Secondary index on the timestamp_utc alone.
If you have selected the project name table attribute, the primary key index also includes the project name column.
A column type datetime2(7) that includes 100 nanosecond resolution is used for the timestamp, timestamp_utc, script_trigger_time, and script_trigger_time_utc.
Columns and rows in EM logging tables are as follows.
Column Name | Data Type | Description |
---|---|---|
Constant fields | ||
timestamp | date/time | Timestamp of the logging event. |
timestamp_utc | date/time | UTC timestamp of the logging event. |
sequence_number | number | Identity column to ensure uniqueness. |
time | string | Local timestamp of the previous time the point was logged. |
time_utc | string | UTC timestamp of the previous time the point was logged. |
event_type | string | The type of Event Manager event associated with the event source. |
event_source | string | Identifier that triggered the event. |
action_type | string | The type of Event Manager action associated with the action source. |
action_target | string | Identifier of the action's target. |
script_trigger_time | string | The time when the script was triggered. |
script_trigget_time_utc | string | The UTC time when the script was triggered. |
Optional fields | ||
project | string | Name of the CIMPLICITY project. |
msec | number | Actual number of milliseconds in the timestamp. |
NOTE: The following types of action are logged into EM_LOG.
action_type | Description |
RUN SCRIPT or RUN DOTNET SCRIPT | Logged when the script starts executing. |
RUN SCRIPT DONE or RUN DOTNET DONE | Logged if the script execution is completed successfully. |
RUN SCRIPT ABORT or RUN DOTNET ABORT | Logged if the script execution is aborted. |
RUN SCRIPT ERROR or RUN DOTNET ERROR | Logged if an error occurs during script execution. |
For every RUN SCRIPT action_type, a corresponding RUN SCRIPT DONE, or RUN SCRIPT ABORT, or RUN SCRIPT ERROR action_type would be logged. This enables you to know the status of an action.
For every RUN SCRIPT DONE or RUN DOTNET DONE action_type, script_trigger_time and script_trigget_time_utc are logged . This enables you to know the duration of script execution.
The duration of script execution is the difference between timestamp and script_trigger_time logged in the row that contains RUN SCRIPT DONE or RUN DOTNET DONE action_type.
You can execute the following query to calculate the duration of script execution:
SELECT[timestamp]
,[timestamp_utc]
,[script_trigger_time]
,[script_trigger_time_utc]
,DATEDIFF(mcs, [script_trigger_time], [timestamp])/1000000.0 as 'Duration in seconds'
,[sequence_number]
,[action_type]
,[action_target]
,[event_type]
,[event_source]
FROM [EM_LOG]
WHERE [action_type] LIKE 'RUN SCRIPT%' AND NOT [script_trigger_time] IS NULL
GO