Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
perf/aggregate: add --subsection option
author
Christian Couder
<christian.couder@gmail.com>
Thu, 1 Feb 2018 10:14:32 +0000
(11:14 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 2 Feb 2018 19:47:37 +0000
(11:47 -0800)
This makes it easier to use the aggregate script
on the command line, to get results from
subsections.
Previously setting GIT_PERF_SUBSECTION was needed
for this purpose.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/perf/aggregate.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5be1f00
)
diff --git
a/t/perf/aggregate.perl
b/t/perf/aggregate.perl
index 5c439f6bc23e782e09924c02abe3d4edc4cd0d03..bbf0f308980c8661c506730b035d9113699fd356 100755
(executable)
--- a/
t/perf/aggregate.perl
+++ b/
t/perf/aggregate.perl
@@
-36,7
+36,8
@@
sub format_times {
return $out;
}
return $out;
}
-my (@dirs, %dirnames, %dirabbrevs, %prefixes, @tests, $codespeed);
+my (@dirs, %dirnames, %dirabbrevs, %prefixes, @tests,
+ $codespeed, $subsection);
while (scalar @ARGV) {
my $arg = $ARGV[0];
my $dir;
while (scalar @ARGV) {
my $arg = $ARGV[0];
my $dir;
@@
-45,6
+46,15
@@
sub format_times {
shift @ARGV;
next;
}
shift @ARGV;
next;
}
+ if ($arg eq "--subsection") {
+ shift @ARGV;
+ $subsection = $ARGV[0];
+ shift @ARGV;
+ if (! $subsection) {
+ die "empty subsection";
+ }
+ next;
+ }
last if -f $arg or $arg eq "--";
if (! -d $arg) {
my $rev = Git::command_oneline(qw(rev-parse --verify), $arg);
last if -f $arg or $arg eq "--";
if (! -d $arg) {
my $rev = Git::command_oneline(qw(rev-parse --verify), $arg);
@@
-76,10
+86,15
@@
sub format_times {
}
my $resultsdir = "test-results";
}
my $resultsdir = "test-results";
-my $results_section = "";
-if (exists $ENV{GIT_PERF_SUBSECTION} and $ENV{GIT_PERF_SUBSECTION} ne "") {
- $resultsdir .= "/" . $ENV{GIT_PERF_SUBSECTION};
- $results_section = $ENV{GIT_PERF_SUBSECTION};
+
+if (! $subsection and
+ exists $ENV{GIT_PERF_SUBSECTION} and
+ $ENV{GIT_PERF_SUBSECTION} ne "") {
+ $subsection = $ENV{GIT_PERF_SUBSECTION};
+}
+
+if ($subsection) {
+ $resultsdir .= "/" . $subsection;
}
my @subtests;
}
my @subtests;
@@
-183,15
+198,15
@@
sub print_default_results {
}
sub print_codespeed_results {
}
sub print_codespeed_results {
- my ($
results_
section) = @_;
+ my ($
sub
section) = @_;
my $project = "Git";
my $executable = `uname -s -m`;
chomp $executable;
my $project = "Git";
my $executable = `uname -s -m`;
chomp $executable;
- if ($
results_section ne ""
) {
- $executable .= ", " . $
results_
section;
+ if ($
subsection
) {
+ $executable .= ", " . $
sub
section;
}
my $environment;
}
my $environment;
@@
-233,7
+248,7
@@
sub print_codespeed_results {
binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";
if ($codespeed) {
binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";
if ($codespeed) {
- print_codespeed_results($
results_
section);
+ print_codespeed_results($
sub
section);
} else {
print_default_results();
}
} else {
print_default_results();
}