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:22:51 UTC
[logging-log4j2] branch release-2.x updated (48952ee -> f4623bb)
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.
from 48952ee Add GitHub Actions workflow for benchmarks.
new 5400ffe Fix code typo in JsonTemplateLayoutBenchmarkState.
new 4049240 Prevent override of plugins while shading in log4j-perf.
new f4623bb Overhaul `benchmarks` GitHub Actions workflow.
The 3 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 | 91 +++++++++++-----------
log4j-perf/pom.xml | 10 ++-
.../json/JsonTemplateLayoutBenchmarkState.java | 4 +-
3 files changed, 58 insertions(+), 47 deletions(-)
[logging-log4j2] 01/03: Fix code typo in
JsonTemplateLayoutBenchmarkState.
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 5400ffed6bffac64adee17c2018bee23c268a965
Author: Volkan Yazici <vo...@gmail.com>
AuthorDate: Tue Oct 12 21:37:03 2021 +0200
Fix code typo in JsonTemplateLayoutBenchmarkState.
---
.../log4j/layout/template/json/JsonTemplateLayoutBenchmarkState.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/layout/template/json/JsonTemplateLayoutBenchmarkState.java b/log4j-perf/src/main/java/org/apache/logging/log4j/layout/template/json/JsonTemplateLayoutBenchmarkState.java
index 9a46528..093af99 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/layout/template/json/JsonTemplateLayoutBenchmarkState.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/layout/template/json/JsonTemplateLayoutBenchmarkState.java
@@ -153,9 +153,9 @@ public class JsonTemplateLayoutBenchmarkState {
final Charset layoutCharset = layout.getCharset();
// Note that EcsLayout doesn't support charset configuration, though it
// uses UTF-8 internally.
- if (CHARSET.equals(layoutCharset)) {
+ if (!CHARSET.equals(layoutCharset)) {
throw new IllegalArgumentException(
- "invalid EcsLayout charset: " + layoutCharset);
+ "was expecting EcsLayout charset to be: " + CHARSET + ", found: " + layoutCharset);
}
return layout;
}
[logging-log4j2] 02/03: Prevent override of plugins while shading
in log4j-perf.
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 4049240c87a0c09c92bb454ebc38475b9e2a2150
Author: Volkan Yazici <vo...@gmail.com>
AuthorDate: Tue Oct 12 21:38:14 2021 +0200
Prevent override of plugins while shading in log4j-perf.
---
log4j-perf/pom.xml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/log4j-perf/pom.xml b/log4j-perf/pom.xml
index 174c9f2..128b174 100644
--- a/log4j-perf/pom.xml
+++ b/log4j-perf/pom.xml
@@ -195,7 +195,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
- <version>2.2</version>
+ <version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
@@ -212,6 +212,7 @@
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
+ <transformer implementation="com.github.edwgiz.maven_shade_plugin.log4j2_cache_transformer.PluginsCacheFileTransformer"/>
</transformers>
<filters>
<filter>
@@ -230,6 +231,13 @@
</configuration>
</execution>
</executions>
+ <dependencies>
+ <dependency>
+ <groupId>com.github.edwgiz</groupId>
+ <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
+ <version>2.14.1</version>
+ </dependency>
+ </dependencies>
</plugin>
<!-- Include the standard NOTICE and LICENSE -->
[logging-log4j2] 03/03: 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 f4623bb94b495ea6766b25d16a107cc59b286253
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..410e2c8 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-${{ runner.os }}
+ 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-${{ runner.os }}
+ 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