Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c908445b
Commit
c908445b
authored
Jun 12, 2018
by
Johnny Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a precompiled pattern in WebClientExchangeTags.extractPath()
parent
5bd9a445
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
WebClientExchangeTags.java
...te/metrics/web/reactive/client/WebClientExchangeTags.java
+5
-1
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java
View file @
c908445b
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
actuate
.
metrics
.
web
.
reactive
.
client
;
package
org
.
springframework
.
boot
.
actuate
.
metrics
.
web
.
reactive
.
client
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.regex.Pattern
;
import
io.micrometer.core.instrument.Tag
;
import
io.micrometer.core.instrument.Tag
;
...
@@ -41,6 +42,9 @@ public final class WebClientExchangeTags {
...
@@ -41,6 +42,9 @@ public final class WebClientExchangeTags {
private
static
final
Tag
CLIENT_ERROR
=
Tag
.
of
(
"status"
,
"CLIENT_ERROR"
);
private
static
final
Tag
CLIENT_ERROR
=
Tag
.
of
(
"status"
,
"CLIENT_ERROR"
);
private
static
final
Pattern
PATTERN_BEFORE_PATH
=
Pattern
.
compile
(
"^https?://[^/]+/"
);
private
WebClientExchangeTags
()
{
private
WebClientExchangeTags
()
{
}
}
...
@@ -66,7 +70,7 @@ public final class WebClientExchangeTags {
...
@@ -66,7 +70,7 @@ public final class WebClientExchangeTags {
}
}
private
static
String
extractPath
(
String
url
)
{
private
static
String
extractPath
(
String
url
)
{
String
path
=
url
.
replaceFirst
(
"^https?://[^/]+/"
,
""
);
String
path
=
PATTERN_BEFORE_PATH
.
matcher
(
url
).
replaceFirst
(
""
);
return
(
path
.
startsWith
(
"/"
)
?
path
:
"/"
+
path
);
return
(
path
.
startsWith
(
"/"
)
?
path
:
"/"
+
path
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment