Fog Creek Software
Discussion Board




Design question: Tracking software

Hello all (and sorry for any language errors)! We have a machine that always does one of several tasks and I need to create an app that does the following:

1. Track what the machine does (and for how long). Getting the current task from the machine is just one line of code in our setup so this is not the problem. It should store this in some kind of logfile.
I figured it would be easy just to update the logfile whenever the machine changes its task.

2. What will happen when the computer crashes? The last task will not be logged.
So I thought of querying the machine every 5 minutes or so and then log its task.

3. Still, I need to know how long the machine does its work. What happens when the date on the computer changes (maybe because of stupid users or whatever)?
I thought of running an internal timer and logging my "own" time.

Any suggestions on how to do this? I don't want to mess up the logfiles when the date on the computer changes so this should be as error-correcting as possible. But then again, I don't want to make things more complicated than necessary.

Thank you in advance for your help!

Gabor
Friday, October 24, 2003

Have the logging application poll an external time source.

Or keep the logging application on an external machine.  When a task is started, it sends a message.  The external machine receives the message and adds a log based on its internal time.

Michael Mata
Friday, October 24, 2003

Joel's got a nice article from FogBugz on this sort of thing: http://www.fogcreek.com/fogbugz/help/UsingFogBUGZtoGetCrashRep.html

Matthew Lock
Friday, October 24, 2003

Is it possible to modify the applications to generate a start and stop line in the logfile?

Lou
Saturday, October 25, 2003

Hi again and thank you for your help so far. The problem is I can't get any external time source and I don't want to rely on the internal clock of the PC. I thought there was some standard way of doing these things.

Oh and yes, a start and stop line would be possible. How would that help me?

Gabor
Sunday, October 26, 2003

Can you get access to the elapsed time since system startup?  For example, in Win32, there is a GetTickCount function that returns the number of milliseconds since startup.  This would at least allow you to ensure that five minutes or whatever has really passed rather than five minutes passing due to a clock change.

SomeBody
Monday, October 27, 2003

*  Recent Topics

*  Fog Creek Home