vagnerr has asked for the wisdom of the Perl Monks concerning the following question:
for example[<date>] <start|finish>: <command> <file>
I need to be able to convert that to some sort of report along the lines of[Mon Apr 24 11:56:23 2006] start: split www1.log [Mon Apr 24 11:57:23 2006] start: filter www2.log [Mon Apr 24 12:50:23 2006] start: split www1.log [Mon Apr 24 13:59:23 2006] finish: filter www2.log
The simplest solution would appear to be to create a nice big array, or hash. Each node would represent a 1-5 minute window (depending on the required granularity) referencing an array of the individual types. The logs would then be processed line by line. As we find a matching set of "start" and "finish" lines we update the counters for that type for all the time segments between the start and the finish times.time,splits,filters,total 11:55,0,0,0 11:56,1,0,1 11:57,1,1,2 ... 12:50,1,1,2 12:51,0,1,1 ... 13:59.0,1,1 14:00,0,0,0
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Counting concurrent event jobs
by gaal (Parson) on Apr 24, 2006 at 17:06 UTC | |
by mantadin (Beadle) on Apr 24, 2006 at 18:05 UTC | |
by vagnerr (Prior) on Apr 24, 2006 at 18:11 UTC | |
by mantadin (Beadle) on Apr 24, 2006 at 18:51 UTC | |
by asz (Pilgrim) on Apr 24, 2006 at 22:44 UTC | |
by sfink (Deacon) on Apr 25, 2006 at 02:25 UTC |