Last active
August 29, 2015 13:57
-
-
Save nicwolff/9609179 to your computer and use it in GitHub Desktop.
Filter to show time spent in subcomponents in Mason profile log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl -nl | |
| next unless ($p) = /(\d+)-\d+$/; | |
| s/\\n.*//; | |
| s/.*\ - //; | |
| s/{{{/{/ and $t{$p}{++$d{$p}} = 0; | |
| s/}}}/}/ and --$d{$p} and /(\d+\.\d+)/ and $t{$p}{$d{$p}} += $1 and $a = $t{$p}{$d{$p}+1} and $r = round($1-$a) and s{$}{ / $r}; | |
| print; | |
| sub round { int($_[0]*10000+.5)/10000 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment