You can use the State Tracker plugin and the Compute Engine feature to monitor the duration of a job. |
The State Tracker plug-in can be used to look for a particular sequence of keywords or entries in a log file. Therefore if your batch job writes out to a consistent log, and you can identify selected entries and link them to particular stages in the batch job, you can track progress in the batch job. The below State Tracker dataview monitors a batch job that writes to /tmp/batchrun.log. This dataview has states: "Job Running" and "Job Completed." The initial state is set to "Initializing" as seen below. Notice the State Tracker plug-in on its own will not provide the start time, completion time, or duration of the batch job. To do this, the Compute Engine functionality is needed to create additional headlines cells and column to populate this data. Below are the headline and column names that will be added to the Batch Run dataview: To populate these new additions, the following three rules can be used (one for each cell to track the current state and copy the time). The "start time" rule will be used to populate the "Last Job Started" headline cell: The "end time" rule will be used to populate the "Last Job Ended" headline cell: Once the job is complete, the third rule will then compute for the duration of the start and the end time and set the value in the "Duration" column: Below is the State Tracker dataview now displaying the duration of the batch job: To try this example, please refer to the below attachments: The rules_jobduration.xml contains the code for the above rules. The sampler_jobduration.xml contains the code for the State Tracker sampler. |
Comments
0 comments
Please sign in to leave a comment.