![]() ![]() |
![]() |
File: [Development] / JSOC / proj / datacapture / scripts / soc_logfile_scan.pl
(download)
Revision: 1.6, Mon Nov 23 19:42:34 2009 UTC (13 years, 6 months ago) by production Branch: MAIN CVS Tags: Ver_LATEST, Ver_9-5, Ver_9-41, Ver_9-4, Ver_9-3, Ver_9-2, Ver_9-1, Ver_9-0, Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-5, Ver_8-4, Ver_8-3, Ver_8-2, Ver_8-12, Ver_8-11, Ver_8-10, Ver_8-1, Ver_8-0, Ver_7-1, Ver_7-0, Ver_6-4, Ver_6-3, Ver_6-2, Ver_6-1, Ver_6-0, Ver_5-9, Ver_5-8, Ver_5-7, Ver_5-6, Ver_5-14, Ver_5-13, Ver_5-12, Ver_5-11, Ver_5-10, HEAD Changes since 1.5: +2 -2 lines fix comment |
#!/usr/bin/perl #/home/production/cvs/JSOC/proj/datacapture/scripts/soc_logfile_scan.pl # #Will read the given soc log file for an instrument and vc, e.g. #soc_aia_VC01_production_2008.05.30_09:34:34.log #and collect some statistics. #NOTE: this is not designed to work for all time. It is a quick hack. $YEARSCAN = "2009.09"; #look for this date stamp in log file sub usage { print "Get info on a datacapture soc log file, e.g.\n"; print "soc_aia_VC01_production_2008.05.30_09:34:34.log\n"; print "Usage: soc_logfile_scan.pl in_file\n"; exit(1); } if($#ARGV != 0) { &usage; } $infile = $ARGV[0]; open(ID, $infile) || die "Can't open $infile: $!\n"; print "Scan of: $infile\n"; while(<ID>) { #first get the start time if(/^$YEARSCAN/) { print "$_"; $date = substr($_, 0, 10); print "First date: $date\n"; last; } } $tlmfilecnt = 0; $impducnt = 0; while(<ID>) { if(/^$YEARSCAN/) { print "$_"; $newdate = substr($_, 0, 10); if($date ne $newdate) { print "tlm file count = $tlmfilecnt IM_PDU count = $impducnt\n"; print "New Date: $newdate\n"; $tlmfilecnt = 0; $impducnt = 0; $date = $newdate; } } if(/^\*\*Processed/) { $tlmfilecnt++; # print "$_"; while(<ID>) { #this is 'compete images ' line # print "$_"; $pos1 = index($_, "and "); $pos1 = $pos1+4; $pos2 = index($_, "VCDUs"); $vcducnt = substr($_, $pos1, ($pos2-$pos1)); $impducnt += $vcducnt; #print "!!TEMP vcducnt = $vcducnt impducnt = $impducnt\n"; last; } } } print "tlm file count = $tlmfilecnt IM_PDU count = $impducnt\n"; close(ID);
Karen Tian |
Powered by ViewCVS 0.9.4 |