in reply to Re: thread count
in thread thread count
but it is giving me the whole count including the repated ones, but i just want the count of unique threads. Thanks NT#!/usr/bin/perl -w print "Hello, World...\n"; my $logFile = $ARGV[0]; die "usage: $0 <logFile>" unless $logFile; die "Logfile $logFile doesn't exist" unless -f "$logFile"; open(my $log, "<", $logFile) or die "Can't open $logFile for reading." +; print "Processing file $logFile...\n"; #my $authenticates = {}; my $n = 0; my $TIDCount = 0; while(my $line = <$log>) { # Outer loop. Look for an interesting part of the log file. $n++; $line =~ tr/\r\n//d; if($line =~ /tid (\d+)/){ $TIDCount++; next; } } print "Thread count for the logfile is $TIDCount\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: thread count
by Utilitarian (Vicar) on Jun 10, 2009 at 12:57 UTC | |
by namishtiwari (Acolyte) on Jun 10, 2009 at 14:16 UTC | |
by Utilitarian (Vicar) on Jun 10, 2009 at 14:25 UTC |