Network Automation Software
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Need a processing timer
Topic Summary: Am I just over complicating it?
Created On: 01/09/2012 11:28 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 01/09/2012 11:28 AM
User is offline View Users Profile Print this message

Author Icon
Journeyman (50-99)

Posts: 63
Joined: 07/19/2011

What I want to do sounds pretty basic.  I want to 'time' a workflow (eventually I want to group the tasks and time them as a groups), and when a certain time threshold is reached, send out an email alerting of a potential problem.  I have looked at it several different ways:

1) Task Execution time function - not an option because the tasks are simply dos commands that need to wait until the program returns.  There is no opportunity within the task to check how long the task itself has been executing.

2) Concurrent timer task -  In my workflow, I  have a initial task that upon success runs my task (with the dos command) and also a timer task.  In the timer task I loop, reading the time until the threshhold is reached, upon which it sends and email and stops.  This works great if the task runs beyond the threshhold.  However, if the task does not reach the threshold (which it normally shouldn't), the timer task will continue to execute until it reaches the threshold, then send an email, all of which is incorrect/undesired. 

I have tried using a shared variable 'flag' so that the timer loops until the flag is set to 'stop' by the task I want to time.  To do this I have to loop the timer, using an evaluation object (timer task runs, get time, stops, ends; then if the evaluation object checks the flag... if still Go, Timer task will run again and keeps a running total of the time via a shared variable).   The loop has to be external so that the timer task can pick up the changed shared variable value when the flag is set to 'stop' by the other task.  But I am finding that even though my flag is being set to 'stop' correctly by the main task, the timer task is resetting it to 'Go' every time it runs.  This seems like a bug to me because the timer task does not even have a reference to the run flag in it, but I can watch the value reset in the debugger when the timer task runs.

Does anyone have any thoughts on how I might accomplish this 'timer'?

Thanks so much in advance!


 Category Survey
 01/09/2012 11:52 AM
User is offline View Users Profile Print this message

Author Icon
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

I would use some customized registry entry that is set up by the operational task when it begins, and contains as value the timeout "threshold", and the task name (process ID ?)
This registry entry is then deleted by the task itself when it finishes.

In parallel, every minute, I would run a watchdog task that polls the registry for possible entries whose threshold is elapsed, and if any, act accordingly (send email, kill the process, whatever)

Does this make sense ?

If registry operation is uneasy to you, it could as well be files in a folder, rather than registry values in a registry key. Filenames could be the threshold time to watch, and file contents the operational task parameters (name, PID, whatever)

 Category Survey

Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
 01/09/2012 12:04 PM
User is offline View Users Profile Print this message

Author Icon
Journeyman (50-99)

Posts: 63
Joined: 07/19/2011


That is a great idea - thanks so much!


 Category Survey
18257 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 6686 on 11/01/2020 at 01:24 AM.
There are currently 746 guests browsing this forum, which makes a total of 746 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog