Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #9: Use named thread factory for identification #10

Merged
merged 2 commits into from
Jul 30, 2018

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Jul 30, 2018

Signed-off-by: Eric Zhao sczyh16@gmail.com

Describe what this PR does / why we need it

Use named thread factory with all thread pools for identification.

Does this pull request fix one issue?

Fixes #9

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Jul 30, 2018
@sczyh30 sczyh30 added the to-review To review label Jul 30, 2018
@codecov-io
Copy link

codecov-io commented Jul 30, 2018

Codecov Report

Merging #10 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #10      +/-   ##
===========================================
+ Coverage     46.32%   46.4%   +0.08%     
- Complexity      540     542       +2     
===========================================
  Files           105     105              
  Lines          3655    3655              
  Branches        517     517              
===========================================
+ Hits           1693    1696       +3     
+ Misses         1756    1754       -2     
+ Partials        206     205       -1
Impacted Files Coverage Δ Complexity Δ
...a/csp/sentinel/slots/system/SystemRuleManager.java 47% <100%> (ø) 8 <0> (ø) ⬇️
...csp/sentinel/slots/block/flow/FlowRuleManager.java 67.94% <100%> (ø) 18 <0> (ø) ⬇️
.../csp/sentinel/slots/block/degrade/DegradeRule.java 52.7% <100%> (ø) 12 <0> (ø) ⬇️
...ibaba/csp/sentinel/eagleeye/EagleEyeLogDaemon.java 24.24% <0%> (-6.07%) 5% <0%> (-1%)
...a/com/alibaba/csp/sentinel/node/StatisticNode.java 64.91% <0%> (+3.5%) 16% <0%> (+1%) ⬆️
...m/alibaba/csp/sentinel/log/DateFileLogHandler.java 75.92% <0%> (+3.7%) 8% <0%> (+1%) ⬆️
...ntinel/slots/statistic/metric/WindowLeapArray.java 80.64% <0%> (+9.67%) 8% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd9ae9a...031feff. Read the comment docs.

@@ -54,7 +55,8 @@
public class FlowRuleManager {

private static final Map<String, List<FlowRule>> flowRules = new ConcurrentHashMap<String, List<FlowRule>>();
private final static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
private final static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1,
new NamedThreadFactory("sentinel-flow-metrics-record-task", true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should change "sentinel-flow-metrics-record-task" to "sentinel-metrics-record-task"

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Copy link
Contributor

@CarpenterLee CarpenterLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sczyh30 sczyh30 merged commit 47d9070 into master Jul 30, 2018
@sczyh30 sczyh30 deleted the fix/named-thread-pools branch July 30, 2018 10:11
@sczyh30 sczyh30 removed the to-review To review label Jul 30, 2018
sczyh30 added a commit that referenced this pull request Aug 8, 2018
* Use named thread factory with all thread pools for identification

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Arlmls pushed a commit to Arlmls/Sentinel that referenced this pull request Jan 8, 2019
)

* Use named thread factory with all thread pools for identification

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thread pools should be created with NamedThreadFactory for identification
3 participants