Skip to content

Commit

Permalink
Merge pull request #12 from timbunce/float
Browse files Browse the repository at this point in the history
Allow floating point values
  • Loading branch information
brendangregg committed Mar 25, 2013
2 parents b7250da + ad3d40b commit f689c1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flamegraph.pl
Expand Up @@ -232,7 +232,7 @@ sub flow {
my $ignored = 0;
foreach (sort @Data) {
chomp;
my ($stack, $samples) = (/^(.*)\s+(\d+)$/);
my ($stack, $samples) = (/^(.*)\s+(\d+(?:\.\d*))$/);
unless (defined $samples) {
++$ignored;
next;
Expand Down Expand Up @@ -294,7 +294,7 @@ sub flow {
my $y1 = $imageheight - $ypad2 - ($depth + 1) * $frameheight + 1;
my $y2 = $imageheight - $ypad2 - $depth * $frameheight;

my $samples = $etime - $stime;
my $samples = sprintf "%.0f", $etime - $stime;
(my $samples_txt = $samples) # add commas per perlfaq5
=~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;

Expand Down

0 comments on commit f689c1d

Please sign in to comment.