You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/06/21 05:08:52 UTC
[GitHub] [incubator-shenyu] HaiqiQin opened a new pull request, #3593: [type:refactor] change logging-elasticsearch-plugin thread pool
HaiqiQin opened a new pull request, #3593:
URL: https://github.com/apache/incubator-shenyu/pull/3593
<!-- Describe your PR here; eg. Fixes #issueNo -->
use ShenyuThreadPoolExecutor
<!--
Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
-->
Make sure that:
- [ ] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
- [ ] You submit test cases (unit or integration tests) that back your changes.
- [ ] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] yu199195 commented on a diff in pull request #3593: [type:refactor] change logging-elasticsearch-plugin thread pool
Posted by GitBox <gi...@apache.org>.
yu199195 commented on code in PR #3593:
URL: https://github.com/apache/incubator-shenyu/pull/3593#discussion_r902254970
##########
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/AbstractLogCollector.java:
##########
@@ -49,11 +53,15 @@ public abstract class AbstractLogCollector implements LogCollector {
private final AtomicBoolean started = new AtomicBoolean(true);
+ private final ThreadFactory factory = ShenyuThreadFactory.create("shenyu-logging-elasticsearch", true);
+
@Override
public void start() {
bufferSize = LogCollectConfigUtils.getGlobalLogConfig().getBufferQueueSize();
bufferQueue = new LinkedBlockingDeque<>(bufferSize);
- ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
+ ByteBuddyAgent.install();
+ ShenyuThreadPoolExecutor threadExecutor = new ShenyuThreadPoolExecutor(1, 1, 0L,
+ TimeUnit.MILLISECONDS, new MemoryLimitedTaskQueue<>(ByteBuddyAgent.getInstrumentation()), factory, new AbortPolicy());
Review Comment:
new ShenyuThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime,
TimeUnit.MILLISECONDS, provider.getIfAvailable(() -> new MemorySafeTaskQueue<>(Constants.THE_256_MB)),
ShenyuThreadFactory.create(sharedPool.getPrefix(), true),
new ThreadPoolExecutor.AbortPolicy());
##########
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/pom.xml:
##########
@@ -61,6 +61,10 @@
<artifactId>jakarta.json-api</artifactId>
<version>${jakarta.json-api.version}</version>
</dependency>
+ <dependency>
Review Comment:
remove this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] HaiqiQin commented on a diff in pull request #3593: [type:refactor] change logging-elasticsearch-plugin thread pool
Posted by GitBox <gi...@apache.org>.
HaiqiQin commented on code in PR #3593:
URL: https://github.com/apache/incubator-shenyu/pull/3593#discussion_r902256798
##########
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/pom.xml:
##########
@@ -61,6 +61,10 @@
<artifactId>jakarta.json-api</artifactId>
<version>${jakarta.json-api.version}</version>
</dependency>
+ <dependency>
Review Comment:
OK.Thank you!
##########
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/AbstractLogCollector.java:
##########
@@ -49,11 +53,15 @@ public abstract class AbstractLogCollector implements LogCollector {
private final AtomicBoolean started = new AtomicBoolean(true);
+ private final ThreadFactory factory = ShenyuThreadFactory.create("shenyu-logging-elasticsearch", true);
+
@Override
public void start() {
bufferSize = LogCollectConfigUtils.getGlobalLogConfig().getBufferQueueSize();
bufferQueue = new LinkedBlockingDeque<>(bufferSize);
- ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
+ ByteBuddyAgent.install();
+ ShenyuThreadPoolExecutor threadExecutor = new ShenyuThreadPoolExecutor(1, 1, 0L,
+ TimeUnit.MILLISECONDS, new MemoryLimitedTaskQueue<>(ByteBuddyAgent.getInstrumentation()), factory, new AbortPolicy());
Review Comment:
OK.I will modify it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] yu199195 merged pull request #3593: [type:refactor] change logging-elasticsearch-plugin thread pool
Posted by GitBox <gi...@apache.org>.
yu199195 merged PR #3593:
URL: https://github.com/apache/incubator-shenyu/pull/3593
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] codecov-commenter commented on pull request #3593: [type:refactor] change logging-elasticsearch-plugin thread pool
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3593:
URL: https://github.com/apache/incubator-shenyu/pull/3593#issuecomment-1161280360
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3593?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#3593](https://codecov.io/gh/apache/incubator-shenyu/pull/3593?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a1e7220) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/79b5a90e2086d27b337750e2cf242fef898b3b33?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (79b5a90) will **decrease** coverage by `0.32%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #3593 +/- ##
============================================
- Coverage 62.39% 62.06% -0.33%
- Complexity 5574 5660 +86
============================================
Files 854 870 +16
Lines 23588 24063 +475
Branches 2149 2191 +42
============================================
+ Hits 14717 14935 +218
- Misses 7513 7724 +211
- Partials 1358 1404 +46
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/3593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...in/logging/elasticsearch/AbstractLogCollector.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLWVsYXN0aWNzZWFyY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vbG9nZ2luZy9lbGFzdGljc2VhcmNoL0Fic3RyYWN0TG9nQ29sbGVjdG9yLmphdmE=) | `76.74% <100.00%> (ø)` | |
| [...plugin/logging/rocketmq/LoggingRocketMQPlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvTG9nZ2luZ1JvY2tldE1RUGx1Z2luLmphdmE=) | `22.72% <0.00%> (-72.73%)` | :arrow_down: |
| [...controller/ShenyuClientHttpRegistryController.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vY29udHJvbGxlci9TaGVueXVDbGllbnRIdHRwUmVnaXN0cnlDb250cm9sbGVyLmphdmE=) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
| [...ogging/rocketmq/body/LoggingServerHttpRequest.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvYm9keS9Mb2dnaW5nU2VydmVySHR0cFJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-20.00%)` | :arrow_down: |
| [...henyu/admin/service/impl/UpstreamCheckService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vc2VydmljZS9pbXBsL1Vwc3RyZWFtQ2hlY2tTZXJ2aWNlLmphdmE=) | `47.22% <0.00%> (-19.45%)` | :arrow_down: |
| [...he/shenyu/common/timer/HierarchicalWheelTimer.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi90aW1lci9IaWVyYXJjaGljYWxXaGVlbFRpbWVyLmphdmE=) | `68.00% <0.00%> (-18.00%)` | :arrow_down: |
| [...va/org/apache/shenyu/common/timer/TimingWheel.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi90aW1lci9UaW1pbmdXaGVlbC5qYXZh) | `73.80% <0.00%> (-16.67%)` | :arrow_down: |
| [...henyu/plugin/grpc/resolver/ShenyuNameResolver.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9yZXNvbHZlci9TaGVueXVOYW1lUmVzb2x2ZXIuamF2YQ==) | `51.06% <0.00%> (-12.77%)` | :arrow_down: |
| [...ruptor/RegisterClientServerDisruptorPublisher.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vZGlzcnVwdG9yL1JlZ2lzdGVyQ2xpZW50U2VydmVyRGlzcnVwdG9yUHVibGlzaGVyLmphdmE=) | `52.94% <0.00%> (-11.77%)` | :arrow_down: |
| [...a/org/apache/shenyu/common/utils/VersionUtils.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi91dGlscy9WZXJzaW9uVXRpbHMuamF2YQ==) | `67.85% <0.00%> (-10.72%)` | :arrow_down: |
| ... and [32 more](https://codecov.io/gh/apache/incubator-shenyu/pull/3593/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3593?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3593?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [79b5a90...a1e7220](https://codecov.io/gh/apache/incubator-shenyu/pull/3593?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] yu199195 commented on a diff in pull request #3593: [type:refactor] change logging-elasticsearch-plugin thread pool
Posted by GitBox <gi...@apache.org>.
yu199195 commented on code in PR #3593:
URL: https://github.com/apache/incubator-shenyu/pull/3593#discussion_r902255290
##########
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/AbstractLogCollector.java:
##########
@@ -49,11 +53,15 @@ public abstract class AbstractLogCollector implements LogCollector {
private final AtomicBoolean started = new AtomicBoolean(true);
+ private final ThreadFactory factory = ShenyuThreadFactory.create("shenyu-logging-elasticsearch", true);
+
@Override
public void start() {
bufferSize = LogCollectConfigUtils.getGlobalLogConfig().getBufferQueueSize();
bufferQueue = new LinkedBlockingDeque<>(bufferSize);
- ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
+ ByteBuddyAgent.install();
Review Comment:
remove bytebuddy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org