You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2021/10/12 22:26:41 UTC

[logging-log4j2] branch release-2.x updated (f4623bb -> b7d26d0)

This is an automated email from the ASF dual-hosted git repository.

vy pushed a change to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git.


 discard f4623bb  Overhaul `benchmarks` GitHub Actions workflow.
     new b7d26d0  Overhaul `benchmarks` GitHub Actions workflow.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (f4623bb)
            \
             N -- N -- N   refs/heads/release-2.x (b7d26d0)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/benchmark.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

[logging-log4j2] 01/01: Overhaul `benchmarks` GitHub Actions workflow.

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit b7d26d022f6ace97fbc183fd80b770251051b64d
Author: Volkan Yazici <vo...@gmail.com>
AuthorDate: Wed Oct 13 00:22:47 2021 +0200

    Overhaul `benchmarks` GitHub Actions workflow.
---
 .github/workflows/benchmark.yml | 91 +++++++++++++++++++++--------------------
 1 file changed, 47 insertions(+), 44 deletions(-)

diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index 4b8402c..b1f0098 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -15,34 +15,22 @@
 
 name: benchmark
 
-on: [workflow_dispatch]
+on: [ workflow_dispatch ]
 
 jobs:
 
-  run:
+  build:
 
     if: github.repository == 'apache/logging-log4j2'
 
-    runs-on: ${{ matrix.os }}
-
-    strategy:
-      matrix:
-        os: [macos-latest, ubuntu-latest, windows-latest]
-        jdk: [8, 11, 17]
-        concurrency: [1, 8]
+    runs-on: ubuntu-latest
 
     steps:
 
       - name: Checkout repository
         uses: actions/checkout@v2
 
-      - name: Set up Maven caching
-        uses: actions/cache@v2
-        with:
-          path: ~/.m2/repository
-          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
-          restore-keys: ${{ runner.os }}-maven-
-
+      # JDK 11 is needed for the build.
       - name: Set up JDK 11
         uses: actions/setup-java@v2.3.1
         with:
@@ -52,8 +40,8 @@ jobs:
           architecture: x64
           cache: maven
 
-      # JDK 8 needs to be set up after 11, so that JAVA_HOME used by Maven during build will point to 8.
-      # Running Maven with JDK 11 causes build to fail.
+      # JDK 8 is needed for the build, and it is the primary bytecode target.
+      # Hence, JDK 8 is set up after 11, so that JAVA_HOME used by Maven during build will point to 8.
       - name: Set up JDK 8
         uses: actions/setup-java@v2.3.1
         with:
@@ -63,6 +51,13 @@ jobs:
           architecture: x64
           cache: maven
 
+      - name: Set up Maven caching
+        uses: actions/cache@v2
+        with:
+          path: ~/.m2/repository
+          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-maven-
+
       - name: Build with Maven
         shell: bash
         run: |
@@ -74,8 +69,37 @@ jobs:
             --also-make \
             package
 
-      # Even though we have set up JDK 8 and 11, we still need this step to set up JAVA_HOME before running benchmarks.
-      # Otherwise, benchmarks will always run with the last set up JDK, that is, 11.
+      - name: Upload built sources
+        uses: actions/upload-artifact@v2
+        with:
+          name: benchmarks.jar
+          path: log4j-perf/target/benchmarks.jar
+
+  run:
+
+    needs: build
+
+    runs-on: ${{ matrix.os }}
+
+    strategy:
+      matrix:
+        os: [ macos-latest, ubuntu-latest, windows-latest ]
+        jdk: [ 11, 17 ]
+        concurrency: [ 1, 8 ]
+        jmhCommand:
+          - "-t $CONCURRENCY -f 2 -wi 3 -w 20s -i 5 -r 30s -prof gc -rf json -rff results-layout-jtl.json '.*JsonTemplateLayoutBenchmark.*'"
+
+    steps:
+
+      - name: Checkout repository
+        uses: actions/checkout@v2
+
+      - name: Download built sources
+        uses: actions/download-artifact@v2
+        with:
+          name: benchmarks.jar
+          path: log4j-perf/target/benchmarks.jar
+
       - name: Set up JDK ${{ matrix.jdk }}
         uses: actions/setup-java@v2.3.1
         with:
@@ -85,35 +109,14 @@ jobs:
           architecture: x64
           cache: maven
 
-      # ------------------------------------------------------------------------
-      # BEGIN: Individual Benchmark Runs
-      #
-      # Add your benchmarks below.
-      # Make sure that your benchmark job
-      #
-      # - has a decent `timeout-minutes` property.
-      # - uses `bash` for shell.
-      #   `pwsh`, the default shell on Windows, hijacks certain keywords and results in unexpected ways.
-      # - generates a JSON-formatted result output to `log4j-perf/target/results-<name>.json`.
-      #   In `<name>`, prefer hierarchical and bash-friendly names.
-      #   For instance, `layout-pattern`, `layout-jtl`, `appender-file`, etc.
-
-      - name: Run JSON Template Layout benchmarks
+      - name: Run benchmarks
         timeout-minutes: 60
-        if: ${{ matrix.concurrency == 1 }}
         shell: bash
         run: |
+          export CONCURRENCY=${{ matrix.concurrency }}
           java \
             -jar log4j-perf/target/benchmarks.jar \
-            -f 2 \
-            -wi 3 -w 20s \
-            -i 5 -r 30s \
-            -prof gc \
-            -rf json -rff log4j-perf/target/results-layout-jtl.json \
-            ".*JsonTemplateLayoutBenchmark.*"
-
-      # END: Individual Benchmark Runs
-      # ------------------------------------------------------------------------
+            ${{ matrix.jmhCommand }}
 
       - name: Stage benchmark results for commit
         shell: bash