-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into struct-info-provider
- Loading branch information
Showing
310 changed files
with
9,164 additions
and
2,447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Publish Armeria site | ||
|
||
on: | ||
push: | ||
tags: | ||
- armeria-* | ||
|
||
env: | ||
LC_ALL: 'en_US.UTF-8' | ||
|
||
jobs: | ||
publish-site: | ||
if: github.repository == 'line/armeria' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install svgbob_cli | ||
run: | | ||
sudo apt-get -y install cargo && cargo install svgbob_cli | ||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
- id: setup-jdk-17 | ||
name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Build the site | ||
run: | | ||
./gradlew --no-daemon --stacktrace --max-workers=2 --parallel site | ||
- name: Deploy the site | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: site/public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dependencies { | ||
testImplementation 'org.jooq:joor' | ||
testImplementation libs.joor | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
.../java/com/linecorp/armeria/internal/common/LeakTracingRequestContextStorageBenchmark.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright 2022 LINE Corporation | ||
* | ||
* LINE Corporation licenses this file to you under the Apache License, | ||
* version 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.linecorp.armeria.internal.common; | ||
|
||
import org.openjdk.jmh.annotations.Benchmark; | ||
|
||
import com.linecorp.armeria.common.HttpMethod; | ||
import com.linecorp.armeria.common.HttpRequest; | ||
import com.linecorp.armeria.common.RequestContext; | ||
import com.linecorp.armeria.common.RequestContextStorage; | ||
import com.linecorp.armeria.common.util.Sampler; | ||
import com.linecorp.armeria.server.ServiceRequestContext; | ||
|
||
/** | ||
* Microbenchmarks for LeakTracingRequestContextStorage. | ||
*/ | ||
public class LeakTracingRequestContextStorageBenchmark { | ||
|
||
private static final RequestContextStorage threadLocalReqCtxStorage = | ||
RequestContextStorage.threadLocal(); | ||
private static final RequestContextStorage neverSample = | ||
new LeakTracingRequestContextStorage(threadLocalReqCtxStorage, Sampler.never()); | ||
private static final RequestContextStorage rateLimited1 = | ||
new LeakTracingRequestContextStorage(threadLocalReqCtxStorage, Sampler.of("rate-limited=1")); | ||
private static final RequestContextStorage rateLimited10 = | ||
new LeakTracingRequestContextStorage(threadLocalReqCtxStorage, Sampler.of("rate-limited=10")); | ||
private static final RequestContextStorage random1 = | ||
new LeakTracingRequestContextStorage(threadLocalReqCtxStorage, Sampler.of("random=0.01")); | ||
private static final RequestContextStorage random10 = | ||
new LeakTracingRequestContextStorage(threadLocalReqCtxStorage, Sampler.of("random=0.10")); | ||
private static final RequestContextStorage alwaysSample = | ||
new LeakTracingRequestContextStorage(threadLocalReqCtxStorage, Sampler.always()); | ||
private static final RequestContext reqCtx = newCtx("/"); | ||
|
||
private static ServiceRequestContext newCtx(String path) { | ||
return ServiceRequestContext.builder(HttpRequest.of(HttpMethod.GET, path)) | ||
.build(); | ||
} | ||
|
||
@Benchmark | ||
public void baseline_threadLocal() { | ||
final RequestContext oldCtx = threadLocalReqCtxStorage.push(reqCtx); | ||
threadLocalReqCtxStorage.pop(reqCtx, oldCtx); | ||
} | ||
|
||
@Benchmark | ||
public void leakTracing_never_sample() { | ||
final RequestContext oldCtx = neverSample.push(reqCtx); | ||
neverSample.pop(reqCtx, oldCtx); | ||
} | ||
|
||
@Benchmark | ||
public void leakTracing_rateLimited_1() { | ||
final RequestContext oldCtx = rateLimited1.push(reqCtx); | ||
rateLimited1.pop(reqCtx, oldCtx); | ||
} | ||
|
||
@Benchmark | ||
public void leakTracing_rateLimited_10() { | ||
final RequestContext oldCtx = rateLimited10.push(reqCtx); | ||
rateLimited10.pop(reqCtx, oldCtx); | ||
} | ||
|
||
@Benchmark | ||
public void leakTracing_random_1() { | ||
final RequestContext oldCtx = random1.push(reqCtx); | ||
random1.pop(reqCtx, oldCtx); | ||
} | ||
|
||
@Benchmark | ||
public void leakTracing_random_10() { | ||
final RequestContext oldCtx = random10.push(reqCtx); | ||
random10.pop(reqCtx, oldCtx); | ||
} | ||
|
||
@Benchmark | ||
public void leakTracing_always_sample() { | ||
final RequestContext oldCtx = alwaysSample.push(reqCtx); | ||
alwaysSample.pop(reqCtx, oldCtx); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
dependencies { | ||
api 'io.zipkin.brave:brave' | ||
api 'io.zipkin.brave:brave-instrumentation-http' | ||
api libs.brave | ||
api libs.brave.instrumentation.http | ||
|
||
testImplementation project(':thrift0.16') | ||
testImplementation 'io.zipkin.brave:brave-context-slf4j' | ||
testImplementation 'io.zipkin.brave:brave-instrumentation-http-tests' | ||
testImplementation libs.brave.context.slf4j | ||
testImplementation libs.brave.instrumentation.http.tests | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
dependencies { | ||
// Bucket4j - rate-limiting library based on Token-Bucket algorithm | ||
implementation 'com.github.vladimir-bukhtoyarov:bucket4j-core' | ||
implementation libs.bucket4j | ||
} |
Oops, something went wrong.