Poster | Thread |
broadblues
| |
Activity Monitor Posted on 21-May-2019 10:08:09
| | [ #1 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| I just cleaned up and uploaded a small tool I've been using to monitor my disk activity. It will insert a hook inot the dos event notification system (Thanks to Colin Wenzel for his adive on this) and log changes to specified paths and or directories.
Here is s mall snippit of the logging output.
##################################################################### Monday 20 May 2019 21:36:47 Appdir:ActivityMonitor- Collating filesystem data ##################################################################### ##################################################################### Monday 20 May 2019 21:38:05 Appdir:ActivityMonitor - Begin logging ##################################################################### Monday 20 May 2019 21:43:48: File PROJECTS:ActivityMonitor/trunk/AM_Notify.c was created Monday 20 May 2019 21:45:01: File PROJECTS:ActivityMonitor/trunk/AM_Main.c was created Monday 20 May 2019 21:56:23: File PROJECTS:ActivityMonitor/trunk/AM_Logging.c was created Monday 20 May 2019 21:56:54: File PROJECTS:ActivityMonitor/trunk/AM_Date.c was created Monday 20 May 2019 21:57:12: File PROJECTS:ActivityMonitor/trunk/AM_Main.c was created Monday 20 May 2019 22:02:37: File PROJECTS:ActivityMonitor/trunk/includes/AM_Notify.h was created Monday 20 May 2019 22:02:37: File PROJECTS:ActivityMonitor/trunk/includes/AM_Notify.h was modified
I mainly use it to estimate time spent working on various projects, there are couple of perls script in the archive that agregate the data and esitmate the total time spent, based on which directories were modified and allow a certain "idle time" for thinking between saving edits etc
It could also be used to monitor changes to your system partition or the ENV: device etc etc as a sort of security monitor
The first (unreleased) version used individual notifications applied recursively which took quite some time to initialise, this version uses a hook set via the DOSFileDirNotify.resource which is hugely more efficient for this level of snooping on the filesystem!
http://os4depot.net/?function=showfile&file=utility/misc/activitymonitor.lha
Needs dos.library 53.81 _________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
broadblues
| |
Re: Activity Monitor Posted on 21-May-2019 10:30:56
| | [ #2 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| @broadblues
BTW you need to use deveice names not volume names or assigns when specifying paths to log.
So use
"RAM:" not "Ram Disk:" "RAM:T" not "T:"
and in my main usage case
"DH5:Projects" not "PROJECTS:"
(the log above predates the switch to the resource based approach...) _________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
nbache
| |
Re: Activity Monitor Posted on 21-May-2019 20:47:24
| | [ #3 ] |
|
|
|
Super Member |
Joined: 8-Apr-2003 Posts: 1034
From: Copenhagen, Denmark | | |
|
| @broadblues
Neat tool!
Just curious: What happens if you set it to log in a path where its own output is redirected to a file?
Best regards,
Niels
|
|
Status: Offline |
|
|
broadblues
| |
Re: Activity Monitor Posted on 22-May-2019 8:32:18
| | [ #4 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| @nbache
Well I was a bit concerned by that myself so I made it explicitly ignore any events related to it's log file.
In practice however, even without that, the logfile is created before logging and doesn't get closed till after logging has finished, and simply writing data to a file doesn't generate any events so even if you redirect the output rather than use a named logfile the feared runaway senario doesn't occur.
_________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
Xenic
| |
Re: Activity Monitor Posted on 22-May-2019 18:33:07
| | [ #5 ] |
|
|
|
Super Member |
Joined: 2-Feb-2004 Posts: 1246
From: Pennsylvania, USA | | |
|
| @broadblues I mistakenly assumed that multiple files should be seperated by commas as shown in the format ( {name,...} ) and the program would parse the comma seperated filenames. It wouldn't hurt to specify 'space' seperation in the description and add a multiple file example for dummys like me
_________________ X1000 with 2GB memory & OS4.1FE |
|
Status: Offline |
|
|
NutsAboutAmiga
| |
Re: Activity Monitor Posted on 22-May-2019 19:24:57
| | [ #6 ] |
|
|
|
Elite Member |
Joined: 9-Jun-2004 Posts: 12795
From: Norway | | |
|
| @Xenic
Yes I think a CSV format be good idea, using TAB's or some type separator char, this way it easy to import into programs like TurboCalc and Excel, or even be imported into SimpleSQL or something like that, then you can generate some interesting rapports, and use this as a source. _________________ http://lifeofliveforit.blogspot.no/ Facebook::LiveForIt Software for AmigaOS |
|
Status: Offline |
|
|
nbache
| |
Re: Activity Monitor Posted on 22-May-2019 20:15:17
| | [ #7 ] |
|
|
|
Super Member |
Joined: 8-Apr-2003 Posts: 1034
From: Copenhagen, Denmark | | |
|
| @broadblues
Quote:
I made it explicitly ignore any events related to it's log file. | Wise move .
Quote:
the logfile is created before logging and doesn't get closed till after logging has finished, and simply writing data to a file doesn't generate any events | Ah, okay. That should take care of that then. Cool.
Best regards,
Niels
Last edited by nbache on 22-May-2019 at 08:15 PM.
|
|
Status: Offline |
|
|
broadblues
| |
Re: Activity Monitor Posted on 22-May-2019 21:56:24
| | [ #8 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| @Xenic
Yes sorry the FORMAT I gave there is not in the correct syntax, comparing with COPY , which also has an /M term the format should simply be {} the curly braces themselves indicate multple items. I've fixed it in my src for the next version....
FORMAT [TARGET] {<path>} [LOGFILE <logfilename>] [DATESTAMPLOG] [NOTRANSLATE] [RECURSE]
@Liveforit.
Future version might support an LFORMAT arg to allow custom log lines, then you can have your CSV. Currently is space delimetered.
Last edited by broadblues on 22-May-2019 at 09:57 PM.
_________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|