You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/01/09 17:59:05 UTC
[GitHub] [skywalking] devkanro opened a new pull request #4209: Optimize
trace ignore plugin
devkanro opened a new pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209
# Skywalking with fast ignore
This PR enhances the trace ignore plugin of Skywalking.
It makes that plugin faster and lightweight.
## Checklist
This PR still in WIP state, you can merge this PR after all check is done.
- [x] Implementation
- [x] Test
- [ ] Documents
- [ ] CI build pass
- [ ] Review
## Description
The original trace ignore plugin has bad performance and memory usage.
I optimized it at those points:
01. The `FastPathMatcher` provided pattern matching without any new object created.
Space complexity: **O(1)**
02. The `FastPathMatcher` uses the `Depth-first search` algorithm for pattern matching.
Worst time complexity: **O(MN)**
Best time complexity: **O(min(M,N))**
(M: the String size, N: the Pattern size)
03. We split the configs in initializing code, not every `createTraceContext` method.
## Benchmark
This PR improves the performance of the matcher from `475767.318 ± 1507.989 ops/s` to `3921231.220 ± 15153.711 ops/s`. It improves performance by about **824.2%**.
Benchmark | matcher | Mode | Cnt | Score | Error | Units
-----------------------------------|-------------|--------|--------|-------------|-------------|------
MatcherBenchmark.init | Original | thrpt | 20 | 475767.318 | ± 1507.989 | ops/s
MatcherBenchmark.init | PR Provided | thrpt | 20 | 3921231.220 | ± 15153.711 | ops/s
MatcherBenchmark.init | Original | avgt | 20 | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init | PR Provided | avgt | 20 | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init | Original | sample | 579005 | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.00 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.50 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.90 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.95 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.99 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.999 | Original | sample | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init:init·p0.9999 | Original | sample | | ≈ 10⁻⁴ | | s/op
MatcherBenchmark.init:init·p1.00 | Original | sample | | 0.001 | | s/op
MatcherBenchmark.init | PR Provided | sample | 581269 | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.00 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.50 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.90 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.95 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.99 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.999 | PR Provided | sample | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init:init·p0.9999 | PR Provided | sample | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init:init·p1.00 | PR Provided | sample | | ≈ 10⁻⁴ | | s/op
MatcherBenchmark.init | Original | ss | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init | PR Provided | ss | | ≈ 10⁻⁵ | | s/op
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro closed pull request #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro closed pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] wu-sheng commented on issue #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572826670
CI fails, please fix.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro commented on issue #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro commented on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572903518
> CI fails, please fix.
Ummm, all check failed? How can I retry for 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request
#4209: Optimize trace ignore plugin
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#discussion_r365490523
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ * http://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 org.apache.skywalking.apm.plugin.trace.ignore.matcher;
+
+/**
+ * @author kanro
+ */
+public class FastPathMatcher implements TracePathMatcher {
+ @Override
+ public boolean match(String pattern, String path) {
+ return normalMatch(pattern, 0, path, 0);
+ }
+
+ private boolean normalMatch(String pat, int p, String str, int s) {
+ while (p < pat.length()) {
+ char pc = pat.charAt(p);
+ char sc = safeCharAt(str, s);
+
+ // Got * in pattern, entry the wildcard mode.
+ // ↓ ↓
+ // pattern: a/* a/*
+ // ↓ ↓
+ // string: a/bcd a/
+ if (pc == '*') {
+ p++;
+ // Got * in pattern again, entry the multi-wildcard mode.
+ // ↓ ↓
+ // pattern: a/** a/**
+ // ↓ ↓
+ // string: a/bcd a/
+ if (safeCharAt(pat, p) == '*') {
+ p++;
+ // Entry the multi-wildcard mode.
+ // ↓ ↓
+ // pattern: a/** a/**
+ // ↓ ↓
+ // string: a/bcd a/
+ return multiWildcardMatch(pat, p, str, s);
+ } else {
+ // Entry the wildcard mode.
+ // ↓
+ // pattern: a/*
+ // ↓
+ // string: a/bcd
+ return wildcardMatch(pat, p, str, s);
+ }
+ }
+
+ // Matching ? for non-'/' char, or matching the same chars.
+ // ↓ ↓ ↓
+ // pattern: a/?/c a/b/c a/b
+ // ↓ ↓ ↓
+ // string: a/b/c a/b/d a/d
+ if ((pc == '?' && sc != 0 && sc != '/') || pc == sc) {
+ s++;
+ p++;
+ continue;
+ }
+
+ // Not matched.
+ // ↓
+ // pattern: a/b
+ // ↓
+ // string: a/c
+ return false;
+ }
+
+ return s == str.length();
+ }
+
+ private boolean wildcardMatch(String pat, int p, String str, int s) {
+ char pc = safeCharAt(pat, p);
+
+ while (true) {
+ char sc = safeCharAt(str, s);
+
+ if (sc == '/') {
+ // Both of pattern and string '/' matched, exit wildcard mode.
+ // ↓
+ // pattern: a/*/
+ // ↓
+ // string: a/bc/
+ if (pc == sc) {
+ return normalMatch(pat, p + 1, str, s + 1);
+ }
+
+ // Not matched string in current path part.
+ // ↓ ↓
+ // pattern: a/* a/*d
+ // ↓ ↓
+ // string: a/bc/ a/bc/
+ return false;
+ }
+
+ // Try to entry normal mode, if not matched, increasing s and try again.
Review comment:
```suggestion
// Try to enter normal mode, if not matched, increasing s and try again.
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] wu-sheng commented on issue #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-573283109
Anything rules have been abandon or changed? Any doc update?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro removed a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro removed a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-573314318
> LGTM. Please fix the comment issue.
Any other issue need for fixing? Document?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro commented on issue #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro commented on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-573314318
> LGTM. Please fix the comment issue.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request
#4209: Optimize trace ignore plugin
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#discussion_r365490489
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ * http://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 org.apache.skywalking.apm.plugin.trace.ignore.matcher;
+
+/**
+ * @author kanro
+ */
+public class FastPathMatcher implements TracePathMatcher {
+ @Override
+ public boolean match(String pattern, String path) {
+ return normalMatch(pattern, 0, path, 0);
+ }
+
+ private boolean normalMatch(String pat, int p, String str, int s) {
+ while (p < pat.length()) {
+ char pc = pat.charAt(p);
+ char sc = safeCharAt(str, s);
+
+ // Got * in pattern, entry the wildcard mode.
+ // ↓ ↓
+ // pattern: a/* a/*
+ // ↓ ↓
+ // string: a/bcd a/
+ if (pc == '*') {
+ p++;
+ // Got * in pattern again, entry the multi-wildcard mode.
+ // ↓ ↓
+ // pattern: a/** a/**
+ // ↓ ↓
+ // string: a/bcd a/
+ if (safeCharAt(pat, p) == '*') {
+ p++;
+ // Entry the multi-wildcard mode.
Review comment:
```suggestion
// Enter the multi-wildcard mode.
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro commented on issue #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro commented on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-573309410
> Anything rules have been abandon or changed? Any doc update?
The unit test all passed, but some trivial rules changed, like:
01. continuous slashes, `a/b/c` will not match with `a/b//c`
02. end of slash, `a/b/c/` will not match with `a/b/c`
Other rules are as same as the legacy matcher.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro edited a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro edited a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-573314318
> LGTM. Please fix the comment issue.
Any other issue need for fixing? Document?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] codecov-io edited a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572917595
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=h1) Report
> Merging [#4209](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/7e9812e8572ec9d8cebef452be0f0a40ee0fae66?src=pr&el=desc) will **decrease** coverage by `0.19%`.
> The diff coverage is `93.61%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4209/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #4209 +/- ##
=========================================
- Coverage 26.66% 26.46% -0.2%
=========================================
Files 1178 1178
Lines 25773 25693 -80
Branches 3748 3725 -23
=========================================
- Hits 6872 6800 -72
- Misses 18286 18296 +10
+ Partials 615 597 -18
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../plugin/trace/ignore/TraceIgnoreExtendService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL1RyYWNlSWdub3JlRXh0ZW5kU2VydmljZS5qYXZh) | `82.35% <75%> (+17.35%)` | :arrow_up: |
| [...m/plugin/trace/ignore/matcher/FastPathMatcher.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL21hdGNoZXIvRmFzdFBhdGhNYXRjaGVyLmphdmE=) | `97.43% <97.43%> (ø)` | |
| [...pm/agent/core/profile/ProfileTaskQueryService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcHJvZmlsZS9Qcm9maWxlVGFza1F1ZXJ5U2VydmljZS5qYXZh) | `43.58% <0%> (-25.65%)` | :arrow_down: |
| [...apm/agent/core/remote/GRPCStreamServiceStatus.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENTdHJlYW1TZXJ2aWNlU3RhdHVzLmphdmE=) | `29.16% <0%> (-25.01%)` | :arrow_down: |
| [.../core/remote/ServiceAndEndpointRegisterClient.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL1NlcnZpY2VBbmRFbmRwb2ludFJlZ2lzdGVyQ2xpZW50LmphdmE=) | `31.46% <0%> (-13.49%)` | :arrow_down: |
| [...king/apm/agent/core/remote/GRPCChannelManager.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENDaGFubmVsTWFuYWdlci5qYXZh) | `67.94% <0%> (-1.29%)` | :arrow_down: |
| [.../agent/core/context/trace/AbstractTracingSpan.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvY29udGV4dC90cmFjZS9BYnN0cmFjdFRyYWNpbmdTcGFuLmphdmE=) | `60.36% <0%> (-0.91%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=footer). Last update [7e9812e...5a9f4a7](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] codecov-io edited a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572917595
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=h1) Report
> Merging [#4209](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/7e9812e8572ec9d8cebef452be0f0a40ee0fae66?src=pr&el=desc) will **decrease** coverage by `0.18%`.
> The diff coverage is `93.61%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4209/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #4209 +/- ##
==========================================
- Coverage 26.66% 26.47% -0.19%
==========================================
Files 1178 1178
Lines 25773 25693 -80
Branches 3748 3725 -23
==========================================
- Hits 6872 6802 -70
- Misses 18286 18294 +8
+ Partials 615 597 -18
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../plugin/trace/ignore/TraceIgnoreExtendService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL1RyYWNlSWdub3JlRXh0ZW5kU2VydmljZS5qYXZh) | `82.35% <75%> (+17.35%)` | :arrow_up: |
| [...m/plugin/trace/ignore/matcher/FastPathMatcher.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL21hdGNoZXIvRmFzdFBhdGhNYXRjaGVyLmphdmE=) | `97.43% <97.43%> (ø)` | |
| [...apm/agent/core/remote/GRPCStreamServiceStatus.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENTdHJlYW1TZXJ2aWNlU3RhdHVzLmphdmE=) | `29.16% <0%> (-25.01%)` | :arrow_down: |
| [...pm/agent/core/profile/ProfileTaskQueryService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcHJvZmlsZS9Qcm9maWxlVGFza1F1ZXJ5U2VydmljZS5qYXZh) | `48.71% <0%> (-20.52%)` | :arrow_down: |
| [.../core/remote/ServiceAndEndpointRegisterClient.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL1NlcnZpY2VBbmRFbmRwb2ludFJlZ2lzdGVyQ2xpZW50LmphdmE=) | `31.46% <0%> (-13.49%)` | :arrow_down: |
| [...king/apm/agent/core/remote/GRPCChannelManager.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENDaGFubmVsTWFuYWdlci5qYXZh) | `67.94% <0%> (-1.29%)` | :arrow_down: |
| [.../agent/core/context/trace/AbstractTracingSpan.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvY29udGV4dC90cmFjZS9BYnN0cmFjdFRyYWNpbmdTcGFuLmphdmE=) | `60.36% <0%> (-0.91%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=footer). Last update [7e9812e...4d8a070](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro opened a new pull request #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro opened a new pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209
# Skywalking with fast ignore
This PR enhances the trace ignore plugin of Skywalking.
It makes that plugin faster and lightweight.
## Checklist
This PR still in WIP state, you can merge this PR after all check is done.
- [x] Implementation
- [x] Test
- [ ] Documents
- [x] CI build pass
- [ ] Review
## Description
The original trace ignore plugin has bad performance and memory usage.
I optimized it at those points:
01. The `FastPathMatcher` provided pattern matching without any new object created.
Space complexity: **O(1)**
02. The `FastPathMatcher` uses the `Depth-first search` algorithm for pattern matching.
Worst time complexity: **O(MN)**
Best time complexity: **O(M)**
(M: the String size, N: the Pattern size)
03. We split the configs in initializing code, not every `createTraceContext` method.
## Benchmark
This PR improves the performance of the matcher from `475767.318 ± 1507.989 ops/s` to `3921231.220 ± 15153.711 ops/s`. It improves performance by about **824.2%**.
Benchmark | matcher | Mode | Cnt | Score | Error | Units
-----------------------------------|-------------|--------|--------|-------------|-------------|------
MatcherBenchmark.init | Original | thrpt | 20 | 475767.318 | ± 1507.989 | ops/s
MatcherBenchmark.init | PR Provided | thrpt | 20 | 3921231.220 | ± 15153.711 | ops/s
MatcherBenchmark.init | Original | avgt | 20 | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init | PR Provided | avgt | 20 | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init | Original | sample | 579005 | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.00 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.50 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.90 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.95 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.99 | Original | sample | | ≈ 10⁻⁶ | | s/op
MatcherBenchmark.init:init·p0.999 | Original | sample | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init:init·p0.9999 | Original | sample | | ≈ 10⁻⁴ | | s/op
MatcherBenchmark.init:init·p1.00 | Original | sample | | 0.001 | | s/op
MatcherBenchmark.init | PR Provided | sample | 581269 | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.00 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.50 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.90 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.95 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.99 | PR Provided | sample | | ≈ 10⁻⁷ | | s/op
MatcherBenchmark.init:init·p0.999 | PR Provided | sample | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init:init·p0.9999 | PR Provided | sample | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init:init·p1.00 | PR Provided | sample | | ≈ 10⁻⁴ | | s/op
MatcherBenchmark.init | Original | ss | | ≈ 10⁻⁵ | | s/op
MatcherBenchmark.init | PR Provided | ss | | ≈ 10⁻⁵ | | s/op
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] codecov-io commented on issue #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572917595
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@8090291`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4209/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #4209 +/- ##
=========================================
Coverage ? 26.48%
=========================================
Files ? 1178
Lines ? 25686
Branches ? 3722
=========================================
Hits ? 6803
Misses ? 18287
Partials ? 596
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../plugin/trace/ignore/TraceIgnoreExtendService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL1RyYWNlSWdub3JlRXh0ZW5kU2VydmljZS5qYXZh) | `82.35% <100%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=footer). Last update [8090291...54f8895](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] codecov-io edited a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572917595
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=h1) Report
> Merging [#4209](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/54f8895cfd7e9377894789a5fb6414a0036199f1?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `0%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4209/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #4209 +/- ##
==========================================
- Coverage 26.48% 26.46% -0.02%
==========================================
Files 1178 1178
Lines 25686 25693 +7
Branches 3722 3725 +3
==========================================
- Hits 6803 6800 -3
- Misses 18287 18296 +9
- Partials 596 597 +1
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...pm/agent/core/profile/ProfileTaskQueryService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcHJvZmlsZS9Qcm9maWxlVGFza1F1ZXJ5U2VydmljZS5qYXZh) | `43.58% <0%> (-18.92%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=footer). Last update [54f8895...4df92ae](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request
#4209: Optimize trace ignore plugin
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#discussion_r365490447
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ * http://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 org.apache.skywalking.apm.plugin.trace.ignore.matcher;
+
+/**
+ * @author kanro
+ */
+public class FastPathMatcher implements TracePathMatcher {
+ @Override
+ public boolean match(String pattern, String path) {
+ return normalMatch(pattern, 0, path, 0);
+ }
+
+ private boolean normalMatch(String pat, int p, String str, int s) {
+ while (p < pat.length()) {
+ char pc = pat.charAt(p);
+ char sc = safeCharAt(str, s);
+
+ // Got * in pattern, entry the wildcard mode.
Review comment:
```suggestion
// Got * in pattern, enter the wildcard mode.
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] codecov-io edited a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572917595
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=h1) Report
> Merging [#4209](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/7e9812e8572ec9d8cebef452be0f0a40ee0fae66?src=pr&el=desc) will **decrease** coverage by `0.18%`.
> The diff coverage is `93.61%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4209/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #4209 +/- ##
==========================================
- Coverage 26.66% 26.47% -0.19%
==========================================
Files 1178 1178
Lines 25773 25693 -80
Branches 3748 3725 -23
==========================================
- Hits 6872 6803 -69
- Misses 18286 18294 +8
+ Partials 615 596 -19
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../plugin/trace/ignore/TraceIgnoreExtendService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL1RyYWNlSWdub3JlRXh0ZW5kU2VydmljZS5qYXZh) | `82.35% <75%> (+17.35%)` | :arrow_up: |
| [...m/plugin/trace/ignore/matcher/FastPathMatcher.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL21hdGNoZXIvRmFzdFBhdGhNYXRjaGVyLmphdmE=) | `97.43% <97.43%> (ø)` | |
| [...apm/agent/core/remote/GRPCStreamServiceStatus.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENTdHJlYW1TZXJ2aWNlU3RhdHVzLmphdmE=) | `29.16% <0%> (-25.01%)` | :arrow_down: |
| [...pm/agent/core/profile/ProfileTaskQueryService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcHJvZmlsZS9Qcm9maWxlVGFza1F1ZXJ5U2VydmljZS5qYXZh) | `51.28% <0%> (-17.95%)` | :arrow_down: |
| [.../core/remote/ServiceAndEndpointRegisterClient.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL1NlcnZpY2VBbmRFbmRwb2ludFJlZ2lzdGVyQ2xpZW50LmphdmE=) | `31.46% <0%> (-13.49%)` | :arrow_down: |
| [...king/apm/agent/core/remote/GRPCChannelManager.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENDaGFubmVsTWFuYWdlci5qYXZh) | `67.94% <0%> (-1.29%)` | :arrow_down: |
| [.../agent/core/context/trace/AbstractTracingSpan.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvY29udGV4dC90cmFjZS9BYnN0cmFjdFRyYWNpbmdTcGFuLmphdmE=) | `60.36% <0%> (-0.91%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=footer). Last update [7e9812e...5a9f4a7](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] codecov-io edited a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572917595
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=h1) Report
> Merging [#4209](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/4df92aed6814842067a7094bbe67f468cf3819b3?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4209/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #4209 +/- ##
==========================================
- Coverage 26.46% 26.45% -0.02%
==========================================
Files 1178 1178
Lines 25693 25693
Branches 3725 3725
==========================================
- Hits 6800 6796 -4
- Misses 18296 18299 +3
- Partials 597 598 +1
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...m/plugin/trace/ignore/matcher/FastPathMatcher.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvb3B0aW9uYWwtcGx1Z2lucy90cmFjZS1pZ25vcmUtcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS9wbHVnaW4vdHJhY2UvaWdub3JlL21hdGNoZXIvRmFzdFBhdGhNYXRjaGVyLmphdmE=) | `97.43% <ø> (ø)` | :arrow_up: |
| [.../core/remote/ServiceAndEndpointRegisterClient.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL1NlcnZpY2VBbmRFbmRwb2ludFJlZ2lzdGVyQ2xpZW50LmphdmE=) | `28.08% <0%> (-3.38%)` | :arrow_down: |
| [...ache/skywalking/apm/agent/core/jvm/JVMService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvanZtL0pWTVNlcnZpY2UuamF2YQ==) | `75.4% <0%> (-1.64%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=footer). Last update [4df92ae...5a9f4a7](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] codecov-io edited a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572917595
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=h1) Report
> Merging [#4209](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/4df92aed6814842067a7094bbe67f468cf3819b3?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4209/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #4209 +/- ##
==========================================
+ Coverage 26.46% 26.47% +<.01%
==========================================
Files 1178 1178
Lines 25693 25693
Branches 3725 3725
==========================================
+ Hits 6800 6802 +2
+ Misses 18296 18294 -2
Partials 597 597
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...pm/agent/core/profile/ProfileTaskQueryService.java](https://codecov.io/gh/apache/skywalking/pull/4209/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcHJvZmlsZS9Qcm9maWxlVGFza1F1ZXJ5U2VydmljZS5qYXZh) | `48.71% <0%> (+5.12%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=footer). Last update [4df92ae...4d8a070](https://codecov.io/gh/apache/skywalking/pull/4209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro commented on issue #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro commented on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572914782
> CI fails, please fix.
It fails with those errors, ummmm... I think it not caused by this PR.
```Log
2020-01-10T07:23:05.4828509Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project server-starter-es7: Compilation failure
2020-01-10T07:23:05.4828888Z [ERROR] Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider io.sundr.builder.internal.processor.ExternalBuildableProcessor could not be instantiated: java.lang.RuntimeException: Cannot get Velocity Runtime default properties!
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request
#4209: Optimize trace ignore plugin
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#discussion_r365490504
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ * http://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 org.apache.skywalking.apm.plugin.trace.ignore.matcher;
+
+/**
+ * @author kanro
+ */
+public class FastPathMatcher implements TracePathMatcher {
+ @Override
+ public boolean match(String pattern, String path) {
+ return normalMatch(pattern, 0, path, 0);
+ }
+
+ private boolean normalMatch(String pat, int p, String str, int s) {
+ while (p < pat.length()) {
+ char pc = pat.charAt(p);
+ char sc = safeCharAt(str, s);
+
+ // Got * in pattern, entry the wildcard mode.
+ // ↓ ↓
+ // pattern: a/* a/*
+ // ↓ ↓
+ // string: a/bcd a/
+ if (pc == '*') {
+ p++;
+ // Got * in pattern again, entry the multi-wildcard mode.
+ // ↓ ↓
+ // pattern: a/** a/**
+ // ↓ ↓
+ // string: a/bcd a/
+ if (safeCharAt(pat, p) == '*') {
+ p++;
+ // Entry the multi-wildcard mode.
+ // ↓ ↓
+ // pattern: a/** a/**
+ // ↓ ↓
+ // string: a/bcd a/
+ return multiWildcardMatch(pat, p, str, s);
+ } else {
+ // Entry the wildcard mode.
Review comment:
```suggestion
// Enter the wildcard mode.
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] devkanro removed a comment on issue #4209: Optimize
trace ignore plugin
Posted by GitBox <gi...@apache.org>.
devkanro removed a comment on issue #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#issuecomment-572903518
> CI fails, please fix.
Ummm, all check failed? How can I retry for 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] wu-sheng merged pull request #4209: Optimize trace
ignore plugin
Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request
#4209: Optimize trace ignore plugin
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4209: Optimize trace ignore plugin
URL: https://github.com/apache/skywalking/pull/4209#discussion_r365490464
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ * http://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 org.apache.skywalking.apm.plugin.trace.ignore.matcher;
+
+/**
+ * @author kanro
+ */
+public class FastPathMatcher implements TracePathMatcher {
+ @Override
+ public boolean match(String pattern, String path) {
+ return normalMatch(pattern, 0, path, 0);
+ }
+
+ private boolean normalMatch(String pat, int p, String str, int s) {
+ while (p < pat.length()) {
+ char pc = pat.charAt(p);
+ char sc = safeCharAt(str, s);
+
+ // Got * in pattern, entry the wildcard mode.
+ // ↓ ↓
+ // pattern: a/* a/*
+ // ↓ ↓
+ // string: a/bcd a/
+ if (pc == '*') {
+ p++;
+ // Got * in pattern again, entry the multi-wildcard mode.
Review comment:
```suggestion
// Got * in pattern again, enter the multi-wildcard mode.
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services