git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/7] Codespeed perf results

From
Christian Couder <christian.couder@gmail.com>
Date
Dec 26, 2017, 22:07 UTC
Message-ID
<CAP8UFD2ryn_qHDGeoqSKhH+j-EosCPmMezXHDQTP9Us-3rfUyw@mail.gmail.com>
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:

Show 24 quoted lines
> 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)"
Previous: Christian CouderNext: Junio C Hamano
Message 11 of 12 in “Codespeed perf results”
  1. 0/7 Codespeed perf resultsChristian Couder, Dec 26, 2017
  2. 2/7 perf/aggregate: refactor printing resultsChristian Couder, Dec 26, 2017
  3. 5/7 perf/run: learn about perf.codespeedOutputChristian Couder, Dec 26, 2017
  4. 7/7 perf/run: read GIT_TEST_REPO_NAME from perf.repoNameChristian Couder, Dec 26, 2017
  5. 1/7 perf/aggregate: fix checking ENV{GIT_PERF_SUBSECTION}Christian Couder, Dec 26, 2017
  6. Junio C HamanoDec 28, 2017
  7. 3/7 perf/aggregate: implement codespeed JSON outputChristian Couder, Dec 26, 2017
  8. Junio C HamanoDec 28, 2017
  9. 4/7 perf/run: add conf_opts argument to get_var_from_env_or_config()Christian Couder, Dec 26, 2017
  10. 6/7 perf/run: learn to send output to codespeed serverChristian Couder, Dec 26, 2017
  11. Christian CouderDec 26, 2017
  12. Junio C HamanoDec 28, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.