On (2014年04月22日 08:11), Zack Weinberg wrote:
> On 2014-04-21 1:07 PM, Steve Fink wrote:
>> On Sat 19 Apr 2014 08:36:22 AM PDT, ISHIKAWA,chiaki wrote:
>>> egrep  "^(\\[[0-9]*\\] |)WARNING" $1 | egrep NS_ENSURE | grep -v "sort
>>> operation has occurred for the SQL statement" | sort | uniq -f1 -c |
>>> sort -n -r
>>
>> It'd be easier if you threw in a *little* bit of perl:
>>
>>    perl -lne 'print $1 if /WARNING: (NS_ENSURE.*)/' | sort | uniq -c |
>> sort -nr
> 
> If you're going to use perl, you might as well use perl:
> 
>     perl -e 'my %hits;
>       while (<>) { $hits{$1}++ if /WARNING: (NS_ENSURE.*)/ }
>       printf("%d\t%s\n", $hits{$_}, $_)
>          for sort { $hits{$b} <=> $hits{$a} } keys %hits;'
> 
> Untested but, I believe, equivalent.  Could perhaps be further optimized by
> use of each() instead of keys() but I have forgotten too much to do it myself.
> 
> zw

Thank you for the suggestions.

My original intent was to avoid script programming as much as possible
and yet gain reasonably good summary.

I guess the time is over for a simple shell scripting to
produce a meaningful summary from ever evolving log record.
(Yes, my script goes over the log many times and in that sense it is not
very efficient, but
it can handle 100+MiB |mach mochitest-plain| of debug build of FF in several
seconds on my local PC and not too bad for my purpose of obtaining a
meaningful summary without investing too much in programming.)

When I have a time to re-engineer my script, I will post a prototype for
review by people who may be interested in such a script.

TIA
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to