> "David Allen" <[EMAIL PROTECTED]> writes: > > > > I was interested in similar information just for kicks a while back. Thanks > > for your output - attached is a small script I threw together that does this > > same counting with perl. > > > > To run it, just run countTypes.pl with an argument of the directory that > > holds the logfiles you're interested in. It will only look in filenames > > that have IP addresses for information on various request types. (Basically > > if the filename is a set of 4 numbers separated by dots) > > > It looks like not only did I write a script to do the same stuff as > you, but I checked it into CVS first (in the scripts directory, with > path.pl). It outputs all sorts of data. It's not written for trivial > extensibility because that would have taken more work. But it should > nonetheless be easy to extend by adding in your own code inside the > main processing loop.
Attached is a diff to the path.pl script - check it over and apply if you think it's worth it. It abstracts several of the things done in the script into their own little functions, and adds the ability to summarize all of the files rather than just specific lines matching a specific request number. This is roughly like the last script I sent here. This summarization only happens if the request type given is 'summarize'. Example: /path/to/path.pl summarize /path/to/logs Sample output: (From a bunch of log files totalling 602,811 lines between all of them) 120981 distinct requests. 29 distinct request types composed of: Message type counts: Accepted 39626 AnnouncementComplete 110 AnnouncementExecute 157 AnnouncementFailed 34 AnnouncementReply 171 ClientGet 19257 ClientHello 19787 ClientPut 972 DataChunk 4511 DataFound 847 DataInsert 3538 DataNotFound 15493 DataReply 2144 DataRequest 271238 GenerateSVKPair 9 InsertReply 2362 InsertRequest 7551 KeyCollision 323 NodeAnnouncement 470 NodeHello 19787 Pending 455 QueryAborted 369 QueryRejected 45308 QueryRestarted 4823 Restarted 4603 RouteNotFound 13726 StoreData 4007 Success 445 Void 120688 Note that this may munch some memory if the amount of logs is very large. -- David
output.diff
Description: Binary data
