Re: [PATCH v2 3/7] perf/aggregate: implement codespeed JSON output
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 28, 2017, 19:47 UTC
- Message-ID
- <xmqqlghmk52j.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20171226215908.425-4-chriscool@tuxfamily.org>
Christian Couder <christian.couder@gmail.com> writes:
Show 6 quoted lines
> ...
> +sub print_codespeed_results {
> + my ($results_section) = @_;
> +
> + #use Data::Dumper qw/ Dumper /;
> + #print Dumper(\@data);Perhaps lose these. It is OK to keep the code live and hide it behind --debug or something, but it seems to me that you are done debugging it pretty much so...
> + use JSON;
Have this at the top, perhaps? It's not like this would let us avoid loading JSON module when not doing codespeed (you need 'require' for that, right?).
Show 11 quoted lines
> + print to_json(\@data, {utf8 => 1, pretty => 1}), "\n";
> +}
> +
> binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";
>
> -print_default_results();
> +if ($codespeed) {
> + print_codespeed_results($results_section);
> +} else {
> + print_default_results();
> +}