git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: git <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
	"Thomas Rast" <tr@thomasrast.ch>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Christian Couder" <chriscool@tuxfamily.org>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Philip Oakley" <philipoakley@iee.org>
Subject: Re: [PATCH v2 0/7] Codespeed perf results
Date: Tue, 26 Dec 2017 23:07:45 +0100	[thread overview]
Message-ID: <CAP8UFD2ryn_qHDGeoqSKhH+j-EosCPmMezXHDQTP9Us-3rfUyw@mail.gmail.com> (raw)
In-Reply-To: <20171226215908.425-1-chriscool@tuxfamily.org>

On Tue, Dec 26, 2017 at 10:59 PM, Christian Couder
<christian.couder@gmail.com> wrote:

> Changes since previous version
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>   - Fixed the way the 'executable' field sent to Codespeed is set in
>     `perf/aggregate.perl` in patch 3/7. We now use `uname -s -m` to
>     which we concatenate the perf.repoName config value if it is set,
>     as suggested by Junio and Eric.
>
>   - Fixed the name of the GIT_PERF_REPO_NAME variable in patches 3/7
>     and 7/7. It was GIT_TEST_REPO_NAME in some places.
>
>   - Fixed how the conf_opt argument is added to the
>     get_var_from_env_or_config() function in patch 4/7. It was added
>     as the last, so fifth, argument, but it is simpler and makes more
>     sense to keep the default value argument as the last argument, so
>     now the conf_opt argument is added as the fourth argument.
>
>   - What patch 4/7 did was previously done in 2 patches in the
>     previous version (patches 4/8 and 5/8), but as we are not doing
>     exactly the same thing (see the above item) it is simpler to do it
>     in only one patch instead of two.
>
>   - We now use the --int type specifier when getting the
>     perf.repeatCount config variable in patch 4/7.

Here is the diff with v1:

diff --git a/t/perf/aggregate.perl b/t/perf/aggregate.perl
index 6e15f62a9e..34d74fc015 100755
--- a/t/perf/aggregate.perl
+++ b/t/perf/aggregate.perl
@@ -186,17 +186,16 @@ sub print_codespeed_results {

     my $project = "Git";

-    my $executable;
-    if ($results_section eq "") {
-        $executable = `uname -o -p`;
-    } else {
-        $executable = $results_section;
-        chomp $executable;
+    my $executable = `uname -s -m`;
+    chomp $executable;
+
+    if ($results_section ne "") {
+        $executable .= ", " . $results_section;
     }

     my $environment;
-    if (exists $ENV{GIT_TEST_REPO_NAME} and $ENV{GIT_TEST_REPO_NAME} ne "") {
-        $environment = $ENV{GIT_TEST_REPO_NAME};
+    if (exists $ENV{GIT_PERF_REPO_NAME} and $ENV{GIT_PERF_REPO_NAME} ne "") {
+        $environment = $ENV{GIT_PERF_REPO_NAME};
     } elsif (exists $ENV{GIT_TEST_INSTALLED} and
$ENV{GIT_TEST_INSTALLED} ne "") {
         $environment = $ENV{GIT_TEST_INSTALLED};
         $environment =~ s|/bin-wrappers$||;
diff --git a/t/perf/run b/t/perf/run
index 279c2d41f6..1a100d6134 100755
--- a/t/perf/run
+++ b/t/perf/run
@@ -105,8 +105,8 @@ get_var_from_env_or_config () {
     env_var="$1"
     conf_sec="$2"
     conf_var="$3"
-    default_value="$4" # optional
-    conf_opts="$5" # optional
+    conf_opts="$4" # optional
+    # $5 can be set to a default value

     # Do nothing if the env variable is already set
     eval "test -z \"\${$env_var+x}\"" || return
@@ -124,11 +124,11 @@ get_var_from_env_or_config () {
     conf_value=$(git config $conf_opts -f "$GIT_PERF_CONFIG_FILE" "$var") &&
     eval "$env_var=\"$conf_value\"" && return

-    test -n "${default_value+x}" && eval "$env_var=\"$default_value\""
+    test -n "${5+x}" && eval "$env_var=\"$5\""
 }

 run_subsection () {
-    get_var_from_env_or_config "GIT_PERF_REPEAT_COUNT" "perf" "repeatCount" 3
+    get_var_from_env_or_config "GIT_PERF_REPEAT_COUNT" "perf"
"repeatCount" "--int" 3
     export GIT_PERF_REPEAT_COUNT

     get_var_from_env_or_config "GIT_PERF_DIRS_OR_REVS" "perf" "dirsOrRevs"
@@ -137,7 +137,7 @@ run_subsection () {
     get_var_from_env_or_config "GIT_PERF_MAKE_COMMAND" "perf" "makeCommand"
     get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts"

-    get_var_from_env_or_config "GIT_TEST_REPO_NAME" "perf" "repoName"
+    get_var_from_env_or_config "GIT_PERF_REPO_NAME" "perf" "repoName"
     export GIT_PERF_REPO_NAME

     GIT_PERF_AGGREGATING_LATER=t
@@ -163,7 +163,7 @@ run_subsection () {
     fi
 }

-get_var_from_env_or_config "GIT_PERF_CODESPEED_OUTPUT" "perf"
"codespeedOutput" "" --bool
+get_var_from_env_or_config "GIT_PERF_CODESPEED_OUTPUT" "perf"
"codespeedOutput" "--bool"
 get_var_from_env_or_config "GIT_PERF_SEND_TO_CODESPEED" "perf"
"sendToCodespeed"

 cd "$(dirname $0)"

  parent reply	other threads:[~2017-12-26 22:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-26 21:59 [PATCH v2 0/7] Codespeed perf results Christian Couder
2017-12-26 21:59 ` [PATCH v2 1/7] perf/aggregate: fix checking ENV{GIT_PERF_SUBSECTION} Christian Couder
2017-12-28 19:40   ` Junio C Hamano
2017-12-26 21:59 ` [PATCH v2 2/7] perf/aggregate: refactor printing results Christian Couder
2017-12-26 21:59 ` [PATCH v2 3/7] perf/aggregate: implement codespeed JSON output Christian Couder
2017-12-28 19:47   ` Junio C Hamano
2017-12-26 21:59 ` [PATCH v2 4/7] perf/run: add conf_opts argument to get_var_from_env_or_config() Christian Couder
2017-12-26 21:59 ` [PATCH v2 5/7] perf/run: learn about perf.codespeedOutput Christian Couder
2017-12-26 21:59 ` [PATCH v2 6/7] perf/run: learn to send output to codespeed server Christian Couder
2017-12-26 21:59 ` [PATCH v2 7/7] perf/run: read GIT_TEST_REPO_NAME from perf.repoName Christian Couder
2017-12-26 22:07 ` Christian Couder [this message]
2017-12-28 19:39 ` [PATCH v2 0/7] Codespeed perf results Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP8UFD2ryn_qHDGeoqSKhH+j-EosCPmMezXHDQTP9Us-3rfUyw@mail.gmail.com \
    --to=christian.couder@gmail.com \
    --cc=avarab@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.org \
    --cc=sunshine@sunshineco.com \
    --cc=tr@thomasrast.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).