When you need to track which processes were executed, when and by who, you can go to each process and check its stats. However, if the number of processes to track is large, this approach is inefficient. A better alternative is to create a log.
Steps to log a process
1. For each process that you want to be logged, create a new data step and add a "system variables" property:
2. Select the variable that you want to log, e.g. process name:
3. Repeat the operation for all the properties that you need to track:
4. Create a managed table with a field for each of the variables added in 3, and also an additional field to log the status of the process. This field will be updated at the beginning and end of the process.
- processID
- processName
- username
- time
- status
The table should look like this:
5. In each process that you want to track. Create an action step at the beginning of the process, e.g. in group 2. This step will update the log table. ProcessID, processName, username and time will be linked to the system variables. The status will be a hardcoded value, e.g. processStarted:
Running this step will create an entry in the log table similar to this:
6. Repeat step 5 at the end process, using a different status, e.g. processCompleted:
Running this step will add a second entry:
Your process should look like:
How to log data load
It is also possible to track when data is load into a managed table. For example, if you want to track when data is inserted into the SalesByRegion table:
Managed tables in SolveXia have five meta fields which can be extracted and added to a log:
- _InsertionDateTime -> when the records were inserted
- _InsertingProcessID -> which process inserted the records
- _InsertingUserID -> which user
- _SourcefileName -> file name
- _SourceOwningStepReference -> this is a reference to the data step the file is stored in
1. Create a log table with the following columns:
- processID
- time
- fileName
- rowsAdded (optional)
Note that you can add extra fields to the log, for example, total sales.
2. Create a run query step after the data is loaded into the managed table to update the log. The query should look like:
3. Join the dataLoadLog table to the processStatusLog table to extract username and process name using the process log table. Alternatively, you can include process name and username as linked properties.
Tips and tricks
Create a Yellowfin report using the log table to visualize the log.
Comments
0 comments
Please sign in to leave a comment.