Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
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
DeborahWells
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!

Deborah.



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

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Deborah,
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
DeborahWells
Journeyman (50-99)

Posts: 63
Joined: 07/19/2011

Jean,

That is a great idea - thanks so much!

 



 Category Survey
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1273 guests browsing this forum, which makes a total of 1273 users using this forum.

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

Sitemap Network Automation Software Blog