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
cb7f99ad
Commit
cb7f99ad
authored
Jul 09, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Measure with nanoseconds in HttpExchangeTracer"
See gh-22266
parent
d72f5139
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
HttpExchangeTracer.java
...framework/boot/actuate/trace/http/HttpExchangeTracer.java
+1
-1
HttpTrace.java
...rg/springframework/boot/actuate/trace/http/HttpTrace.java
+5
-5
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracer.java
View file @
cb7f99ad
...
...
@@ -103,7 +103,7 @@ public class HttpExchangeTracer {
}
private
long
calculateTimeTaken
(
HttpTrace
trace
)
{
return
TimeUnit
.
NANOSECONDS
.
toMillis
(
System
.
nanoTime
()
-
trace
.
getNanoTime
());
return
TimeUnit
.
NANOSECONDS
.
toMillis
(
System
.
nanoTime
()
-
trace
.
get
Start
NanoTime
());
}
private
final
class
FilteredTraceableRequest
implements
TraceableRequest
{
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/HttpTrace.java
View file @
cb7f99ad
...
...
@@ -46,7 +46,7 @@ public final class HttpTrace {
private
volatile
Long
timeTaken
;
private
final
transient
long
n
anoTime
;
private
final
long
startN
anoTime
;
/**
* Creates a fully-configured {@code HttpTrace} instance. Primarily for use by
...
...
@@ -69,13 +69,13 @@ public final class HttpTrace {
this
.
principal
=
principal
;
this
.
session
=
session
;
this
.
timeTaken
=
timeTaken
;
this
.
n
anoTime
=
0
;
this
.
startN
anoTime
=
0
;
}
HttpTrace
(
TraceableRequest
request
)
{
this
.
request
=
new
Request
(
request
);
this
.
timestamp
=
Instant
.
now
();
this
.
n
anoTime
=
System
.
nanoTime
();
this
.
startN
anoTime
=
System
.
nanoTime
();
}
public
Instant
getTimestamp
()
{
...
...
@@ -122,8 +122,8 @@ public final class HttpTrace {
this
.
timeTaken
=
timeTaken
;
}
long
getNanoTime
()
{
return
this
.
n
anoTime
;
long
get
Start
NanoTime
()
{
return
this
.
startN
anoTime
;
}
/**
...
...
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